Author: stevel
Date: Mon Apr 23 14:13:52 2007
New Revision: 531603

URL: http://svn.apache.org/viewvc?view=rev&rev=531603
Log:
make the name of application.xml a constant, use locale-sensitive case 
conversion

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Ear.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Ear.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Ear.java?view=diff&rev=531603&r1=531602&r2=531603
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Ear.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Ear.java Mon Apr 23 
14:13:52 2007
@@ -19,6 +19,8 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.util.Locale;
+
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.types.ZipFileSet;
@@ -37,6 +39,7 @@
 
     private File deploymentDescriptor;
     private boolean descriptorAdded;
+    private static final String XML_DESCRIPTOR_PATH = 
"META-INF/application.xml";
 
     /**
      * Create an Ear task.
@@ -72,7 +75,7 @@
         // Create a ZipFileSet for this file, and pass it up.
         ZipFileSet fs = new ZipFileSet();
         fs.setFile(deploymentDescriptor);
-        fs.setFullpath("META-INF/application.xml");
+        fs.setFullpath(XML_DESCRIPTOR_PATH);
         super.addFileset(fs);
     }
 
@@ -122,14 +125,16 @@
         // attribute - or if it's being added twice, meaning the same
         // file is specified by the "appxml" attribute and in a
         // <fileset> element.
-        if (vPath.equalsIgnoreCase("META-INF/application.xml"))  {
-            if (deploymentDescriptor == null
+        String vPathLowerCase = vPath.toLowerCase(Locale.ENGLISH);
+        if (XML_DESCRIPTOR_PATH.equals(vPathLowerCase))  {
+            if (deploymentDescriptor != null
                 || !FILE_UTILS.fileNameEquals(deploymentDescriptor, file)
                 || descriptorAdded) {
                 log("Warning: selected " + archiveType
-                    + " files include a META-INF/application.xml which will"
+                    + " files include a "+ XML_DESCRIPTOR_PATH +" which will"
                     + " be ignored (please use appxml attribute to "
-                    + archiveType + " task)", Project.MSG_WARN);
+                    + archiveType + " task)",
+                        Project.MSG_WARN);
             } else {
                 super.zipFile(file, zOut, vPath, mode);
                 descriptorAdded = true;



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to