|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.perforce.p4java.impl.mapbased.rpc.sys.helper.SymbolicLinkHelper
public abstract class SymbolicLinkHelper
Abstract helper class for dynamically determine and use symbolic link support in the Java NIO package (JDK 7 or above).
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).
Field Summary | |
---|---|
static String |
COPY_OPTION_CLASS_NAME
|
static String |
FILE_ATTRIBUTE_CLASS_NAME
|
static String |
FILE_SYSTEM_CLASS_NAME
|
static String |
FILE_SYSTEM_GET_PATH_METHOD_NAME
|
static String |
FILE_SYSTEMS_CLASS_NAME
|
static String |
FILE_SYSTEMS_GET_DEFAULT_METHOD_NAME
|
static String |
FILE_TIME_CLASS_NAME
|
static String |
FILE_TIME_PATTERN
|
static String |
FILE_TIME_TO_MILLIS_METHOD_NAME
|
static String |
FILES_CLASS_NAME
|
static String |
FILES_CREATE_SYMBOLIC_LINK_METHOD_NAME
|
static String |
FILES_EXISTS_METHOD_NAME
|
static String |
FILES_GET_LAST_MODIFIED_TIME_METHOD_NAME
|
static String |
FILES_IS_SYMBOLIC_LINK_METHOD_NAME
|
static String |
FILES_MOVE_METHOD_NAME
|
static String |
FILES_READ_SYMBOLIC_LINK_METHOD_NAME
|
static String |
LINK_OPTION_CLASS_NAME
|
static String |
PATH_CLASS_NAME
|
Constructor Summary | |
---|---|
SymbolicLinkHelper()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.perforce.p4java.impl.generic.sys.ISystemFileCommandsHelper |
---|
canExecute, isSymlink, setExecutable, setOwnerReadOnly, setReadable, setWritable |
Field Detail |
---|
public static final String FILE_TIME_PATTERN
public static final String FILE_SYSTEMS_CLASS_NAME
public static final String FILE_SYSTEM_CLASS_NAME
public static final String PATH_CLASS_NAME
public static final String FILES_CLASS_NAME
public static final String FILE_ATTRIBUTE_CLASS_NAME
public static final String LINK_OPTION_CLASS_NAME
public static final String FILE_TIME_CLASS_NAME
public static final String COPY_OPTION_CLASS_NAME
public static final String FILE_SYSTEMS_GET_DEFAULT_METHOD_NAME
public static final String FILE_SYSTEM_GET_PATH_METHOD_NAME
public static final String FILES_IS_SYMBOLIC_LINK_METHOD_NAME
public static final String FILES_EXISTS_METHOD_NAME
public static final String FILES_CREATE_SYMBOLIC_LINK_METHOD_NAME
public static final String FILES_READ_SYMBOLIC_LINK_METHOD_NAME
public static final String FILES_GET_LAST_MODIFIED_TIME_METHOD_NAME
public static final String FILE_TIME_TO_MILLIS_METHOD_NAME
public static final String FILES_MOVE_METHOD_NAME
Constructor Detail |
---|
public SymbolicLinkHelper()
Method Detail |
---|
public static boolean isSymbolicLinkCapable()
public static boolean isSymbolicLink(String path)
path
- the path of the symbolic link
public static String createSymbolicLink(String link, String target)
link
- the path of the symbolic link to createtarget
- the target of the symbolic link
public static String readSymbolicLink(String link)
link
- the path to the symbolic link
public static long getLastModifiedTime(String link)
link
- the path to the symbolic link
public static boolean exists(String path)
path
- the path of the file or symbolic link
public static String move(String source, String target)
source
- the path of the path to the file to movetarget
- the path to the target file
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |