Return-Path: Delivered-To: apmail-incubator-geronimo-cvs-archive@www.apache.org Received: (qmail 80320 invoked from network); 12 Dec 2003 01:31:57 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 12 Dec 2003 01:31:57 -0000 Received: (qmail 26417 invoked by uid 500); 12 Dec 2003 01:31:41 -0000 Delivered-To: apmail-incubator-geronimo-cvs-archive@incubator.apache.org Received: (qmail 26178 invoked by uid 500); 12 Dec 2003 01:31:40 -0000 Mailing-List: contact geronimo-cvs-help@incubator.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: geronimo-dev@incubator.apache.org Delivered-To: mailing list geronimo-cvs@incubator.apache.org Received: (qmail 26165 invoked from network); 12 Dec 2003 01:31:40 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 12 Dec 2003 01:31:40 -0000 Received: (qmail 80308 invoked by uid 1751); 12 Dec 2003 01:31:56 -0000 Date: 12 Dec 2003 01:31:56 -0000 Message-ID: <20031212013156.80307.qmail@minotaur.apache.org> From: adc@apache.org To: incubator-geronimo-cvs@apache.org Subject: cvs commit: incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/deployment/scanner URLType.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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. + *

+ * The following types are available: + *

    + *
  • UNPACKED_ARCHIVE - directory with META-INF/MANIFEST.MF + *
  • PACKED_ARCHIVE - file with META-INF/MANIFEST.MF + *
  • COLLECTION - directory with no META-INF/MANIFEST.MF + *
  • RESOURCE - none of the above + *
* * @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 {