|
||||||||||
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
com.perforce.p4java.impl.mapbased.rpc.sys.helper.RpcSystemFileCommandsHelper
public class RpcSystemFileCommandsHelper
Default JDK 6 implementation of the ISystemFileCommandsHelper interface. Uses introspection so it can be compiled (if not actually work) on JDK 5 systems. Actual use of this on JDK 5 systems is OK to the extent that things like edit or sync may end up with the wrong permissions on the client, but much else will work just fine.
Field Summary | |
---|---|
static String |
IMPL_CLASS_NAME
|
Constructor Summary | |
---|---|
RpcSystemFileCommandsHelper()
|
Method Summary | |
---|---|
boolean |
canExecute(String fileName)
Return true iff the file exists and is executable. |
boolean |
isSymlink(String fileName)
Return true iff the file exists and is a symbolic link. |
boolean |
setExecutable(String fileName,
boolean executable,
boolean ownerOnly)
Set the file's permissions to allow or disallow it to be executed. |
boolean |
setOwnerReadOnly(String fileName)
Set the file's read permissions only allow reading by owner. |
boolean |
setReadable(String fileName,
boolean readable,
boolean ownerOnly)
Set the file's permissions to allow or disallow reading from it. |
boolean |
setWritable(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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String IMPL_CLASS_NAME
Constructor Detail |
---|
public RpcSystemFileCommandsHelper()
Method Detail |
---|
public boolean canExecute(String fileName)
ISystemFileCommandsHelper
canExecute
in interface ISystemFileCommandsHelper
fileName
- non-null path or name of the target file.
ISystemFileCommandsHelper.canExecute(java.lang.String)
public boolean setExecutable(String fileName, boolean executable, boolean ownerOnly)
ISystemFileCommandsHelper
setExecutable
in interface ISystemFileCommandsHelper
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
ISystemFileCommandsHelper.setExecutable(java.lang.String, boolean, boolean)
public boolean setWritable(String fileName, boolean writable)
ISystemFileCommandsHelper
setWritable
in interface ISystemFileCommandsHelper
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).
ISystemFileCommandsHelper.setWritable(java.lang.String, boolean)
public boolean isSymlink(String fileName)
ISystemFileCommandsHelper
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.
isSymlink
in interface ISystemFileCommandsHelper
fileName
- non-null path or name of the target file.
ISystemFileCommandsHelper.isSymlink(java.lang.String)
public boolean setReadable(String fileName, boolean readable, boolean ownerOnly)
ISystemFileCommandsHelper
setReadable
in interface ISystemFileCommandsHelper
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
ISystemFileCommandsHelper.setReadable(java.lang.String,
boolean, boolean)
public boolean setOwnerReadOnly(String fileName)
ISystemFileCommandsHelper
setOwnerReadOnly
in interface ISystemFileCommandsHelper
fileName
- non-null path or name of the target file.
set the file read-only.
ISystemFileCommandsHelper.setOwnerReadOnly(java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |