public abstract class SymbolicLinkHelper extends java.lang.Object implements ISystemFileCommandsHelper
Note that for Windows systems, hard links are available as of Windows 2000, and symbolic links as of Windows Vista. Therefore, for symbolic link support the Windows version needs to be Windows Vista or above.
The creation of symbolic links during the sync operation requires the link path and target path to be valid on the operating platform.
If a file changes its type to a symlink in Perforce, the content (data) of the file will be used as the link target. In this case, most likely the content (string representation) would not be a valid path.
As of this writing, the Perforce server and client treat hard links as normal files/dirs (Perforce cannot tell the difference).
Constructor and Description |
---|
SymbolicLinkHelper() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
createSymbolicLink(java.lang.String link,
java.lang.String target)
Creates a symbolic link to a target.
|
static boolean |
exists(java.lang.String path)
Tests whether a file is a symbolic link.
|
static long |
getLastModifiedTime(java.lang.String link)
Gets the last modified time for a symbolic link.
|
static boolean |
isSymbolicLink(java.lang.String path)
Tests whether a file is a symbolic link.
|
static boolean |
isSymbolicLinkCapable()
Checks if is symbolic link capable.
|
static java.lang.String |
move(java.lang.String source,
java.lang.String target)
Creates a symbolic link to a target.
|
static java.lang.String |
readSymbolicLink(java.lang.String link)
Reads the target path of a symbolic link.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canExecute, isSymlink, setExecutable, setOwnerReadOnly, setReadable, setWritable
public static boolean isSymbolicLinkCapable()
public static boolean isSymbolicLink(java.lang.String path)
path
- the path of the symbolic linkpublic static java.lang.String readSymbolicLink(java.lang.String link)
link
- the path to the symbolic linkpublic static long getLastModifiedTime(java.lang.String link)
link
- the path to the symbolic linkpublic static boolean exists(java.lang.String path)
path
- the path of the file or symbolic linkpublic static java.lang.String move(java.lang.String source, java.lang.String target)
source
- the path of the path to the file to movetarget
- the path to the target filepublic static java.lang.String createSymbolicLink(java.lang.String link, java.lang.String target)
link
- the path of the symbolic link to createtarget
- the target of the symbolic link