Class JarResourceLoader
- java.lang.Object
-
- org.codehaus.plexus.resource.loader.AbstractResourceLoader
-
- org.codehaus.plexus.resource.loader.JarResourceLoader
-
- All Implemented Interfaces:
ResourceLoader
@Named("jar") public class JarResourceLoader extends AbstractResourceLoader
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.String>entryDirectoryMaps entries to the parent JAR File (key = the entry *excluding* plain directories, value = the JAR URL).static java.lang.StringIDprivate java.util.Map<java.lang.String,JarHolder>jarFilesMaps JAR URLs to the actual JAR (key = the JAR URL, value = the JAR).private static org.slf4j.LoggerLOGGER-
Fields inherited from class org.codehaus.plexus.resource.loader.AbstractResourceLoader
paths
-
-
Constructor Summary
Constructors Constructor Description JarResourceLoader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddEntries(java.util.Map<java.lang.String,java.lang.String> entries)Copy all the entries into the entryDirectory.voidaddSearchPath(java.lang.String path)private voidcloseJar(java.lang.String path)Closes a Jar file and set its URLConnection to null.PlexusResourcegetResource(java.lang.String source)Get anPlexusResourceby name.private voidloadJar(java.lang.String path)-
Methods inherited from class org.codehaus.plexus.resource.loader.AbstractResourceLoader
getResourceAsInputStream
-
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
ID
public static final java.lang.String ID
- See Also:
- Constant Field Values
-
entryDirectory
private final java.util.Map<java.lang.String,java.lang.String> entryDirectory
Maps entries to the parent JAR File (key = the entry *excluding* plain directories, value = the JAR URL).
-
jarFiles
private final java.util.Map<java.lang.String,JarHolder> jarFiles
Maps JAR URLs to the actual JAR (key = the JAR URL, value = the JAR).
-
-
Method Detail
-
loadJar
private void loadJar(java.lang.String path)
-
closeJar
private void closeJar(java.lang.String path)
Closes a Jar file and set its URLConnection to null.
-
addEntries
private void addEntries(java.util.Map<java.lang.String,java.lang.String> entries)
Copy all the entries into the entryDirectory. It will overwrite any duplicate keys.
-
getResource
public PlexusResource getResource(java.lang.String source) throws ResourceNotFoundException
Get anPlexusResourceby name.- Parameters:
source- name of resource to get- Returns:
- PlexusResource containing the resource
- Throws:
ResourceNotFoundException- if resource not found.
-
addSearchPath
public void addSearchPath(java.lang.String path)
- Specified by:
addSearchPathin interfaceResourceLoader- Overrides:
addSearchPathin classAbstractResourceLoader
-
-