|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsk.baka.webvm.analyzer.classloader.ResourceLink
public abstract class ResourceLink
Represents an on-disk package or a package item.
| Constructor Summary | |
|---|---|
ResourceLink()
|
|
| Method Summary | |
|---|---|
protected void |
assertNotPackage()
Asserts that this is not a package. |
protected void |
assertPackage()
Asserts that this is a package. |
static ResourceLink |
findFirstByName(List<ResourceLink> links,
String name)
Finds first link with given name. |
abstract File |
getContainer()
Returns a file link to the resource container containing these links. |
abstract String |
getFullName()
Returns a full name, including parent packages and full path to the root. |
abstract long |
getLength()
Returns length of underlying resource. |
abstract String |
getName()
Returns the package/resource name. |
static List<String> |
getNames(List<ResourceLink> links)
Returns a list of names from given list of links |
abstract boolean |
isPackage()
Checks if resource denoted by this object is actually a package, or just a resource file. |
abstract boolean |
isRoot()
Checks if this resource link denotes a root of a jar/directory. |
abstract List<ResourceLink> |
list()
Lists all direct child packages and items of this package. |
List<ResourceLink> |
listAndGroup()
Lists all direct child packages and items of this package. |
static ResourceLink |
newFor(File file)
Opens given directory or jar file and allows package and resource enumeration. |
abstract InputStream |
open()
Opens a stream to the file denoted by this link. |
abstract List<ResourceLink> |
search(String substring)
Performs a search for given substring. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ResourceLink()
| Method Detail |
|---|
public static ResourceLink newFor(File file)
file - the resource directory or a jar file
public static List<String> getNames(List<ResourceLink> links)
links - not null
public static ResourceLink findFirstByName(List<ResourceLink> links,
String name)
links - a list of links, must not be nullname - the name of the resource.
IllegalArgumentException - if no such link exists
public abstract List<ResourceLink> search(String substring)
throws IOException
substring - a string to search, must not be null.
IOException - on i/o error
public abstract long getLength()
throws IOException
IOException - on i/o error
public final List<ResourceLink> listAndGroup()
throws IOException
IOException - on i/o error
public abstract List<ResourceLink> list()
throws IOException
IOException - on i/o errorpublic abstract boolean isPackage()
Root link is always a package.
public abstract InputStream open()
throws IOException
IOException - on i/o errorpublic abstract String getName()
public abstract String getFullName()
public abstract boolean isRoot()
public abstract File getContainer()
root links.
public String toString()
toString in class Objectprotected void assertPackage()
protected void assertNotPackage()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||