|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSegmentedFilename
A data structure containing a series of directory and file names ("segments") that form a system-independent representation of a "file path." This structure is used in file transfers to accommodate for sharing files between operating systems.
Constructor Summary | |
SegmentedFilename(SegmentedFilename parent,
SegmentedFilename child)
Creates a new SegmentedFilename that consists of the
segments in parent followed by the segments in
child . |
|
SegmentedFilename(SegmentedFilename parent,
java.lang.String file)
Creates a new SegmentedFilename with the given segmented
filename as its "parent" and the given file or directory name as the last
"segment." |
|
SegmentedFilename(java.lang.String[] parts)
Creates a SegmentedFilename containing the given list of
segments. |
Method Summary | |
boolean |
equals(java.lang.Object obj)
|
static SegmentedFilename |
fromFTFilename(java.lang.String ftFilename)
Creates a SegmentedFilename from the given "file transfer
filename." |
static SegmentedFilename |
fromNativeFilename(java.lang.String nativeFilename)
Creates a SegmentedFilename from the given native
filename. |
java.lang.String[] |
getSegments()
Returns an array containing the "segments" of which this segmented filename consists. |
int |
hashCode()
|
java.lang.String |
toFTFilename()
Converts this segmented filename to a string, separating segments in the returned string with the "file transfer filename" separator (character \001 ). |
java.lang.String |
toNativeFilename()
Converts this segmented filename to a string, separating segments in the returned string with the system's native file separator. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SegmentedFilename(SegmentedFilename parent, java.lang.String file)
SegmentedFilename
with the given segmented
filename as its "parent" and the given file or directory name as the last
"segment." Using this constructor is equivalent to using
new
SegmentedFilename(parent, new SegmentedFilename(new String[] { file
))}.
parent
is null
, this method is
equivalent to using new
SegmentedFilename(new String[] { file
)}. Also note that
file
cannot be null
.
parent
- the "parent" SegmentedFilename
file
- a filename to be the last segment of the created segmented
filenamepublic SegmentedFilename(SegmentedFilename parent, SegmentedFilename child)
SegmentedFilename
that consists of the
segments in parent
followed by the segments in
child
. Note that if parent
is
null
, the created segmented filename will simply be a clone
of child
.
parent
- the "parent" segmented filename, or null
for
nonechild
- the "child" segmented filenamepublic SegmentedFilename(java.lang.String[] parts)
SegmentedFilename
containing the given list of
segments.
parts
- the list of filename "segments" of which the created
segmented filename should consistMethod Detail |
public static SegmentedFilename fromNativeFilename(java.lang.String nativeFilename)
SegmentedFilename
from the given native
filename. Note that this method will only produce a valid
SegmentedFilename
for filenames on the platform on which
the JVM is currently running, as it uses the JVM's
file.separator
system propery.
nativeFilename
- a native filename to be converted to a
SegmentedFilename
SegmentedFilename
generated from the given native
filenamepublic static SegmentedFilename fromFTFilename(java.lang.String ftFilename)
SegmentedFilename
from the given "file transfer
filename." A "file transfer filename" is simply a filename in the format
"\001home\001keith\001dev\001joust\001Joust.ipr"
, where
\001
is the ASCII character with the value
0x01
.
ftFilename
- a "file transfer filename" to convert to a
SegmentedFilename
SegmentedFilename
generated from the given "file
transfer filename"public final java.lang.String[] getSegments()
public final java.lang.String toNativeFilename()
String
containing the filename as a native
filenamepublic final java.lang.String toFTFilename()
\001
).
String
containing the filename as a "file transfer
filename"public int hashCode()
public boolean equals(java.lang.Object obj)
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |