public class RemotePath
extends java.lang.Object
implements org.eclipse.core.runtime.IPath, java.lang.Cloneable
org.eclipse.core.runtime.Path
.
Cloned from org.eclipse.equinox.common. This class should be removed when
Eclipse older than Mars no longer needs to be supported.Path
Modifier and Type | Field and Description |
---|---|
static RemotePath |
EMPTY
Constant value containing the empty path with no device on the local file system.
|
static RemotePath |
ROOT
Constant value containing the root path with no device on the local file system.
|
Constructor and Description |
---|
RemotePath(java.lang.String fullPath)
Constructs a new path from the given string path.
|
RemotePath(java.lang.String device,
java.lang.String path)
Constructs a new path from the given device id and string path.
|
Modifier and Type | Method and Description |
---|---|
org.eclipse.core.runtime.IPath |
addFileExtension(java.lang.String extension) |
org.eclipse.core.runtime.IPath |
addTrailingSeparator() |
org.eclipse.core.runtime.IPath |
append(org.eclipse.core.runtime.IPath tail) |
org.eclipse.core.runtime.IPath |
append(java.lang.String tail) |
java.lang.Object |
clone() |
boolean |
equals(java.lang.Object obj) |
static RemotePath |
forPosix(java.lang.String fullPath)
Constructs a new POSIX path from the given string path.
|
static RemotePath |
forWindows(java.lang.String fullPath)
Constructs a new Windows path from the given string path.
|
static org.eclipse.core.runtime.IPath |
fromOSString(java.lang.String pathString)
Constructs a new path from the given string path.
|
static org.eclipse.core.runtime.IPath |
fromPortableString(java.lang.String pathString)
Constructs a new path from the given path string.
|
java.lang.String |
getDevice() |
java.lang.String |
getFileExtension() |
int |
hashCode() |
boolean |
hasTrailingSeparator() |
boolean |
isAbsolute() |
boolean |
isEmpty() |
boolean |
isPrefixOf(org.eclipse.core.runtime.IPath anotherPath) |
boolean |
isRoot() |
boolean |
isUNC() |
boolean |
isValidPath(java.lang.String path) |
static boolean |
isValidPosixPath(java.lang.String path)
Returns whether the given string is syntactically correct as a path on a
POSIX file system.
|
static boolean |
isValidPosixSegment(java.lang.String segment)
Returns whether the given string is valid as a segment in a path on a
POSIX file system.
|
boolean |
isValidSegment(java.lang.String segment) |
static boolean |
isValidWindowsPath(java.lang.String path)
Returns whether the given string is syntactically correct as a path on
the Windows file system.
|
static boolean |
isValidWindowsSegment(java.lang.String segment)
Returns whether the given string is valid as a segment in a path on the
Windows file system.
|
java.lang.String |
lastSegment() |
org.eclipse.core.runtime.IPath |
makeAbsolute() |
org.eclipse.core.runtime.IPath |
makeRelative() |
org.eclipse.core.runtime.IPath |
makeRelativeTo(org.eclipse.core.runtime.IPath base) |
org.eclipse.core.runtime.IPath |
makeUNC(boolean toUNC) |
int |
matchingFirstSegments(org.eclipse.core.runtime.IPath anotherPath) |
org.eclipse.core.runtime.IPath |
removeFileExtension() |
org.eclipse.core.runtime.IPath |
removeFirstSegments(int count) |
org.eclipse.core.runtime.IPath |
removeLastSegments(int count) |
org.eclipse.core.runtime.IPath |
removeTrailingSeparator() |
java.lang.String |
segment(int index) |
int |
segmentCount() |
java.lang.String[] |
segments() |
org.eclipse.core.runtime.IPath |
setDevice(java.lang.String value) |
java.io.File |
toFile() |
java.lang.String |
toOSString() |
java.lang.String |
toPortableString() |
java.lang.String |
toString() |
org.eclipse.core.runtime.IPath |
uptoSegment(int count) |
public static final RemotePath EMPTY
public static final RemotePath ROOT
public RemotePath(java.lang.String fullPath)
fullPath
- the string pathisValidPath(String)
public RemotePath(java.lang.String device, java.lang.String path)
device
- the device idpath
- the string pathisValidPath(String)
,
setDevice(String)
public static org.eclipse.core.runtime.IPath fromOSString(java.lang.String pathString)
pathString
- the portable string pathIPath.toPortableString()
public static org.eclipse.core.runtime.IPath fromPortableString(java.lang.String pathString)
IPath.toPortableString
.pathString
- the portable path stringIPath.toPortableString()
public static RemotePath forPosix(java.lang.String fullPath)
fullPath
- the string pathisValidPosixPath(String)
public static RemotePath forWindows(java.lang.String fullPath)
fullPath
- the string pathisValidWindowsPath(String)
public org.eclipse.core.runtime.IPath addFileExtension(java.lang.String extension)
addFileExtension
in interface org.eclipse.core.runtime.IPath
public org.eclipse.core.runtime.IPath addTrailingSeparator()
addTrailingSeparator
in interface org.eclipse.core.runtime.IPath
public org.eclipse.core.runtime.IPath append(org.eclipse.core.runtime.IPath tail)
append
in interface org.eclipse.core.runtime.IPath
public org.eclipse.core.runtime.IPath append(java.lang.String tail)
append
in interface org.eclipse.core.runtime.IPath
public java.lang.Object clone()
clone
in interface org.eclipse.core.runtime.IPath
clone
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in interface org.eclipse.core.runtime.IPath
equals
in class java.lang.Object
public java.lang.String getDevice()
getDevice
in interface org.eclipse.core.runtime.IPath
public java.lang.String getFileExtension()
getFileExtension
in interface org.eclipse.core.runtime.IPath
public int hashCode()
hashCode
in class java.lang.Object
public boolean hasTrailingSeparator()
hasTrailingSeparator
in interface org.eclipse.core.runtime.IPath
public boolean isAbsolute()
isAbsolute
in interface org.eclipse.core.runtime.IPath
public boolean isEmpty()
isEmpty
in interface org.eclipse.core.runtime.IPath
public boolean isPrefixOf(org.eclipse.core.runtime.IPath anotherPath)
isPrefixOf
in interface org.eclipse.core.runtime.IPath
public boolean isRoot()
isRoot
in interface org.eclipse.core.runtime.IPath
public boolean isUNC()
isUNC
in interface org.eclipse.core.runtime.IPath
public boolean isValidPath(java.lang.String path)
isValidPath
in interface org.eclipse.core.runtime.IPath
public static boolean isValidPosixPath(java.lang.String path)
path
- the path to checktrue
if the given string is a valid path,
and false
otherwiseisValidPosixSegment(String)
public static boolean isValidWindowsPath(java.lang.String path)
path
- the path to checktrue
if the given string is a valid path,
and false
otherwiseisValidWindowsSegment(String)
public boolean isValidSegment(java.lang.String segment)
isValidSegment
in interface org.eclipse.core.runtime.IPath
public static boolean isValidPosixSegment(java.lang.String segment)
segment
- the path segment to checktrue
if the given path segment is valid,
and false
otherwisepublic static boolean isValidWindowsSegment(java.lang.String segment)
segment
- the path segment to checktrue
if the given path segment is valid,
and false
otherwisepublic java.lang.String lastSegment()
lastSegment
in interface org.eclipse.core.runtime.IPath
public org.eclipse.core.runtime.IPath makeAbsolute()
makeAbsolute
in interface org.eclipse.core.runtime.IPath
public org.eclipse.core.runtime.IPath makeRelative()
makeRelative
in interface org.eclipse.core.runtime.IPath
public org.eclipse.core.runtime.IPath makeRelativeTo(org.eclipse.core.runtime.IPath base)
makeRelativeTo
in interface org.eclipse.core.runtime.IPath
public org.eclipse.core.runtime.IPath makeUNC(boolean toUNC)
makeUNC
in interface org.eclipse.core.runtime.IPath
public int matchingFirstSegments(org.eclipse.core.runtime.IPath anotherPath)
matchingFirstSegments
in interface org.eclipse.core.runtime.IPath
public org.eclipse.core.runtime.IPath removeFileExtension()
removeFileExtension
in interface org.eclipse.core.runtime.IPath
public org.eclipse.core.runtime.IPath removeFirstSegments(int count)
removeFirstSegments
in interface org.eclipse.core.runtime.IPath
public org.eclipse.core.runtime.IPath removeLastSegments(int count)
removeLastSegments
in interface org.eclipse.core.runtime.IPath
public org.eclipse.core.runtime.IPath removeTrailingSeparator()
removeTrailingSeparator
in interface org.eclipse.core.runtime.IPath
public java.lang.String segment(int index)
segment
in interface org.eclipse.core.runtime.IPath
public int segmentCount()
segmentCount
in interface org.eclipse.core.runtime.IPath
public java.lang.String[] segments()
segments
in interface org.eclipse.core.runtime.IPath
public org.eclipse.core.runtime.IPath setDevice(java.lang.String value)
setDevice
in interface org.eclipse.core.runtime.IPath
public java.io.File toFile()
toFile
in interface org.eclipse.core.runtime.IPath
public java.lang.String toOSString()
toOSString
in interface org.eclipse.core.runtime.IPath
public java.lang.String toPortableString()
toPortableString
in interface org.eclipse.core.runtime.IPath
public java.lang.String toString()
toString
in interface org.eclipse.core.runtime.IPath
toString
in class java.lang.Object
public org.eclipse.core.runtime.IPath uptoSegment(int count)
uptoSegment
in interface org.eclipse.core.runtime.IPath