Class LoadedJarLibrary
java.lang.Object
i5.las2peer.classLoaders.libraries.LoadedLibrary
i5.las2peer.classLoaders.libraries.LoadedJarLibrary
a loaded jar library implements a library on the basis of a standard jar file
-
Constructor Summary
ConstructorDescriptionLoadedJarLibrary
(String filename, LibraryIdentifier ident) create a new LodadJarLibrary -
Method Summary
Modifier and TypeMethodDescriptionstatic LoadedJarLibrary
createFromJar
(String filename) factory: create a LoadedJarLibrary from a JAR file and the information contained in its manifestString[]
Returns all classes stored in the corresponding jar file.Gets a list with all file names from files contained in the given jar package file.String[]
returns an array with names of resources (other than classes) contained in the jar archive of this ClassLoaderReturns the name of the corresponding jar file.getResourceAsUrl
(String name) for class and resource loading: get the URL for the specified resourceMethods inherited from class i5.las2peer.classLoaders.libraries.LoadedLibrary
classToResourceName, getIdentifier, getLibraryIdentifier, getResourceAsBinary, getResourceAsString, resourceToClassName
-
Constructor Details
-
LoadedJarLibrary
create a new LodadJarLibrary- Parameters:
filename
- A jar file nameident
- A library identifier- Throws:
IOException
- If the given jar filename could not be used
-
-
Method Details
-
getResourceAsUrl
Description copied from class:LoadedLibrary
for class and resource loading: get the URL for the specified resource- Specified by:
getResourceAsUrl
in classLoadedLibrary
- Parameters:
name
- A resource name- Returns:
- a URL for the requested resource
- Throws:
ResourceNotFoundException
- the given resource does not exists in this library
-
getContainedClasses
Returns all classes stored in the corresponding jar file.- Returns:
- a String[] array with the class names (in . - notation )
-
getContainedResources
returns an array with names of resources (other than classes) contained in the jar archive of this ClassLoader- Returns:
- a String[]
-
getContainedFiles
Gets a list with all file names from files contained in the given jar package file.- Returns:
- Returns a list of filenames.
-
getJarFileName
Returns the name of the corresponding jar file.- Returns:
- a String
-
createFromJar
public static LoadedJarLibrary createFromJar(String filename) throws IllegalArgumentException, IOException factory: create a LoadedJarLibrary from a JAR file and the information contained in its manifest- Parameters:
filename
- filename of the jar file- Returns:
- a loaded jar library representing the given file
- Throws:
IOException
- If the given jar filename could not be usedIllegalArgumentException
- If the library identifier could not be created
-