protected static class ClasspathScannerImpl.ClasspathFile extends ClasspathScannerImpl.AbstractBrowsableClasspathResource
ClasspathResource but browsable.| Modifier and Type | Field and Description |
|---|---|
private URL |
url |
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 |
|---|
ClasspathFile(ClasspathScannerImpl.ClasspathFolder parent,
String name)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Iterable<? extends ClasspathScannerImpl.AbstractBrowsableClasspathResource> |
getChildResources()
This method iterates the immediate child-
resources contained in this
BrowsableResource. |
URL |
getUrl()
This method gets this resource as
URL. |
boolean |
isData()
This method determines if this resource has potentially data
available. |
boolean |
isFolder()
This method determines if this
BrowsableResource is a folder that potentially contains
other resources. |
getLastModificationDate, getName, getParent, getPath, getPath, getRoot, getSchemePrefix, getUri, init, isAbsolute, isRoot, navigategetChildResourcesequals, getSize, hashCode, isAvailable, isModifiedSince, openOutputStream, openStream, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetSize, isAvailable, isModifiedSince, openOutputStream, openStreampublic ClasspathFile(ClasspathScannerImpl.ClasspathFolder parent, String name)
parent - - see ClasspathScannerImpl.AbstractBrowsableClasspathResource.getParent().name - - see ClasspathScannerImpl.AbstractBrowsableClasspathResource.getName().public Iterable<? extends ClasspathScannerImpl.AbstractBrowsableClasspathResource> getChildResources()
resources contained in this
BrowsableResource. folder, this method will always return an empty Iterable.getChildResources in interface BrowsableResourcegetChildResources in class ClasspathScannerImpl.AbstractBrowsableClasspathResourceIterable of the child-resources.public boolean isFolder()
BrowsableResource is a folder that potentially contains
other resources. Otherwise if this is no folder, BrowsableResource.getChildResources()
will be empty (return an empty Iterable). However BrowsableResource.getChildResources() can also be empty,
if this is a folder. BrowsableResource is containing data, please
use DataResource.isAvailable(). Please note that BrowsableResource.isFolder() and DataResource.isAvailable() can both
return true or both return false.true if this is a folder, false otherwise.public boolean isData()
available. Unlike
DataResource.isAvailable() this method will not invoke expensive operations like connecting to remote URLs.
If this method will return false, then DataResource.isAvailable() would also have returned
false. However in case of true only DataResource.isAvailable() can guarantee if a
resource really exists and contains data. E.g. if the resource points to a File then this
method can check if it is a data-file. So in case it points to a directory
or does not exist at all in the filesystem, this method will return false. Please also note
that this may invoke expensive operations if the according directory path points to something like a
network share. You should also be aware that the state of DataResource.isData() and DataResource.isAvailable()
can change at any time so you never have a full guarantee if some data exists or NOT. However in most
cases it is very improbable that this status changes when you read the resource
immediately after the check.true if this resource points to potential data, false otherwise.public URL getUrl() throws ResourceNotAvailableException
URL.ResourceNotAvailableException - if an URL can NOT be created because the represented resource does
not exist.Copyright © 2001–2015 mmm-Team. All rights reserved.