|
TrueZIP Kernel 7.0-rc1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.schlichtherle.truezip.fs.FsMountPoint
@Immutable public final class FsMountPoint
Addresses the mount point of a file system.
A mount point is usually constructed from a
Uniform Resource Identifier in order to assert the following
additional syntax constraints:
FsPath and the
following additional syntax constraints:
The path must be absolute.
If its opaque, it's entry name must not be empty.
Examples for valid mount point URIs are:
foo:/bar/
foo:bar:/baz!/
foo:bar:baz:/bang!/boom!/
/foo (not absolute)
foo (dito)
foo:/bar/#baz (fragment)
foo:bar:/baz!/bang (doesn't end with mount point separator)
foo:bar:baz:/bang!/!/ (empty entry name in bar:baz:/bang!/)
This class supports serialization with both
ObjectOutputStream and XMLEncoder.
FsPath,
Serialized Form| Field Summary | |
|---|---|
private FsMountPoint |
hierarchical
|
private FsPath |
path
|
private FsScheme |
scheme
|
private static long |
serialVersionUID
|
private URI |
uri
|
| Constructor Summary | |
|---|---|
FsMountPoint(FsScheme scheme,
FsPath path)
Constructs a new mount point by synthesizing its URI from the given scheme and path. |
|
FsMountPoint(String uri)
Equivalent to new FsMountPoint(uri, FsUriModifier.NULL). |
|
FsMountPoint(String uri,
FsUriModifier modifier)
Constructs a new path by calling new URI(uri) and parsing the resulting URI. |
|
FsMountPoint(URI uri)
Equivalent to new FsMountPoint(uri, FsUriModifier.NULL). |
|
FsMountPoint(URI uri,
FsUriModifier modifier)
Constructs a new mount point by parsing the given URI. |
|
| Method Summary | |
|---|---|
int |
compareTo(FsMountPoint that)
Implements a natural ordering which is consistent with equals(Object). |
static FsMountPoint |
create(FsScheme scheme,
FsPath path)
Constructs a new mount point by synthesizing its URI from the given scheme and path. |
static FsMountPoint |
create(String uri)
Equivalent to create(uri, FsUriModifier.NULL). |
static FsMountPoint |
create(String uri,
FsUriModifier modifier)
Constructs a new mount point by constructing a new URI from the given string representation and parsing the result. |
static FsMountPoint |
create(URI uri)
Equivalent to create(uri, FsUriModifier.NULL). |
static FsMountPoint |
create(URI uri,
FsUriModifier modifier)
Constructs a new mount point by parsing the given URI. |
boolean |
equals(Object that)
Returns true iff the given object is a mount point and its URI
equals the URI of this mount point. |
FsMountPoint |
getParent()
Returns the nullable parent mount point, i.e. the mount point of the parent file system or null iff this mount point's
URI doesn't name a parent mount point, i.e. if it's
hierarchical. |
FsPath |
getPath()
Returns the path or null iff this mount point's
URI doesn't name a parent mount point, i.e. if it's
hierarchical. |
FsScheme |
getScheme()
Returns the URI scheme. |
URI |
getUri()
Returns the non- null URI. |
int |
hashCode()
Returns a hash code which is consistent with equals(Object). |
FsMountPoint |
hierarchicalize()
Returns a mount point which has its URI converted from the URI of this mount point so that it's absolute and hierarchical. |
private boolean |
invariants()
|
private void |
parse(URI uri,
FsUriModifier modifier)
|
private static String |
quote(Object s)
|
private void |
readObject(ObjectInputStream in)
|
FsPath |
resolve(FsEntryName entryName)
Resolves the given entry name against this mount point. |
String |
toString()
Equivalent to calling URI.toString() on getUri(). |
private void |
writeObject(ObjectOutputStream out)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
@NonNull private URI uri
@Nullable private transient FsPath path
@Nullable private transient volatile FsScheme scheme
@Nullable private transient volatile FsMountPoint hierarchical
| Constructor Detail |
|---|
public FsMountPoint(@NonNull
String uri)
throws URISyntaxException
new FsMountPoint(uri, FsUriModifier.NULL).
URISyntaxException
public FsMountPoint(@NonNull
String uri,
@NonNull
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 mount points.
public FsMountPoint(@NonNull
URI uri)
throws URISyntaxException
new FsMountPoint(uri, FsUriModifier.NULL).
URISyntaxException
public FsMountPoint(@NonNull
URI uri,
@NonNull
FsUriModifier modifier)
throws URISyntaxException
uri - the URI.modifier - the URI modifier.
URISyntaxException - if uri does not conform to the
syntax constraints for mount points.
public FsMountPoint(@NonNull
FsScheme scheme,
@NonNull
FsPath path)
throws URISyntaxException
scheme - the non-null scheme.path - the non-null path.
URISyntaxException - if the synthesized mount point URI
would not conform to the syntax constraints for mount points.| Method Detail |
|---|
@NonNull
public static FsMountPoint create(@NonNull
String uri)
create(uri, FsUriModifier.NULL).
@NonNull
public static FsMountPoint create(@NonNull
String uri,
@NonNull
FsUriModifier modifier)
new FsMountPoint(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 mount points.
@NonNull
public static FsMountPoint create(@NonNull
URI uri)
create(uri, FsUriModifier.NULL).
@NonNull
public static FsMountPoint create(@NonNull
URI uri,
@NonNull
FsUriModifier modifier)
new FsMountPoint(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 mount points.
@NonNull
public static FsMountPoint create(@NonNull
FsScheme scheme,
@NonNull
FsPath path)
new FsMountPoint(scheme, path)
and wraps any thrown URISyntaxException in an
IllegalArgumentException.
scheme - the scheme.path - the path.
IllegalArgumentException - if the synthesized mount point URI
would not conform to the syntax constraints for mount points.
private void writeObject(@NonNull
ObjectOutputStream out)
throws IOException
IOException
private void readObject(@NonNull
ObjectInputStream in)
throws IOException,
ClassNotFoundException
IOException
ClassNotFoundException
private void parse(@NonNull
URI uri,
@NonNull
FsUriModifier modifier)
throws URISyntaxException
URISyntaxExceptionprivate static String quote(Object s)
private boolean invariants()
@NonNull public FsScheme getScheme()
@Nullable public FsPath getPath()
null iff this mount point's
URI doesn't name a parent mount point, i.e. if it's
hierarchical.
@NonNull public URI getUri()
null URI.
null URI.@Nullable public FsMountPoint getParent()
null iff this mount point's
URI doesn't name a parent mount point, i.e. if it's
hierarchical.
@NonNull
public FsPath resolve(@NonNull
FsEntryName entryName)
entryName - an entry name relative to this mount point.
@NonNull public FsMountPoint hierarchicalize()
Note that this function is idempotent, so calling it repeatedly will
produce the same result again.
However, this function is not injective, so two different mount points
may produce equal results.
For example, the mount point URIs zip:file:/archive!/ and
tar:file:/archive!/ will both produce an equal mount point
with the absolute, hierarchical URI file:/archive/.
public boolean equals(@CheckForNull
Object that)
true iff the given object is a mount point and its URI
equals the URI of this mount point.
Note that this ignores the scheme and path.
equals in class Object
public int compareTo(@NonNull
FsMountPoint that)
equals(Object).
compareTo in interface Comparable<FsMountPoint>public int hashCode()
equals(Object).
hashCode in class Object@NonNull public String toString()
URI.toString() on getUri().
toString in class Object
|
TrueZIP Kernel 7.0-rc1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||