Package io.github.connellite.jcl
Class JarResources
- java.lang.Object
-
- io.github.connellite.jcl.JarResources
-
- Direct Known Subclasses:
ClasspathResources
public class JarResources extends Object
JarResources reads jar files and loads the class content/bytes in a HashMap- Author:
- Kamran Zafar
-
-
Field Summary
Fields Modifier and Type Field Description protected booleancollisionAllowedprotected Map<String,JclJarEntry>jarEntryContents
-
Constructor Summary
Constructors Constructor Description JarResources()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getResource(String name)Map<String,byte[]>getResources()Returns an immutable Map of all jar resourcesURLgetResourceURL(String name)voidloadJar(String jarFile)Reads the specified jar filevoidloadJar(String argBaseUrl, InputStream jarStream)voidloadJar(String argBaseUrl, InputStream jarStream, boolean closeStream)Load the jar contents from InputStreamvoidloadJar(URL url)Reads the jar file from a specified URL
-
-
-
Field Detail
-
jarEntryContents
protected Map<String,JclJarEntry> jarEntryContents
-
collisionAllowed
protected boolean collisionAllowed
-
-
Method Detail
-
getResource
public byte[] getResource(String name)
- Parameters:
name-- Returns:
- byte[]
-
getResources
public Map<String,byte[]> getResources()
Returns an immutable Map of all jar resources- Returns:
- Map
-
loadJar
public void loadJar(String jarFile)
Reads the specified jar file- Parameters:
jarFile-
-
loadJar
public void loadJar(URL url)
Reads the jar file from a specified URL- Parameters:
url-
-
loadJar
public void loadJar(String argBaseUrl, InputStream jarStream)
-
loadJar
public void loadJar(String argBaseUrl, InputStream jarStream, boolean closeStream)
Load the jar contents from InputStream- Parameters:
argBaseUrl-
-
-