Class RpcPerforceFile

java.lang.Object
java.io.File
com.perforce.p4java.impl.mapbased.rpc.sys.RpcPerforceFile
All Implemented Interfaces:
Serializable, Comparable<File>

public class RpcPerforceFile extends File
Encapsulates and implements a lot of Perforce-specific information and operations on Perforce client-side files by extending the basic java.io.File class with Perforce-specific fields and methods.
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • createTempFileName

      public static String createTempFileName(String tmpDirName)
    • renameTo

      public boolean renameTo(File targetFile)
      Our "special" version of rename, intended to cope with the cases when the normal rename won't work (typically cross-device renames) or when we need to do some under-the-covers stitching up (for example, GKZIP stream decoding).
      Overrides:
      renameTo in class File
    • renameTo

      public boolean renameTo(File targetFile, boolean alwaysCopyUnMunged)
      Another special version of renameTo to support RPC implementation- specific needs. This one allows callers to specify whether to always copy as-is (no munging).
      Parameters:
      targetFile - targetFile
      alwaysCopyUnMunged - alwaysCopyUnMunged
      Returns:
      ok
    • copyTo

      public boolean copyTo(File targetFile) throws IOException
      Copy this file to another (target file). Assumes no decoding necessary. If the target file exists, it's removed before copying.
      Parameters:
      targetFile - targetFile
      Returns:
      ok
      Throws:
      IOException - on error
    • decodeTo

      public boolean decodeTo(File targetFile) throws IOException
      Throws:
      IOException
    • getFileType

      public RpcPerforceFileType getFileType()
    • setFileType

      public void setFileType(RpcPerforceFileType fileType)
    • getLineEnding

      public ClientLineEnding getLineEnding()
    • setLineEnding

      public void setLineEnding(ClientLineEnding lineEnding)
    • canCopyAsIs

      public boolean canCopyAsIs()
      True IFF we should be able to copy this file as-is, i.e. without GKZIP decoding or munging, etc. Currently all file types can be copied as-is, but this wasn't always true and may not always be true...
      Returns:
      ok
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class File
      See Also:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class File
      See Also:
    • isSymlink

      public boolean isSymlink()
    • fileExists

      public static boolean fileExists(File file, boolean fstSymlink)
      Check if the file or symbolic link exists.
      Parameters:
      file - file
      fstSymlink - fstSymlink
      Returns:
      exists