abstract class AbstractBrowsableClasspathResource extends AbstractBrowsableResource implements ResourcePath
| Modifier and Type | Field and Description |
|---|---|
private static String |
EXTENSION_CLASS |
(package private) String |
name |
private ClasspathFolder |
parent |
private String |
qualifiedName |
HOME_PATH_CHAR, PATH_SEGMENT_CURRENT_DIRECTORY, PATH_SEGMENT_PARENT_DIRECTORY, PATH_SEGMENT_SEPARATOR, PATH_SEGMENT_SEPARATOR_CHAR, UNC_PATH_PREFIX, URL_SCHEME_AUTHORITY_SEPARATOR| Constructor and Description |
|---|
AbstractBrowsableClasspathResource(ClasspathFolder parent,
String name)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
abstract Iterable<? extends AbstractBrowsableClasspathResource> |
getChildResources()
This method iterates the immediate child-
resources contained in this
BrowsableResource. |
Date |
getLastModificationDate()
This method gets the last modification date of the
DataResource if available and
supported. |
String |
getName()
This method gets the name of the resource.
|
ClasspathFolder |
getParent() |
String |
getPath()
This method gets the path of this resource.
|
protected void |
getPath(StringBuilder buffer) |
(package private) String |
getQualifiedName() |
ClasspathFolder |
getRoot() |
String |
getSchemePrefix()
This method gets the scheme-prefix of absolute
URIs for this type of
DataResource. |
String |
getUri()
This method gets a string identifying this
DataResource. |
protected void |
init()
Initializes this resource after it has been properly initialzed.
|
boolean |
isAbsolute() |
boolean |
isRoot() |
DataResource |
navigate(String resourcePath)
This method retrieves a
DataResource pointing to the given resourcePath based on this resource.E.g. |
getChildResourcesequals, getSize, hashCode, isAvailable, isModifiedSince, openOutputStream, openStream, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitcd, isFoldergetSize, getUrl, isAvailable, isData, isModifiedSince, openOutputStream, openStreamprivate static final String EXTENSION_CLASS
private final ClasspathFolder parent
final String name
private final String qualifiedName
AbstractBrowsableClasspathResource(ClasspathFolder parent, String name)
parent - - see getParent().name - - see getName().public String getName()
DataResourcefilename.getName in interface DataResourcegetName in interface ResourcePathgetName in class AbstractDataResourceString getQualifiedName()
package name or class name).
Will be null for a ClasspathFile that does not point to a Class file (*.class).public ClasspathFolder getParent()
getParent in interface ResourcePathpublic DataResource navigate(String resourcePath) throws ResourceUriUndefinedException
DataResourceDataResource pointing to the given resourcePath based on this resource.resourcePath would be "../apt/sources.list"
the resulting resource would point to "/etc/apt/sources.list". folder of this resource. This will also be the case if this resource itself is
a folder. Due to this generic API this is the only consistent way as there are
implementations that can not easily know if they represent a folder or a
file or maybe even both at the same time. However, please be aware of this and
do not get confused as you might expect this to be a cd command if invoked on
a folder what is not exactly not the case (instead it is a
cd on the parent folder). On a BrowsableResource you can use
BrowsableResource.cd(String) instead to avoid confusion.navigate in interface DataResourceresourcePath - the absolute or relative path pointing to a new resource. If it is a relative path, it is
interpreted relative to the parent URI (directory) of this resource.ResourceUriUndefinedException - if the given resourcePath leads to an undefined or illegal URI.BrowsableResource.cd(String)public Date getLastModificationDate()
DataResourceDataResource if available and
supported.getLastModificationDate in interface DataResourceDate or null if not available or supported.public String getSchemePrefix()
AbstractDataResourceURIs for this type of
DataResource. The scheme-prefix has the following form: <scheme>
:<suffix> where <suffix> is the empty string or something like //.getSchemePrefix in class AbstractDataResourcepublic String getUri()
DataResourceDataResource. In most cases this will be the same as
string-representation of the URL. However this method will not throw an
exception.getUri in interface DataResourcegetUri in class AbstractDataResourcepublic ClasspathFolder getRoot()
getRoot in interface ResourcePathroot ancestor of this ResourcePathNode.public boolean isAbsolute()
isAbsolute in interface ResourcePathtrue if this path is absolute, false if it is relative.public boolean isRoot()
isRoot in interface ResourcePathtrue if this is the root ResourcePathNode, false otherwise.public String getPath()
DataResourcename of
the resource. getPath in interface DataResourcegetPath in class AbstractDataResourceprotected void getPath(StringBuilder buffer)
buffer - is the StringBuilder where to append the string representation to.public abstract Iterable<? extends AbstractBrowsableClasspathResource> getChildResources()
BrowsableResourceresources contained in this
BrowsableResource. folder, this method will always return an empty Iterable.getChildResources in interface BrowsableResourceIterable of the child-resources.protected void init()
Copyright © 2001–2016 mmm-Team. All rights reserved.