Class FileSpec
- All Implemented Interfaces:
IFileOperationResult,IFileSpec,IServerResource
- Direct Known Subclasses:
ExtendedFileSpec
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FileActionprotected Stringprotected Stringprotected intprotected Stringprotected Stringprotected intprotected IClientprotected Stringprotected FilePathprotected Stringprotected Dateprotected FilePathprotected intprotected Stringprotected intprotected Stringprotected FilePathprotected FileSpecOpStatusprotected FilePathprotected intprotected Stringprotected intprotected Stringprotected intprotected Stringprotected intprotected intprotected Stringprotected intprotected booleanprotected StringFields inherited from class com.perforce.p4java.impl.generic.core.ServerResource
refreshable, server, updateableFields inherited from interface com.perforce.p4java.core.file.IFileSpec
HAVE_REVISION, HAVE_REVISION_STRING, HEAD_REVISION, HEAD_REVISION_STRING, NO_FILE_REVISION, NO_REVISION_STRING, NONE_REVISION, NONE_REVISION_STRING -
Constructor Summary
ConstructorsConstructorDescriptionFileSpec()Default constructor.FileSpec(FileSpecOpStatus status, String errStr) Construct a filespec from an opstatus and error message pair.FileSpec(FileSpecOpStatus status, String errStr, int rawCode) Construct a new FileSpec given the op status, an error string, and a raw code value returned from a Perforce server.FileSpec(FileSpecOpStatus status, String errStr, int genericCode, int severityCode) Construct a FileSpec from an opstatus, error message, Perforce generic code, and Perforce severity code.FileSpec(FileSpecOpStatus status, String errStr, String codeStr) Construct a new FileSpec given the op status, an error string, and a raw code string returned from a Perforce server.Construct a FileSpec from a specific FilePath.Construct a new filespec from another filespec.Given a candidate path string (which may include version and changelist annotations, at least), try to construct a corresponding file spec.Given a candidate path string (which may include version and changelist annotations, at least), try to construct a corresponding file spec.Try to construct a FileSpec from a passed-in map as returned from a Perforce server. -
Method Summary
Modifier and TypeMethodDescriptiongetAnnotatedPathString(FilePath.PathType pathType) Get an annotated string representation of a Perforce file path associated with this Perforce file spec.Get the annotated "preferred" path string for this file spec.getAnnotations(DiffType wsOptions, boolean allResults, boolean useChangeNumbers, boolean followBranches) Get the file annotations associated with this file.Get the file annotations associated with this file.intintGet the ID of the changelist associated with this file spec.Convenience method for getPath(CLIENT).Convenience method for getPathString(CLIENT).getContents(boolean noHeaderLine) Get the contents of this specific Perforce file revision from the Perforce depot as an InputStream.Get the contents of this specific Perforce file revision from the Perforce depot as an InputStream.getDate()Get the Perforce date of this file spec.Convenience method for getPath(DEPOT).Convenience method for getPathString(DEPOT).Get the diff status for this file spec.intintGet the end revision for this file spec, if any.intintGet the Perforce generic code associated with the operation result.getLabel()Convenience method for getPath(LOCAL).Convenience method for getPathString(LOCAL).Return the particular Perforce operation status associated with the specific Perforce file spec operation.Convenience method for getPath(ORIGINAL).Convenience method for getPathString(ORIGINAL).getPath(FilePath.PathType pathType) Get the specific depot, client, local, or original Perforce file path associated with this file spec.getPathString(FilePath.PathType pathType) Get the unannotated path string for this Perforce file.Get the "preferred" path for this file spec.Get the (unannotated) "preferred" path string for this file spec.intGet the Perforce raw code associated with the operation result.static intgetRevFromString(String str) getRevisionHistory(int maxRevs, boolean contentHistory, boolean includeInherited, boolean longOutput, boolean truncatedLongOutput) Get the revision history of this Perforce file.Get the revision history of this Perforce file.intGet the Perforce severity code associated with the operation result.getSha()intintintintReturn the status message associated with the operation (this may be an error or informational message, depending on the operation).intGet the Perforce 'sub' code associated with the operation result.intGet the Perforce sub system code associated with the operation result.longintGet the Perforce 'unqieu' code associated with the operation result.intbooleanisLocked()booleanisUnmap()Move this file if it's already opened for edit or add (the fromFile) to the destination file (the toFile).move(IFileSpec toFile, MoveFileOptions opts) Move this file if it's already opened for edit or add (the fromFile) to the destination file (the toFile).voidsetAction(FileAction action) Set the file action for this file spec.voidsetBaseFile(String baseFile) Set the base file on this object.voidsetBaseName(String baseName) Set the base name on this object.voidsetBaseRev(int baseRev) Set the base revision on this object.voidsetBlobSha(String sha) voidvoidsetChangelistId(int changeListId) Set the changelist ID for this file spec.voidvoidsetClientName(String clientName) Set the Perforce client name for this file spec.voidsetClientPath(FilePath clientPath) voidsetClientPath(String pathStr) Convenience method for setPath(new FilePath(PathType.CLIENT, pathStr));setCodes(int rawCode) Set the various error codes for this FileSpec to a value returned from the server or the RPC layer.voidsetCommitSha(String sha) voidsetContentResolveType(String contentResolveType) Set the content resolve type for this file spec.voidSet the date for this file spec.voidsetDepotPath(FilePath depotPath) voidsetDepotPath(String pathStr) Convenience method for setPath(new FilePath(PathType.DEPOT, pathStr));voidsetDiffStatus(String diffStatus) Set the diff status for this file spec.voidsetEndFromRev(int endFromRev) Set the end from revision for this file spec.voidsetEndRevision(int endRevision) Set the end revision for this file spec.voidsetEndToRev(int endToRev) Set the end to revision for this file spec.voidsetFileType(String fileType) Set the file type for this file spec.voidsetFromFile(String fromFile) Set the from file for this file spec.voidsetHowResolved(String howResolved) Set the "how resolved" string for this file spec.voidSet the label associated with this file spec.voidsetLocalPath(FilePath localPath) voidsetLocalPath(String pathStr) Convenience method for setPath(new FilePath(PathType.LOCAL, pathStr));voidsetLocked(boolean locked) Set the locked status for this file spec.voidsetOpStatus(FileSpecOpStatus opStatus) voidsetOriginalPath(FilePath path) voidsetOriginalPath(String pathStr) Convenience method for setPath(new FilePath(PathType.ORIGINAL, pathStr));voidsetOtherAction(FileAction otherAction) Set the other action for this file spec.voidSet a Perforce file path associated with this file spec.voidsetPathFromString(FilePath.PathType pathType, String pathStr) Set a specific Perforce file path for this file spec from a passed-in string.voidsetRepoName(String repoName) voidsetResolveType(String resolveType) Set the resolve type for this file spec.voidsetResolveTypes(List<String> types) voidvoidsetShelvedChange(int shelvedChange) Set the shelved change for this file spec.voidsetStartFromRev(int startFromRev) Set the end from revision for this file spec.voidsetStartRevision(int startRevision) Set the start revision for this file spec.voidsetStartToRev(int startToRev) Set the start to revision for this file spec.voidsetStatusMessage(String statusMessage) voidsetSyncTime(long syncTime) voidSet the to file for this file spec.voidsetTreeSha(String sha) voidsetUnmap(boolean unmap) Set the unmap status value for this file spec.voidsetUserName(String userName) Set the Perforce user name for this file spec.voidsetWorkRev(int workRev) Set the work revision for this file spec.toString()Useful alias for getPreferredPathString().Methods inherited from class com.perforce.p4java.impl.generic.core.ServerResource
canRefresh, canUpdate, clearRawFields, complete, getRawField, getRawFields, hasRawField, parseDate, refresh, setRawField, setRawFields, setRefreshable, setServer, toDateString, update, update, updateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.perforce.p4java.core.IServerResource
canRefresh, canUpdate, clearRawFields, complete, getRawField, getRawFields, hasRawField, refresh, setRawField, setRawFields, setServer, update, update, update
-
Field Details
-
opStatus
-
statusMessage
-
genericCode
protected int genericCode -
severityCode
protected int severityCode -
rawCode
protected int rawCode -
uniqueCode
protected int uniqueCode -
subCode
protected int subCode -
subSystem
protected int subSystem -
originalPath
-
depotPath
-
clientPath
-
localPath
-
fileType
-
startRevision
protected int startRevision -
endRevision
protected int endRevision -
changeListId
protected int changeListId -
label
-
date
-
action
-
userName
-
clientName
-
baseRev
protected int baseRev -
baseName
-
baseFile
-
unmap
protected boolean unmap -
repoName
-
sha
-
branch
-
blobSha
-
commitSha
-
treeSha
-
client
-
-
Constructor Details
-
FileSpec
public FileSpec()Default constructor. Sets all paths, labels, dates, etc. to null; revisions to IFileSpec.NO_FILE_REVISION; client and server references to null; changelist ID to IChangelist.UNKNOWN; opStatus to VALID; locked to false, etc. -
FileSpec
Given a candidate path string (which may include version and changelist annotations, at least), try to construct a corresponding file spec.Effectively an alias for FileSpec(pathStr, true).
- Parameters:
pathStr- candidate path string
-
FileSpec
Given a candidate path string (which may include version and changelist annotations, at least), try to construct a corresponding file spec.The motivation for the hasAnnotations parameter is to allow path strings to contain "@" and "#" characters; the downside of this that if there's any associated annotation info, it's not parsed at all and any such information must be set up manually.
- Parameters:
pathStr- candidate path stringparseAnnotations- if true, attempt to parse the path string for revision annotations.
-
FileSpec
Construct a FileSpec from a specific FilePath.- Parameters:
path- path
-
FileSpec
Construct a filespec from an opstatus and error message pair.- Parameters:
status- statuserrStr- errStr
-
FileSpec
Construct a FileSpec from an opstatus, error message, Perforce generic code, and Perforce severity code.- Parameters:
status- statuserrStr- errStrgenericCode- genericCodeseverityCode- severityCode
-
FileSpec
Construct a new FileSpec given the op status, an error string, and a raw code string returned from a Perforce server.- Parameters:
status- statuserrStr- errStrcodeStr- codeStr
-
FileSpec
Construct a new FileSpec given the op status, an error string, and a raw code value returned from a Perforce server.- Parameters:
status- statuserrStr- errStrrawCode- rawCode
-
FileSpec
Construct a new filespec from another filespec. In other words, effectively clone it by deep copy of local fields.- Parameters:
impl- non-null existing filespec.
-
FileSpec
Try to construct a FileSpec from a passed-in map as returned from a Perforce server. Tuned to return values from the underlying map-based server interface, which explains the index (set this to zero for normal use).- Parameters:
map- mapserver- serverindex- index
-
-
Method Details
-
setCodes
Set the various error codes for this FileSpec to a value returned from the server or the RPC layer. Use this if you're hand-constructing a new FileSpec for an error condition and you have the raw code.- Parameters:
rawCode- rawCode- Returns:
- file spec
-
getPath
Description copied from interface:IFileSpecGet the specific depot, client, local, or original Perforce file path associated with this file spec. Will be null if no such path exists for this file spec. -
setPath
Description copied from interface:IFileSpecSet a Perforce file path associated with this file spec. If path or path.getPathType() is null, the passed-in path type is assumed to be ORIGINAL. -
getAction
-
getChangelistId
public int getChangelistId()Description copied from interface:IFileSpecGet the ID of the changelist associated with this file spec. Returns IChangelist.UNKNOWN if no changelist ID has been set.- Specified by:
getChangelistIdin interfaceIFileSpec- Returns:
- change
-
getSyncTime
public long getSyncTime()- Specified by:
getSyncTimein interfaceIFileSpec
-
setSyncTime
public void setSyncTime(long syncTime) - Specified by:
setSyncTimein interfaceIFileSpec
-
getClientName
- Specified by:
getClientNamein interfaceIFileSpec- Returns:
- the name of the client associated with this file spec, or null if not set or known.
-
getClientPath
Description copied from interface:IFileSpecConvenience method for getPath(CLIENT).- Specified by:
getClientPathin interfaceIFileSpec- Returns:
- client path
-
getContents
public InputStream getContents(boolean noHeaderLine) throws ConnectionException, RequestException, AccessException Description copied from interface:IFileSpecGet the contents of this specific Perforce file revision from the Perforce depot as an InputStream. Note that the contents are retrieved from the depot, not from the (possibly-changed) local Perforce client workspace copy). This method is basically a convenience wrapper for the IServer.getFileContents() method.You should close the InputStream after use in order to release any underlying stream-related resources. Failure to do this may lead to the proliferation of temp files or long-term memory wastage or even leaks.
- Specified by:
getContentsin interfaceIFileSpec- Parameters:
noHeaderLine- if true, suppresses the initial line that displays the file name and revision- Returns:
- a non-null but possibly-empty InputStream onto the file's contents.
- Throws:
ConnectionException- if the Perforce server is unreachable or is not connected.RequestException- if the Perforce server encounters an error during its processing of the requestAccessException- if the Perforce server denies access to the caller
-
getContents
Description copied from interface:IFileSpecGet the contents of this specific Perforce file revision from the Perforce depot as an InputStream. Note that the contents are retrieved from the depot, not from the (possibly-changed) local Perforce client workspace copy). This method is basically a convenience wrapper for the IOptionsServer.getFileContents() method.You should close the InputStream after use in order to release any underlying stream-related resources. Failure to do this may lead to the proliferation of temp files or long-term memory wastage or even leaks.
- Specified by:
getContentsin interfaceIFileSpec- Parameters:
opts- GetFileContents object describing optional parameters; if null, no options are set.- Returns:
- a non-null but possibly-empty InputStream onto the file's contents.
- Throws:
P4JavaException- if any error occurs in the processing of this method.
-
getDepotPath
Description copied from interface:IFileSpecConvenience method for getPath(DEPOT).- Specified by:
getDepotPathin interfaceIFileSpec- Returns:
- depot path
-
getEndRevision
public int getEndRevision()Description copied from interface:IFileSpecGet the end revision for this file spec, if any. Returns NO_FILE_REVISION if the revision hasn't been set or is unknown.- Specified by:
getEndRevisionin interfaceIFileSpec- Returns:
- revision
-
getFileType
- Specified by:
getFileTypein interfaceIFileSpec- Returns:
- the file type string for this file spec, or null if not known.
-
getLabel
-
getLocalPath
Description copied from interface:IFileSpecConvenience method for getPath(LOCAL).- Specified by:
getLocalPathin interfaceIFileSpec- Returns:
- local path
-
getOpStatus
Description copied from interface:IFileOperationResultReturn the particular Perforce operation status associated with the specific Perforce file spec operation.- Specified by:
getOpStatusin interfaceIFileOperationResult- Returns:
- non-null FileSpecOpStatus for the specific file spec return.
-
getPreferredPath
Description copied from interface:IFileSpecGet the "preferred" path for this file spec. A file spec's preferred path is defined to be the path specified (in order) the original path, the depot path, the client path, or the local path.- Specified by:
getPreferredPathin interfaceIFileSpec- Returns:
- possibly-null preferred path
-
getRevisionHistory
public Map<IFileSpec,List<IFileRevisionData>> getRevisionHistory(int maxRevs, boolean contentHistory, boolean includeInherited, boolean longOutput, boolean truncatedLongOutput) throws ConnectionException, RequestException, AccessException Description copied from interface:IFileSpecGet the revision history of this Perforce file.Note that the revision history returned may contain more than one file if the includeInherited option is true; this is why the return is a map (keyed on depot file path) of revision lists rather than a simple list.
Behavior is undefined if both longOutput and truncatedLongOutput are true. If both are false, a short form of the description (prepared by the server) is returned.
- Specified by:
getRevisionHistoryin interfaceIFileSpec- Parameters:
maxRevs- if positive, return at most maxRev revisions for this file.contentHistory- if true, return the content historyincludeInherited- if true, causes inherited file history to be returned as well.longOutput- if true, return the full descriptions associated with each revisiontruncatedLongOutput- if true, return only the first 250 characters of each description.- Returns:
- a non-null map of lists of the revision data for the file.
- Throws:
ConnectionException- if the Perforce server is unreachable or is not connected.RequestException- if the Perforce server encounters an error during its processing of the requestAccessException- if the Perforce server denies access to the caller
-
getRevisionHistory
public Map<IFileSpec,List<IFileRevisionData>> getRevisionHistory(GetRevisionHistoryOptions opts) throws P4JavaException Description copied from interface:IFileSpecGet the revision history of this Perforce file.Note that the revision history returned may contain more than one file if the includeInherited option is true; this is why the return is a map (keyed on depot file path) of revision lists rather than a simple list.
Behavior is undefined if both longOutput and truncatedLongOutput are true in the passed-in GetRevisionHistory object. If both are false, a short form of the description (prepared by the server) is returned.
- Specified by:
getRevisionHistoryin interfaceIFileSpec- Parameters:
opts- GetChangelistDiffs object describing optional parameters; if null, no options are set.- Returns:
- a non-null map of lists of the revision data for the file.
- Throws:
P4JavaException- if any error occurs in the processing of this method.
-
getAnnotations
public List<IFileAnnotation> getAnnotations(DiffType wsOptions, boolean allResults, boolean useChangeNumbers, boolean followBranches) throws ConnectionException, RequestException, AccessException Description copied from interface:IFileSpecGet the file annotations associated with this file.- Specified by:
getAnnotationsin interfaceIFileSpec- Parameters:
wsOptions- DiffType describing the white space option to be used; if null, use default (no options), otherwise must be one of the whitespace options defined by the isWsOption method on DiffType.allResults- if true, include both deleted files and lines no longer present at the head revisionuseChangeNumbers- if true, annotate with change numbers rather than revision numbers with each linefollowBranches- if true, follow branches.- Returns:
- non-null (but possibly-empty) list of IFileAnnotation objects representing this file's version annotations.
- Throws:
ConnectionException- if the Perforce server is unreachable or is not connected.RequestException- if the Perforce server encounters an error during its processing of the requestAccessException- if the Perforce server denies access to the caller
-
getAnnotations
Description copied from interface:IFileSpecGet the file annotations associated with this file.- Specified by:
getAnnotationsin interfaceIFileSpec- Parameters:
opts- GetFileAnnotations object describing optional parameters; if null, no options are set.- Returns:
- non-null (but possibly-empty) list of IFileAnnotation objects representing this file's version annotations.
- Throws:
P4JavaException- if any error occurs in the processing of this method.
-
move
public List<IFileSpec> move(int changelistId, boolean listOnly, boolean noClientMove, String fileType, IFileSpec toFile) throws ConnectionException, RequestException, AccessException Description copied from interface:IFileSpecMove this file if it's already opened for edit or add (the fromFile) to the destination file (the toFile). A file can be moved many times before it is submitted; moving it back to its original location will reopen it for edit. The full semantics of this operation (which can be confusing) are found in the main 'p4 help' documentation.Note that the status of this file once the move has been performed may be indeterminate; you should discard this file and use the file returned, if any, or at least test this file's status.
Note that this operation is not supported on servers earlier than 2009.1; any attempt to use this on earlier servers will result in a RequestException with a suitable message. Similarly, not all underlying IServer implementations will work with this either, and will also result in a suitable RequestException.
- Specified by:
movein interfaceIFileSpec- Parameters:
changelistId- if not IChangelist.UNKNOWN, the files are opened in the numbered pending changelist instead of the 'default' changelist.listOnly- if true, don't actually perform the move, just return what would happen if the move was performednoClientMove- if true, bypasses the client file rename. See main IServer moveFiles comments for restrictions.fileType- if not null, the file is reopened as that filetype.toFile- the target file.- Returns:
- list of IFileSpec objects representing the results of this move
- Throws:
ConnectionException- if the Perforce server is unreachable or is not connected.RequestException- if the Perforce server encounters an error during its processing of the requestAccessException- if the Perforce server denies access to the caller
-
move
Description copied from interface:IFileSpecMove this file if it's already opened for edit or add (the fromFile) to the destination file (the toFile). A file can be moved many times before it is submitted; moving it back to its original location will reopen it for edit. The full semantics of this operation (which can be confusing) are found in the main 'p4 help' documentation.Note that the status of this file once the move has been performed may be indeterminate; you should discard this file and use the file returned, if any, or at least test this file's status.
Note that this operation is not supported on servers earlier than 2009.1; any attempt to use this on earlier servers will result in a RequestException with a suitable message. Similarly, not all underlying IServer implementations will work with this either, and will also result in a suitable RequestException.
- Specified by:
movein interfaceIFileSpec- Parameters:
toFile- the target file.opts- GetFileContents object describing optional parameters; if null, no options are set.- Returns:
- list of IFileSpec objects representing the results of this move.
- Throws:
P4JavaException- if any error occurs in the processing of this method.
-
getStartRevision
public int getStartRevision()- Specified by:
getStartRevisionin interfaceIFileSpec- Returns:
- the start revision for this file spec, if any. Returns NO_FILE_REVISION if the revision hasn't been set or is unknown.
-
getStatusMessage
Description copied from interface:IFileOperationResultReturn the status message associated with the operation (this may be an error or informational message, depending on the operation). Will only be meaningful if the associated op status returned by getOpStatus() is neither UNKNOWN nor VALID.- Specified by:
getStatusMessagein interfaceIFileOperationResult- Returns:
- possibly-null Perforce operation message.
-
getSeverityCode
public int getSeverityCode()Description copied from interface:IFileOperationResultGet the Perforce severity code associated with the operation result. Will only be meaningful if the associated op status returned by getOpStatus() is neither UNKNOWN nor VALID.- Specified by:
getSeverityCodein interfaceIFileOperationResult- Returns:
- integer severity code.
-
getGenericCode
public int getGenericCode()Description copied from interface:IFileOperationResultGet the Perforce generic code associated with the operation result. Will only be meaningful if the associated op status returned by getOpStatus() is neither UNKNOWN nor VALID.- Specified by:
getGenericCodein interfaceIFileOperationResult- Returns:
- integer generic code.
-
getUserName
- Specified by:
getUserNamein interfaceIFileSpec- Returns:
- the Perforce user name of the file's owner, or null if this is not set or known.
-
isLocked
public boolean isLocked() -
getDiffStatus
Description copied from interface:IFileSpecGet the diff status for this file spec.- Specified by:
getDiffStatusin interfaceIFileSpec- Returns:
- diff status
-
getResolveType
- Specified by:
getResolveTypein interfaceIFileSpec- Returns:
- the resolve type for this file spec.
-
getContentResolveType
- Specified by:
getContentResolveTypein interfaceIFileSpec- Returns:
- the content resolve type for this file spec.
-
getShelvedChange
public int getShelvedChange()- Specified by:
getShelvedChangein interfaceIFileSpec- Returns:
- the shelved change for this file spec.
-
setOpStatus
-
setStatusMessage
-
setOriginalPath
-
setDepotPath
-
setClientPath
-
setLocalPath
-
setFileType
Description copied from interface:IFileSpecSet the file type for this file spec.- Specified by:
setFileTypein interfaceIFileSpec- Parameters:
fileType- type
-
setStartRevision
public void setStartRevision(int startRevision) Description copied from interface:IFileSpecSet the start revision for this file spec.- Specified by:
setStartRevisionin interfaceIFileSpec- Parameters:
startRevision- revision
-
setEndRevision
public void setEndRevision(int endRevision) Description copied from interface:IFileSpecSet the end revision for this file spec.- Specified by:
setEndRevisionin interfaceIFileSpec- Parameters:
endRevision- revision
-
setChangelistId
public void setChangelistId(int changeListId) Description copied from interface:IFileSpecSet the changelist ID for this file spec.- Specified by:
setChangelistIdin interfaceIFileSpec- Parameters:
changeListId- change
-
setLabel
Description copied from interface:IFileSpecSet the label associated with this file spec. -
setAction
Description copied from interface:IFileSpecSet the file action for this file spec. -
setUserName
Description copied from interface:IFileSpecSet the Perforce user name for this file spec.- Specified by:
setUserNamein interfaceIFileSpec- Parameters:
userName- userName
-
setClientName
Description copied from interface:IFileSpecSet the Perforce client name for this file spec.- Specified by:
setClientNamein interfaceIFileSpec- Parameters:
clientName- clientName
-
setClient
-
getEndFromRev
public int getEndFromRev()- Specified by:
getEndFromRevin interfaceIFileSpec- Returns:
- the end "from" revision of the last integration, if any.
-
getEndToRev
public int getEndToRev()- Specified by:
getEndToRevin interfaceIFileSpec- Returns:
- the end "from" revision of the last integration, if any.
-
getFromFile
- Specified by:
getFromFilein interfaceIFileSpec- Returns:
- the file this file spec was integrated from if any. Returns null if no such file.
-
getHowResolved
- Specified by:
getHowResolvedin interfaceIFileSpec- Returns:
- a string representation of how the last resolve happened. Returns null if unknown or not relevant.
-
getOtherAction
- Specified by:
getOtherActionin interfaceIFileSpec- Returns:
- the other action. Returns null if no such action.
-
getStartFromRev
public int getStartFromRev()- Specified by:
getStartFromRevin interfaceIFileSpec- Returns:
- the start "from" revision of the last integration, if any.
-
getStartToRev
public int getStartToRev()- Specified by:
getStartToRevin interfaceIFileSpec- Returns:
- the start "to" revision of the last integration, if any.
-
getToFile
-
getWorkRev
public int getWorkRev()- Specified by:
getWorkRevin interfaceIFileSpec- Returns:
- the work revision.
-
isUnmap
public boolean isUnmap() -
setDate
Description copied from interface:IFileSpecSet the date for this file spec. -
setFromFile
Description copied from interface:IFileSpecSet the from file for this file spec.- Specified by:
setFromFilein interfaceIFileSpec- Parameters:
fromFile- pathStr
-
setEndFromRev
public void setEndFromRev(int endFromRev) Description copied from interface:IFileSpecSet the end from revision for this file spec.- Specified by:
setEndFromRevin interfaceIFileSpec- Parameters:
endFromRev- rev
-
setStartFromRev
public void setStartFromRev(int startFromRev) Description copied from interface:IFileSpecSet the end from revision for this file spec.- Specified by:
setStartFromRevin interfaceIFileSpec- Parameters:
startFromRev- rev
-
setToFile
Description copied from interface:IFileSpecSet the to file for this file spec. -
setEndToRev
public void setEndToRev(int endToRev) Description copied from interface:IFileSpecSet the end to revision for this file spec.- Specified by:
setEndToRevin interfaceIFileSpec- Parameters:
endToRev- rev
-
setStartToRev
public void setStartToRev(int startToRev) Description copied from interface:IFileSpecSet the start to revision for this file spec.- Specified by:
setStartToRevin interfaceIFileSpec- Parameters:
startToRev- rev
-
setWorkRev
public void setWorkRev(int workRev) Description copied from interface:IFileSpecSet the work revision for this file spec.- Specified by:
setWorkRevin interfaceIFileSpec- Parameters:
workRev- rev
-
setHowResolved
Description copied from interface:IFileSpecSet the "how resolved" string for this file spec.- Specified by:
setHowResolvedin interfaceIFileSpec- Parameters:
howResolved- howStr
-
setOtherAction
Description copied from interface:IFileSpecSet the other action for this file spec.- Specified by:
setOtherActionin interfaceIFileSpec- Parameters:
otherAction- action
-
setLocked
public void setLocked(boolean locked) Description copied from interface:IFileSpecSet the locked status for this file spec. -
setDiffStatus
Description copied from interface:IFileSpecSet the diff status for this file spec.- Specified by:
setDiffStatusin interfaceIFileSpec- Parameters:
diffStatus- status
-
setResolveType
Description copied from interface:IFileSpecSet the resolve type for this file spec.- Specified by:
setResolveTypein interfaceIFileSpec- Parameters:
resolveType- resolve type
-
setContentResolveType
Description copied from interface:IFileSpecSet the content resolve type for this file spec.- Specified by:
setContentResolveTypein interfaceIFileSpec- Parameters:
contentResolveType- contentResolveType
-
setShelvedChange
public void setShelvedChange(int shelvedChange) Description copied from interface:IFileSpecSet the shelved change for this file spec.- Specified by:
setShelvedChangein interfaceIFileSpec- Parameters:
shelvedChange- shelvedChange
-
setUnmap
public void setUnmap(boolean unmap) Description copied from interface:IFileSpecSet the unmap status value for this file spec. -
setRepoName
- Specified by:
setRepoNamein interfaceIFileSpec
-
setSha
-
setBranch
-
getBlobSha
- Specified by:
getBlobShain interfaceIFileSpec
-
setBlobSha
- Specified by:
setBlobShain interfaceIFileSpec
-
getCommitSha
- Specified by:
getCommitShain interfaceIFileSpec
-
setCommitSha
- Specified by:
setCommitShain interfaceIFileSpec
-
getTreeSha
- Specified by:
getTreeShain interfaceIFileSpec
-
setTreeSha
- Specified by:
setTreeShain interfaceIFileSpec
-
getRevFromString
-
getClientPathString
Description copied from interface:IFileSpecConvenience method for getPathString(CLIENT).- Specified by:
getClientPathStringin interfaceIFileSpec- Returns:
- client path
-
getDepotPathString
Description copied from interface:IFileSpecConvenience method for getPathString(DEPOT).- Specified by:
getDepotPathStringin interfaceIFileSpec- Returns:
- depot path
-
getLocalPathString
Description copied from interface:IFileSpecConvenience method for getPathString(LOCAL).- Specified by:
getLocalPathStringin interfaceIFileSpec- Returns:
- local path
-
getOriginalPath
Description copied from interface:IFileSpecConvenience method for getPath(ORIGINAL).- Specified by:
getOriginalPathin interfaceIFileSpec- Returns:
- path
-
getOriginalPathString
Description copied from interface:IFileSpecConvenience method for getPathString(ORIGINAL).- Specified by:
getOriginalPathStringin interfaceIFileSpec- Returns:
- path
-
getPathString
Description copied from interface:IFileSpecGet the unannotated path string for this Perforce file.- Specified by:
getPathStringin interfaceIFileSpec- Parameters:
pathType- if null or PathType.ORIGINAL, return the original path for this file spec, otherwise return the specified path for this file spec.- Returns:
- possibly-null non-annotated Perforce file path string representation.
-
getAnnotatedPathString
Description copied from interface:IFileSpecGet an annotated string representation of a Perforce file path associated with this Perforce file spec. "Annotated" in this context means any known Perforce version / changelist (etc.) information is appended in standard Perforce format to the end of the returned string.- Specified by:
getAnnotatedPathStringin interfaceIFileSpec- Parameters:
pathType- if null or PathType.ORIGINAL, return the original path for this file spec, otherwise return the specified path for this file spec.- Returns:
- possibly-null annotated Perforce file path string representation.
-
getPreferredPathString
Description copied from interface:IFileSpecGet the (unannotated) "preferred" path string for this file spec. A file spec's preferred path is defined to be the path specified by (in order) the original path, the depot path, the client path, or the local path.- Specified by:
getPreferredPathStringin interfaceIFileSpec- Returns:
- possibly-null annotated preferred path string.
-
getAnnotatedPreferredPathString
Description copied from interface:IFileSpecGet the annotated "preferred" path string for this file spec. A file spec's preferred path is defined to be the path specified by (in order) the original path, the depot path, the client path, or the local path. This method appends any relevant revision / changelist (etc.) information to the path string if it exists.- Specified by:
getAnnotatedPreferredPathStringin interfaceIFileSpec- Returns:
- possibly-null annotated preferred path string.
-
toString
Description copied from interface:IFileSpecUseful alias for getPreferredPathString(). -
setPathFromString
Description copied from interface:IFileSpecSet a specific Perforce file path for this file spec from a passed-in string. Any file revision / changelist (etc.) information appended to the pathStr parameter is stripped off before the path is set.- Specified by:
setPathFromStringin interfaceIFileSpec- Parameters:
pathType- if null or PathType.ORIGINAL, sets the original path for this file spec, otherwise sets the specified path for this file spec.pathStr- possibly-null, possibly-annotated path string
-
getDate
Description copied from interface:IFileSpecGet the Perforce date of this file spec. Returns null if no date has been set. -
setClientPath
Description copied from interface:IFileSpecConvenience method for setPath(new FilePath(PathType.CLIENT, pathStr));- Specified by:
setClientPathin interfaceIFileSpec- Parameters:
pathStr- path
-
setDepotPath
Description copied from interface:IFileSpecConvenience method for setPath(new FilePath(PathType.DEPOT, pathStr));- Specified by:
setDepotPathin interfaceIFileSpec- Parameters:
pathStr- path
-
setLocalPath
Description copied from interface:IFileSpecConvenience method for setPath(new FilePath(PathType.LOCAL, pathStr));- Specified by:
setLocalPathin interfaceIFileSpec- Parameters:
pathStr- path
-
setOriginalPath
Description copied from interface:IFileSpecConvenience method for setPath(new FilePath(PathType.ORIGINAL, pathStr));- Specified by:
setOriginalPathin interfaceIFileSpec- Parameters:
pathStr- path
-
getBaseRev
public int getBaseRev()- Specified by:
getBaseRevin interfaceIFileSpec- Returns:
- the base revision as reported by integ -o or equivalent. This may be NO_FILE_REVISION if no base revision exists.
-
setBaseRev
public void setBaseRev(int baseRev) Description copied from interface:IFileSpecSet the base revision on this object. Makes no sense for general users to call this.- Specified by:
setBaseRevin interfaceIFileSpec- Parameters:
baseRev- rev
-
getBaseName
- Specified by:
getBaseNamein interfaceIFileSpec- Returns:
- the base name as reported by integ -o or equivalent. This may be null if no base name exists.
-
setBaseName
Description copied from interface:IFileSpecSet the base name on this object. Makes no sense for general users to call this.- Specified by:
setBaseNamein interfaceIFileSpec- Parameters:
baseName- basename
-
getBaseFile
- Specified by:
getBaseFilein interfaceIFileSpec- Returns:
- the base file as reported by resolve -o or equivalent. This may be null if no base file exists.
-
setBaseFile
Description copied from interface:IFileSpecSet the base file on this object. Makes no sense for general users to call this.- Specified by:
setBaseFilein interfaceIFileSpec- Parameters:
baseFile- basefile
-
getRawCode
public int getRawCode()Description copied from interface:IFileOperationResultGet the Perforce raw code associated with the operation result. Will only be meaningful if the associated op status returned by getOpStatus() is neither UNKNOWN nor VALID, and the status was set as the result of a server-side issue.- Specified by:
getRawCodein interfaceIFileOperationResult- Returns:
- raw code
-
getUniqueCode
public int getUniqueCode()Description copied from interface:IFileOperationResultGet the Perforce 'unqieu' code associated with the operation result. Will only be meaningful if the associated op status returned by getOpStatus() is neither UNKNOWN nor VALID, and the status was set as the result of a server-side issue.- Specified by:
getUniqueCodein interfaceIFileOperationResult- Returns:
- 'unqieu' code
-
getSubCode
public int getSubCode()Description copied from interface:IFileOperationResultGet the Perforce 'sub' code associated with the operation result. Will only be meaningful if the associated op status returned by getOpStatus() is neither UNKNOWN nor VALID, and the status was set as the result of a server-side issue.- Specified by:
getSubCodein interfaceIFileOperationResult- Returns:
- 'sub' code
-
getSubSystem
public int getSubSystem()Description copied from interface:IFileOperationResultGet the Perforce sub system code associated with the operation result. Will only be meaningful if the associated op status returned by getOpStatus() is neither UNKNOWN nor VALID, and the status was set as the result of a server-side issue.- Specified by:
getSubSystemin interfaceIFileOperationResult- Returns:
- sub system code
-
getRepoName
- Specified by:
getRepoNamein interfaceIFileSpec
-
getSha
-
getBranch
-
getResolveTypes
- Specified by:
getResolveTypesin interfaceIFileSpec
-
setResolveTypes
- Specified by:
setResolveTypesin interfaceIFileSpec
-