public class URLClassPath extends Object implements Serializable
| Constructor and Description |
|---|
URLClassPath()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addURL(String fileName)
Add given filename/URL to the classpath.
|
void |
close()
Close all underlying resources.
|
String |
getClassPath()
Return the classpath string.
|
static String |
getFileExtension(String fileName)
Get the file extension of given fileName.
|
static String |
getURLProtocol(String urlString)
Get the URL protocol of given URL string.
|
static boolean |
isArchiveExtension(String fileExtension)
Determine if given file extension indicates an archive file.
|
org.apache.bcel.classfile.JavaClass |
lookupClass(String className)
Look up a class from the classpath.
|
public URLClassPath()
public void addURL(String fileName) throws IOException
fileName - filename or URL of codebase (directory or archive file)IOException - if entry is invalid or does not existpublic String getClassPath()
public org.apache.bcel.classfile.JavaClass lookupClass(String className) throws ClassNotFoundException
className - name of class to look upClassNotFoundException - if the class couldn't be foundpublic void close()
public static String getURLProtocol(String urlString)
urlString - the URL stringpublic static String getFileExtension(String fileName)
public static boolean isArchiveExtension(String fileExtension)
fileExtension - the file extension (e.g., ".jar")Copyright © 2003–2015. All rights reserved.