@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(String uri)
Deprecated.
This constructor does not quote characters with a special
meaning in a URI - use the constructor variant with the URI
parameter instead.
|
FsEntryName(String uri,
FsUriModifier modifier)
Deprecated.
This constructor does not quote characters with a special
meaning in a URI - use the constructor variant with the URI
parameter instead.
|
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(String uri)
Deprecated.
This method does not quote characters with a special meaning
in a URI - use the method variant with the URI parameter
instead.
|
static FsEntryName |
create(String uri,
FsUriModifier modifier)
Deprecated.
This method does not quote characters with a special meaning
in a URI - use the method variant with the URI parameter
instead.
|
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() |
private void |
parse(URI uri) |
private static String |
quote(Object s) |
private void |
readObject(ObjectInputStream in) |
private static final long serialVersionUID
private static final String ILLEGAL_PREFIX
public static final FsEntryName ROOT
@Deprecated public FsEntryName(String uri) throws URISyntaxException
new FsEntryName(uri, FsUriModifier.NULL).URISyntaxException@Deprecated public FsEntryName(String uri, FsUriModifier modifier) throws URISyntaxException
new URI(uri) and parsing the resulting URI.uri - the URI string representation.modifier - the URI modifier.URISyntaxException - if uri does not conform to the
syntax constraints for entry names.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 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.@Deprecated public static FsEntryName create(String uri)
create(uri, FsUriModifier.NULL).@Deprecated public static FsEntryName create(String uri, FsUriModifier modifier)
new FsEntryName(uri, modifier)
and wraps any thrown URISyntaxException in an
IllegalArgumentException.uri - the URI string representation.modifier - the URI modifier.IllegalArgumentException - if uri does not conform to the
syntax constraints for 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 void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionprivate void parse(URI uri) throws URISyntaxException
URISyntaxExceptionprivate boolean invariants()
public boolean isRoot()
Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.