You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ad...@apache.org on 2003/12/12 02:31:56 UTC
cvs commit: incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/deployment/scanner URLType.java
adc 2003/12/11 17:31:55
Modified: modules/kernel/src/java/org/apache/geronimo/kernel/deployment/scanner
URLType.java
Log:
Typo in class variable and javadoc added
Jacek Laskowski
Revision Changes Path
1.2 +20 -5 incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/deployment/scanner/URLType.java
Index: URLType.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/deployment/scanner/URLType.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- URLType.java 8 Sep 2003 04:38:33 -0000 1.1
+++ URLType.java 12 Dec 2003 01:31:55 -0000 1.2
@@ -65,12 +65,20 @@
import java.util.zip.ZipException;
/**
- *
+ * The URLType class assigns type to resources, i.e. files or URLs.
+ * <p>
+ * The following types are available:
+ * <ul>
+ * <li><b>UNPACKED_ARCHIVE</b> - directory with META-INF/MANIFEST.MF
+ * <li><b>PACKED_ARCHIVE</b> - file with META-INF/MANIFEST.MF
+ * <li><b>COLLECTION</b> - directory with no META-INF/MANIFEST.MF
+ * <li><b>RESOURCE</b> - none of the above
+ * </ul>
*
* @version $Revision$ $Date$
*/
public class URLType {
- public static final String MANIFEST_LOCATON = "META-INF/MANIFEST.MF";
+ public static final String MANIFEST_LOCATION = "META-INF/MANIFEST.MF";
public static final URLType RESOURCE = new URLType("RESOURCE");
public static final URLType COLLECTION = new URLType("COLLECTION");
@@ -81,7 +89,7 @@
if (file.isDirectory()) {
// file is a directory - see if it has a manifest
// we check for an actual manifest file to keep things consistent with a packed archive
- if (new File(file, MANIFEST_LOCATON).exists()) {
+ if (new File(file, MANIFEST_LOCATION).exists()) {
return UNPACKED_ARCHIVE;
} else {
return COLLECTION;
@@ -99,9 +107,16 @@
}
}
+ /**
+ * Returns the type of url
+ *
+ * @param url
+ * @return type of the url
+ * @throws IOException whenever there're problems with accessing portion of the url
+ */
public static URLType getType(URL url) throws IOException {
if (url.toString().endsWith("/")) {
- URL metaInfURL = new URL(url, MANIFEST_LOCATON);
+ URL metaInfURL = new URL(url, MANIFEST_LOCATION);
URLConnection urlConnection = metaInfURL.openConnection();
urlConnection.connect();
try {