public static class ClassLoaderFileSystem.ClassLoaderResourceId extends java.lang.Object implements ResourceId
| Modifier and Type | Method and Description |
|---|---|
ClassLoaderFileSystem.ClassLoaderResourceId |
getCurrentDirectory()
Returns the
ResourceId that represents the current directory of this ResourceId. |
@Nullable java.lang.String |
getFilename()
Returns the name of the file or directory denoted by this
ResourceId. |
java.lang.String |
getScheme()
Get the scheme which defines the namespace of the
ResourceId. |
boolean |
isDirectory()
Returns
true if this ResourceId represents a directory, false otherwise. |
ClassLoaderFileSystem.ClassLoaderResourceId |
resolve(java.lang.String other,
ResolveOptions resolveOptions)
Returns a child
ResourceId under this. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittoStringpublic ClassLoaderFileSystem.ClassLoaderResourceId resolve(java.lang.String other, ResolveOptions resolveOptions)
ResourceIdResourceId under this.
In order to write file system agnostic code, callers should not include delimiters in other, and should use ResolveOptions.StandardResolveOptions to specify whether to resolve a file or a
directory.
For example:
ResourceId homeDir = ...;
ResourceId tempOutput = homeDir
.resolve("tempDir", StandardResolveOptions.RESOLVE_DIRECTORY)
.resolve("output", StandardResolveOptions.RESOLVE_FILE);
This ResourceId should represents a directory.
It is up to each file system to resolve in their own way.
Resolving special characters:
resourceId.resolve("..", StandardResolveOptions.RESOLVE_DIRECTORY) returns the
parent directory of this ResourceId.
resourceId.resolve("*", StandardResolveOptions.RESOLVE_FILE) returns a ResourceId which matches all files in this ResourceId.
resourceId.resolve("*", StandardResolveOptions.RESOLVE_DIRECTORY) returns a
ResourceId which matches all directories in this ResourceId.
resolve in interface ResourceIdpublic ClassLoaderFileSystem.ClassLoaderResourceId getCurrentDirectory()
ResourceIdResourceId that represents the current directory of this ResourceId.
If it is already a directory, trivially returns this.
getCurrentDirectory in interface ResourceIdpublic java.lang.String getScheme()
ResourceIdResourceId.
The scheme is required to follow URI scheme syntax. See RFC 2396
getScheme in interface ResourceIdpublic @Nullable java.lang.String getFilename()
ResourceIdResourceId. The file name is
the farthest element from the root in the directory hierarchy.getFilename in interface ResourceIdpublic boolean isDirectory()
ResourceIdtrue if this ResourceId represents a directory, false otherwise.isDirectory in interface ResourceId