git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@935488 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -22,7 +22,7 @@ import java.io.Reader; | |||||
| import java.lang.reflect.InvocationTargetException; | import java.lang.reflect.InvocationTargetException; | ||||
| import java.lang.reflect.Method; | import java.lang.reflect.Method; | ||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import org.apache.tools.ant.util.ResourceUtils; | |||||
| /** | /** | ||||
| * Assembles the constants declared in a Java class in | * Assembles the constants declared in a Java class in | ||||
| @@ -104,7 +104,7 @@ public final class ClassConstants | |||||
| if (clazz == null || clazz.length() == 0) { | if (clazz == null || clazz.length() == 0) { | ||||
| ch = -1; | ch = -1; | ||||
| } else { | } else { | ||||
| final byte[] bytes = clazz.getBytes("ISO-8859-1"); | |||||
| final byte[] bytes = clazz.getBytes(ResourceUtils.ISO_8859_1); | |||||
| try { | try { | ||||
| final Class javaClassHelper = | final Class javaClassHelper = | ||||
| Class.forName(JAVA_CLASS_HELPER); | Class.forName(JAVA_CLASS_HELPER); | ||||
| @@ -37,6 +37,7 @@ import org.apache.tools.ant.types.FilterChain; | |||||
| import org.apache.tools.ant.types.resources.FileResource; | import org.apache.tools.ant.types.resources.FileResource; | ||||
| import org.apache.tools.ant.types.resources.JavaResource; | import org.apache.tools.ant.types.resources.JavaResource; | ||||
| import org.apache.tools.ant.util.FileUtils; | import org.apache.tools.ant.util.FileUtils; | ||||
| import org.apache.tools.ant.util.ResourceUtils; | |||||
| /** | /** | ||||
| * Load a file's contents as Ant properties. | * Load a file's contents as Ant properties. | ||||
| @@ -181,7 +182,7 @@ public class LoadProperties extends Task { | |||||
| if (!text.endsWith("\n")) { | if (!text.endsWith("\n")) { | ||||
| text = text + "\n"; | text = text + "\n"; | ||||
| } | } | ||||
| tis = new ByteArrayInputStream(text.getBytes("ISO8859_1")); | |||||
| tis = new ByteArrayInputStream(text.getBytes(ResourceUtils.ISO_8859_1)); | |||||
| final Properties props = new Properties(); | final Properties props = new Properties(); | ||||
| props.load(tis); | props.load(tis); | ||||
| @@ -140,7 +140,7 @@ public class LayoutPreservingProperties extends Properties { | |||||
| public void load(InputStream inStream) throws IOException { | public void load(InputStream inStream) throws IOException { | ||||
| String s = readLines(inStream); | String s = readLines(inStream); | ||||
| byte[] ba = s.getBytes("ISO-8859-1"); | |||||
| byte[] ba = s.getBytes(ResourceUtils.ISO_8859_1); | |||||
| ByteArrayInputStream bais = new ByteArrayInputStream(ba); | ByteArrayInputStream bais = new ByteArrayInputStream(ba); | ||||
| super.load(bais); | super.load(bais); | ||||
| } | } | ||||
| @@ -251,7 +251,7 @@ public class LayoutPreservingProperties extends Properties { | |||||
| } | } | ||||
| public void store(OutputStream out, String header) throws IOException { | public void store(OutputStream out, String header) throws IOException { | ||||
| OutputStreamWriter osw = new OutputStreamWriter(out, "ISO-8859-1"); | |||||
| OutputStreamWriter osw = new OutputStreamWriter(out, ResourceUtils.ISO_8859_1); | |||||
| int skipLines = 0; | int skipLines = 0; | ||||
| int totalLines = logicalLines.size(); | int totalLines = logicalLines.size(); | ||||
| @@ -309,7 +309,7 @@ public class LayoutPreservingProperties extends Properties { | |||||
| * @param is the stream from which to read the data | * @param is the stream from which to read the data | ||||
| */ | */ | ||||
| private String readLines(InputStream is) throws IOException { | private String readLines(InputStream is) throws IOException { | ||||
| InputStreamReader isr = new InputStreamReader(is, "ISO-8859-1"); | |||||
| InputStreamReader isr = new InputStreamReader(is, ResourceUtils.ISO_8859_1); | |||||
| BufferedReader br = new BufferedReader(isr); | BufferedReader br = new BufferedReader(isr); | ||||
| if (logicalLines.size() > 0) { | if (logicalLines.size() > 0) { | ||||
| @@ -65,6 +65,13 @@ public class ResourceUtils { | |||||
| /** Utilities used for file operations */ | /** Utilities used for file operations */ | ||||
| private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); | private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); | ||||
| /** | |||||
| * Name of charset "ISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1". | |||||
| * | |||||
| * @since Ant 1.8.1 | |||||
| */ | |||||
| public static final String ISO_8859_1 = "ISO-8859-1"; | |||||
| /** | /** | ||||
| * Tells which source files should be reprocessed based on the | * Tells which source files should be reprocessed based on the | ||||
| * last modification date of target files. | * last modification date of target files. | ||||