geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r428835 - in /geronimo/sandbox/svkmerge/m2migration/modules/deploy-jsr88/src: ./ java/org/apache/geronimo/deployment/plugin/ConfigIDExtractor.java
Date Fri, 04 Aug 2006 18:35:49 GMT
Author: jdillon
Date: Fri Aug  4 11:35:49 2006
New Revision: 428835

URL: http://svn.apache.org/viewvc?rev=428835&view=rev
Log:
 r627@jason-dillons-computer (orig r427996):  jdillon | 2006-08-02 07:14:45 -0700
  r612@dyn456093 (orig r427669):  ammulder | 2006-08-01 11:16:31 -0700
  Merge fix for GERONIMO-2228 (and plumbing for GERONIMO-1869) to trunk.
  
 

Modified:
    geronimo/sandbox/svkmerge/m2migration/modules/deploy-jsr88/src/   (props changed)
    geronimo/sandbox/svkmerge/m2migration/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/ConfigIDExtractor.java

Propchange: geronimo/sandbox/svkmerge/m2migration/modules/deploy-jsr88/src/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Fri Aug  4 11:35:49 2006
@@ -1 +1 @@
-13f79535-47bb-0310-9956-ffa450edef68:/geronimo/sandbox/svkmerge/trunk/modules/deploy-jsr88/src:426510
+13f79535-47bb-0310-9956-ffa450edef68:/geronimo/sandbox/svkmerge/trunk/modules/deploy-jsr88/src:427996

Modified: geronimo/sandbox/svkmerge/m2migration/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/ConfigIDExtractor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/m2migration/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/ConfigIDExtractor.java?rev=428835&r1=428834&r2=428835&view=diff
==============================================================================
--- geronimo/sandbox/svkmerge/m2migration/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/ConfigIDExtractor.java
(original)
+++ geronimo/sandbox/svkmerge/m2migration/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/ConfigIDExtractor.java
Fri Aug  4 11:35:49 2006
@@ -36,6 +36,7 @@
 import javax.xml.parsers.ParserConfigurationException;
 import javax.enterprise.deploy.spi.TargetModuleID;
 import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.common.FileUtils;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Version;
 import org.xml.sax.InputSource;
@@ -231,24 +232,14 @@
 
     /**
      * Try to determine whether a file is a JAR File (or, at least, a ZIP file).
+     *
+     * @deprecated See org.apache.geronimo.common.FileUtils.isJarFile
      */
     public static boolean isJarFile(File file) throws DeploymentException {
-        if(file.isDirectory()) {
-            return false;
-        }
-        if(!file.canRead()) {
-            throw new DeploymentException("Cannot read file "+file.getAbsolutePath());
-        }
-        if(file.length() < 4) {
-            return false;
-        }
         try {
-            DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(file)));
-            int test = in.readInt();
-            in.close();
-            return test == 0x504b0304;
-        } catch(IOException e) {
-            throw new DeploymentException("Cannot read from file "+file.getAbsolutePath(),
e);
+            return FileUtils.isZipFile(file);
+        } catch (IOException e) {
+            throw new DeploymentException("Unable to read file "+file.getAbsolutePath());
         }
     }
 



Mime
View raw message