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. |
getChildResources
equals, getSize, hashCode, isAvailable, isModifiedSince, openOutputStream, openStream, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
cd, isFolder
getSize, getUrl, isAvailable, isData, isModifiedSince, openOutputStream, openStream
private 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()
DataResource
filename
.getName
in interface DataResource
getName
in interface ResourcePath
getName
in class AbstractDataResource
String 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 ResourcePath
public DataResource navigate(String resourcePath) throws ResourceUriUndefinedException
DataResource
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). On a BrowsableResource
you can use
BrowsableResource.cd(String)
instead to avoid confusion.navigate
in interface DataResource
resourcePath
- 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()
DataResource
DataResource
if available
and
supported.getLastModificationDate
in interface DataResource
Date
or null
if not available or supported.public String getSchemePrefix()
AbstractDataResource
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 AbstractDataResource
public String getUri()
DataResource
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 DataResource
getUri
in class AbstractDataResource
public ClasspathFolder getRoot()
getRoot
in interface ResourcePath
root
ancestor
of this ResourcePathNode
.public boolean isAbsolute()
isAbsolute
in interface ResourcePath
true
if this path is absolute, false
if it is relative.public boolean isRoot()
isRoot
in interface ResourcePath
true
if this is the root ResourcePathNode
, false
otherwise.public String getPath()
DataResource
name
of
the resource. getPath
in interface DataResource
getPath
in class AbstractDataResource
protected void getPath(StringBuilder buffer)
buffer
- is the StringBuilder
where to append the string representation to.public abstract Iterable<? extends AbstractBrowsableClasspathResource> getChildResources()
BrowsableResource
resources
contained in this
BrowsableResource
. folder
, this method will always return an empty Iterable
.getChildResources
in interface BrowsableResource
Iterable
of the child-resources
.protected void init()
Copyright © 2001–2016 mmm-Team. All rights reserved.