protected abstract static class ClasspathScannerImpl.AbstractBrowsableClasspathResource extends AbstractBrowsableResource implements ResourcePath
BrowsableResource for ClasspathScannerImpl.ClasspathFile or ClasspathScannerImpl.ClasspathFolder.| Modifier and Type | Field and Description |
|---|---|
private String |
name |
private ClasspathScannerImpl.ClasspathFolder |
parent |
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(ClasspathScannerImpl.ClasspathFolder parent,
String name)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
abstract Iterable<? extends ClasspathScannerImpl.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.
|
ClasspathScannerImpl.ClasspathFolder |
getParent() |
String |
getPath()
This method gets the path of this resource.
|
protected void |
getPath(StringBuilder buffer) |
ClasspathScannerImpl.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, waitisFoldergetSize, getUrl, isAvailable, isData, isModifiedSince, openOutputStream, openStreamprivate final ClasspathScannerImpl.ClasspathFolder parent
getParent()public AbstractBrowsableClasspathResource(ClasspathScannerImpl.ClasspathFolder parent, String name)
parent - - see getParent().name - - see getName().public String getName()
filename.getName in interface DataResourcegetName in interface ResourcePathgetName in class AbstractDataResourcepublic ClasspathScannerImpl.ClasspathFolder getParent()
getParent in interface ResourcePathpublic DataResource navigate(String resourcePath) throws ResourceUriUndefinedException
DataResource 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).navigate in interface DataResourceresourcePath - is 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.public Date getLastModificationDate()
DataResource if available and supported.getLastModificationDate in interface DataResourceDate or null if not available or supported.public String getSchemePrefix()
URIs 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()
DataResource. 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 ClasspathScannerImpl.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()
name 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 ClasspathScannerImpl.AbstractBrowsableClasspathResource> getChildResources()
resources 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–2015 mmm-Team. All rights reserved.