@Immutable @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public final class FsEntryName extends EntryName
mount point.
An entry name adds the following syntax constraints to a
Uniform Resource Identifier:
"." and ".." segments.
".".
"..".
"/".
"./"
(this rule is actually redundant - see #3).
"../".
"/".
Examples for valid entry name URIs are:
"foo"
"foo/bar"
uri property |
path property |
query property |
fragment property |
|---|---|---|---|
foo |
foo |
(null) | (null) |
foo/bar |
foo/bar |
(null) | (null) |
foo?bar |
foo |
bar |
(null) |
foo#bar |
foo |
(null) | bar |
Examples for invalid entry name URIs are:
| URI | Issue |
|---|---|
foo:/bar |
not a relative URI |
//foo/bar |
authority component defined |
/foo |
leading slash not allowed |
foo/ |
trailing slash not allowed |
foo/. |
not a normalized URI |
For any entry name e, it's generally true that
new FsEntryName(e.toUri()).equals(e).
This class supports serialization with both
ObjectOutputStream and XMLEncoder.
FsPath,
FsMountPoint,
FsScheme,
FsEntry.getName(),
Serialized Form| Modifier and Type | Field and Description |
|---|---|
private static String |
ILLEGAL_PREFIX |
static FsEntryName |
ROOT
The file system entry name of the root directory,
which is an empty URI.
|
private static long |
serialVersionUID |
SEPARATOR, SEPARATOR_CHAR| Constructor and Description |
|---|
FsEntryName(FsEntryName parent,
FsEntryName member)
Constructs a new file system entry name by resolving the given member
file system entry name against the given parent file system entry name.
|
FsEntryName(URI uri)
Equivalent to
new FsEntryName(uri, FsUriModifier.NULL). |
FsEntryName(URI uri,
FsUriModifier modifier)
Constructs a new file system entry name by parsing the given URI.
|
| Modifier and Type | Method and Description |
|---|---|
static FsEntryName |
create(URI uri)
Equivalent to
create(uri, FsUriModifier.NULL). |
static FsEntryName |
create(URI uri,
FsUriModifier modifier)
Constructs a new file system entry name by parsing the given URI.
|
private boolean |
invariants() |
boolean |
isRoot()
Returns
true if and only if the path component of this file
system entry name is empty and no query component is defined. |
private void |
parse(URI uri) |
private void |
readObject(ObjectInputStream in) |
private static final String ILLEGAL_PREFIX
public static final FsEntryName ROOT
private static final long serialVersionUID
public FsEntryName(FsEntryName parent, FsEntryName member)
"foo" and "bar" as the URIs for the parent and member
file system entry names results in "foo/bar" as the file system
entry name URI.parent - an entry name for the parent.member - an entry name for the member.public FsEntryName(URI uri) throws URISyntaxException
new FsEntryName(uri, FsUriModifier.NULL).URISyntaxExceptionpublic FsEntryName(URI uri, FsUriModifier modifier) throws URISyntaxException
uri - the URI.modifier - the URI modifier.NullPointerException - if uri is null.URISyntaxException - if uri does not conform to the
syntax constraints for file system entry names.public static FsEntryName create(URI uri)
create(uri, FsUriModifier.NULL).public static FsEntryName create(URI uri, FsUriModifier modifier)
new FsEntryName(uri, modifier)
and wraps any thrown URISyntaxException in an
IllegalArgumentException.uri - the URI.modifier - the URI modifier.IllegalArgumentException - if uri does not conform to the
syntax constraints for entry names.private boolean invariants()
public boolean isRoot()
true if and only if the path component of this file
system entry name is empty and no query component is defined.true if and only if the path component of this file
system entry name is empty and no query component is defined.private void parse(URI uri) throws URISyntaxException
URISyntaxExceptionprivate void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionCopyright © 2004-2011 Schlichtherle IT Services. All Rights Reserved.