Class RpcPerforceFile
java.lang.Object
java.io.File
com.perforce.p4java.impl.mapbased.rpc.sys.RpcPerforceFile
- All Implemented Interfaces:
Serializable,Comparable<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 Summary
FieldsModifier and TypeFieldDescriptionstatic Stringstatic final Stringstatic final Stringstatic StringFields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar -
Constructor Summary
ConstructorsConstructorDescriptionRpcPerforceFile(String fileName, RpcPerforceFileType fileType) RpcPerforceFile(String fileName, RpcPerforceFileType fileType, ClientLineEnding lineEnding) RpcPerforceFile(String fileName, String fileTypeStr) -
Method Summary
Modifier and TypeMethodDescriptionbooleanTrue IFF we should be able to copy this file as-is, i.e.booleanCopy this file to another (target file).static StringcreateTempFileName(String tmpDirName) booleanbooleanstatic booleanfileExists(File file, boolean fstSymlink) Check if the file or symbolic link exists.inthashCode()booleanbooleanOur "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).booleanAnother special version of renameTo to support RPC implementation- specific needs.voidsetFileType(RpcPerforceFileType fileType) voidsetLineEnding(ClientLineEnding lineEnding) Methods inherited from class java.io.File
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toPath, toString, toURI, toURL
-
Field Details
-
TRACE_PREFIX
-
systemTmpDirName
-
TMP_FILE_PFX
- See Also:
-
TMP_FILE_SFX
- See Also:
-
-
Constructor Details
-
RpcPerforceFile
-
RpcPerforceFile
-
RpcPerforceFile
-
-
Method Details
-
createTempFileName
-
renameTo
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). -
renameTo
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- targetFilealwaysCopyUnMunged- alwaysCopyUnMunged- Returns:
- ok
-
copyTo
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
- Throws:
IOException
-
getFileType
-
setFileType
-
getLineEnding
-
setLineEnding
-
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
-
hashCode
public int hashCode() -
isSymlink
public boolean isSymlink() -
fileExists
Check if the file or symbolic link exists.- Parameters:
file- filefstSymlink- fstSymlink- Returns:
- exists
-