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

public class WindowsRpcSystemFileCommandsHelper extends SymbolicLinkHelper
Windows specific implementation to help with file permissions.
  • Constructor Details

    • WindowsRpcSystemFileCommandsHelper

      public WindowsRpcSystemFileCommandsHelper()
  • Method Details

    • canExecute

      public boolean canExecute(String fileName)
      Description copied from interface: ISystemFileCommandsHelper
      Return 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

      public boolean setWritable(String fileName, boolean writable)
      Description copied from interface: ISystemFileCommandsHelper
      Set 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

      public boolean setReadable(String fileName, boolean readable, boolean ownerOnly)
      Description copied from interface: ISystemFileCommandsHelper
      Set 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 readable
      ownerOnly - 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

      public boolean setOwnerReadOnly(String fileName)
      Description copied from interface: ISystemFileCommandsHelper
      Set 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

      public boolean setExecutable(String fileName, boolean executable, boolean ownerOnly)
      Description copied from interface: ISystemFileCommandsHelper
      Set 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

      public boolean isSymlink(String fileName)
      Description copied from interface: ISystemFileCommandsHelper
      Return 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.