geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r887816 - /geronimo/server/trunk/framework/modules/geronimo-common/src/main/java/org/apache/geronimo/common/FileUtils.java
Date Mon, 07 Dec 2009 01:43:30 GMT
Author: gawor
Date: Mon Dec  7 01:43:28 2009
New Revision: 887816

URL: http://svn.apache.org/viewvc?rev=887816&view=rev
Log:
some jars don't have manifest file

Modified:
    geronimo/server/trunk/framework/modules/geronimo-common/src/main/java/org/apache/geronimo/common/FileUtils.java

Modified: geronimo/server/trunk/framework/modules/geronimo-common/src/main/java/org/apache/geronimo/common/FileUtils.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-common/src/main/java/org/apache/geronimo/common/FileUtils.java?rev=887816&r1=887815&r2=887816&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-common/src/main/java/org/apache/geronimo/common/FileUtils.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-common/src/main/java/org/apache/geronimo/common/FileUtils.java
Mon Dec  7 01:43:28 2009
@@ -29,17 +29,16 @@
  * @version $Rev$ $Date$
  */
 public class FileUtils {
+    
     /**
-     * Determine whether a file is a JAR File.
+     * Determine whether a file is a JAR File. 
+     * 
+     * Note: Jar file is a zip file with an *optional* META-INF directory.
+     * Therefore, there is no reliable way to check if a file is a Jar file.  
+     * So this functions returns the same as calling isZipFile(File).
      */
     public static boolean isJarFile(File file) throws IOException {
-        if(!isZipFile(file)) {
-            return false;
-        }
-        ZipFile zip = new ZipFile(file);
-        boolean manifest = zip.getEntry("META-INF/MANIFEST.MF") != null;
-        zip.close();
-        return manifest;
+        return isZipFile(file);
     }
 
     /**



Mime
View raw message