Class WindowsRpcSystemFileCommandsHelper
java.lang.Object
com.perforce.p4java.impl.mapbased.rpc.sys.helper.SymbolicLinkHelper
com.perforce.p4java.impl.mapbased.rpc.sys.helper.WindowsRpcSystemFileCommandsHelper
- All Implemented Interfaces:
ISystemFileCommandsHelper
Windows specific implementation to help with file permissions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanExecute(String fileName) Return true iff the file exists and is executable.booleanReturn true iff the file exists and is a symbolic link.booleansetExecutable(String fileName, boolean executable, boolean ownerOnly) Set the file's permissions to allow or disallow it to be executed.booleansetOwnerReadOnly(String fileName) Set the file's read permissions only allow reading by owner.booleansetReadable(String fileName, boolean readable, boolean ownerOnly) Set the file's permissions to allow or disallow reading from it.booleansetWritable(String fileName, boolean writable) Set the file's permissions to allow or disallow writing to it.Methods inherited from class com.perforce.p4java.impl.mapbased.rpc.sys.helper.SymbolicLinkHelper
createSymbolicLink, exists, getLastModifiedTime, isSymbolicLink, isSymbolicLinkCapable, move, readSymbolicLink
-
Constructor Details
-
WindowsRpcSystemFileCommandsHelper
public WindowsRpcSystemFileCommandsHelper()
-
-
Method Details
-
canExecute
Description copied from interface:ISystemFileCommandsHelperReturn true iff the file exists and is executable.- Parameters:
fileName- non-null path or name of the target file.- Returns:
- true iff the file existed and is executable.
-
setWritable
Description copied from interface:ISystemFileCommandsHelperSet the file's permissions to allow or disallow writing to it.- Parameters:
fileName- non-null path or name of the target file.writable- if true, allow the file to be written to; if false, set the file read-only (or, more accurately, not writable).- Returns:
- true iff the set permission operation succeeded. May return false if the file didn't exist or the operation failed or an exception was caught, etc.
-
setReadable
Description copied from interface:ISystemFileCommandsHelperSet the file's permissions to allow or disallow reading from it.- Parameters:
fileName- non-null path or name of the target file. set the file read-only.readable- if true, allow the file to be read; if false, set the file to not be readableownerOnly- true to only set the read-only bit for the owner- Returns:
- true iff the set permission operation succeeded. May return false if the file didn't exist or the operation failed or an exception was caught, etc.
-
setOwnerReadOnly
Description copied from interface:ISystemFileCommandsHelperSet the file's read permissions only allow reading by owner.- Parameters:
fileName- non-null path or name of the target file. set the file read-only.- Returns:
- true iff the set permission operation succeeded. May return false if the file didn't exist or the operation failed or an exception was caught, etc.
-
setExecutable
Description copied from interface:ISystemFileCommandsHelperSet the file's permissions to allow or disallow it to be executed.- Parameters:
fileName- non-null path or name of the target file.executable- if true, allow the file to be executed; if false, set the file not executable.ownerOnly- true to only set the executable bit for the owner- Returns:
- true iff the set permission operation succeeded. May return false if the file didn't exist or the operation failed or an exception was caught, etc.
-
isSymlink
Description copied from interface:ISystemFileCommandsHelperReturn true iff the file exists and is a symbolic link.This method is guaranteed to only be called when we suspect a specific file may be a symbolic link (i.e. we've exhausted other possibilities) and it is safe for this method to return false if it can't implement the associated plumbing or it simply can't tell whether the file is a symlink or not.
- Parameters:
fileName- non-null path or name of the target file.- Returns:
- true iff the file exists and is a symbolic link.
-