donaldp 02/04/30 00:54:19
Modified: src/main/org/apache/tools/ant/taskdefs/optional/extension
LibraryDisplayer.java ExtensionUtil.java
Log:
Moved getManifest method to ExtensionUtil to make method usable from other
locaitons
Revision Changes Path
1.2 +2 -26
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/LibraryDisplayer.java
Index: LibraryDisplayer.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/LibraryDisplayer.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LibraryDisplayer.java 18 Apr 2002 13:10:49 -0000 1.1
+++ LibraryDisplayer.java 30 Apr 2002 07:54:19 -0000 1.2
@@ -54,9 +54,7 @@
package org.apache.tools.ant.taskdefs.optional.extension;
import java.io.File;
-import java.io.IOException;
import java.text.ParseException;
-import java.util.jar.JarFile;
import java.util.jar.Manifest;
import org.apache.tools.ant.BuildException;
@@ -66,7 +64,7 @@
* and Package Specifications.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
- * @version $Revision: 1.1 $ $Date: 2002/04/18 13:10:49 $
+ * @version $Revision: 1.2 $ $Date: 2002/04/30 07:54:19 $
*/
class LibraryDisplayer
{
@@ -80,7 +78,7 @@
void displayLibrary( final File file )
throws BuildException
{
- final Manifest manifest = getManifest( file );
+ final Manifest manifest = ExtensionUtil.getManifest( file );
displayLibrary( file, manifest );
}
@@ -208,27 +206,5 @@
System.out.println( sb );
}
System.out.println( specification.toString() );
- }
-
- /**
- * retrieve manifest for specified file.
- *
- * @param file the file
- * @return the manifest
- * @throws BuildException if errror occurs (file not exist,
- * file not a jar, manifest not exist in file)
- */
- private Manifest getManifest( final File file )
- throws BuildException
- {
- try
- {
- final JarFile jarFile = new JarFile( file );
- return jarFile.getManifest();
- }
- catch( final IOException ioe )
- {
- throw new BuildException( ioe.getMessage(), ioe );
- }
}
}
1.2 +25 -1
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/ExtensionUtil.java
Index: ExtensionUtil.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/ExtensionUtil.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ExtensionUtil.java 30 Apr 2002 03:45:39 -0000 1.1
+++ ExtensionUtil.java 30 Apr 2002 07:54:19 -0000 1.2
@@ -54,9 +54,11 @@
package org.apache.tools.ant.taskdefs.optional.extension;
import java.io.File;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.jar.JarFile;
+import java.util.jar.Manifest;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Project;
@@ -66,7 +68,7 @@
* A set of useful methods relating to extensions.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
- * @version $Revision: 1.1 $ $Date: 2002/04/30 03:45:39 $
+ * @version $Revision: 1.2 $ $Date: 2002/04/30 07:54:19 $
*/
public class ExtensionUtil
{
@@ -234,5 +236,27 @@
}
extensionList.add( extension );
+ }
+
+ /**
+ * retrieve manifest for specified file.
+ *
+ * @param file the file
+ * @return the manifest
+ * @throws BuildException if errror occurs (file not exist,
+ * file not a jar, manifest not exist in file)
+ */
+ static Manifest getManifest( final File file )
+ throws BuildException
+ {
+ try
+ {
+ final JarFile jarFile = new JarFile( file );
+ return jarFile.getManifest();
+ }
+ catch( final IOException ioe )
+ {
+ throw new BuildException( ioe.getMessage(), ioe );
+ }
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>