public abstract class SymbolicLinkHelper extends 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 String |
createSymbolicLink(String link,
String target)
Creates a symbolic link to a target.
|
static boolean |
exists(String path)
Tests whether a file is a symbolic link.
|
static long |
getLastModifiedTime(String link)
Gets the last modified time for a symbolic link.
|
static boolean |
isSymbolicLink(String path)
Tests whether a file is a symbolic link.
|
static boolean |
isSymbolicLinkCapable()
Checks if is symbolic link capable.
|
static String |
move(String source,
String target)
Creates a symbolic link to a target.
|
static String |
readSymbolicLink(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(String path)
path
- the path of the symbolic linkpublic static String readSymbolicLink(String link)
link
- the path to the symbolic linkpublic static long getLastModifiedTime(String link)
link
- the path to the symbolic linkpublic static boolean exists(String path)
path
- the path of the file or symbolic linkpublic static String move(String source, String target)
source
- the path of the path to the file to movetarget
- the path to the target fileCopyright © 2017 Perforce Software. All Rights Reserved.