Class FileSpec

    • Field Detail

      • statusMessage

        protected java.lang.String 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

        protected FilePath originalPath
      • depotPath

        protected FilePath depotPath
      • clientPath

        protected FilePath clientPath
      • localPath

        protected FilePath localPath
      • fileType

        protected java.lang.String fileType
      • startRevision

        protected int startRevision
      • endRevision

        protected int endRevision
      • changeListId

        protected int changeListId
      • label

        protected java.lang.String label
      • date

        protected java.util.Date date
      • userName

        protected java.lang.String userName
      • clientName

        protected java.lang.String clientName
      • baseRev

        protected int baseRev
      • baseName

        protected java.lang.String baseName
      • baseFile

        protected java.lang.String baseFile
      • unmap

        protected boolean unmap
      • repoName

        protected java.lang.String repoName
      • sha

        protected java.lang.String sha
      • branch

        protected java.lang.String branch
      • blobSha

        protected java.lang.String blobSha
      • commitSha

        protected java.lang.String commitSha
      • treeSha

        protected java.lang.String treeSha
    • Constructor Detail

      • 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

        public FileSpec​(java.lang.String pathStr)
        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

        public FileSpec​(java.lang.String pathStr,
                        boolean parseAnnotations)
        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 string
        parseAnnotations - if true, attempt to parse the path string for revision annotations.
      • FileSpec

        public FileSpec​(FilePath path)
        Construct a FileSpec from a specific FilePath.
        Parameters:
        path - path
      • FileSpec

        public FileSpec​(FileSpecOpStatus status,
                        java.lang.String errStr)
        Construct a filespec from an opstatus and error message pair.
        Parameters:
        status - status
        errStr - errStr
      • FileSpec

        public FileSpec​(FileSpecOpStatus status,
                        java.lang.String errStr,
                        int genericCode,
                        int severityCode)
        Construct a FileSpec from an opstatus, error message, Perforce generic code, and Perforce severity code.
        Parameters:
        status - status
        errStr - errStr
        genericCode - genericCode
        severityCode - severityCode
      • FileSpec

        public FileSpec​(FileSpecOpStatus status,
                        java.lang.String errStr,
                        java.lang.String codeStr)
        Construct a new FileSpec given the op status, an error string, and a raw code string returned from a Perforce server.
        Parameters:
        status - status
        errStr - errStr
        codeStr - codeStr
      • FileSpec

        public FileSpec​(FileSpecOpStatus status,
                        java.lang.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.
        Parameters:
        status - status
        errStr - errStr
        rawCode - rawCode
      • FileSpec

        public FileSpec​(FileSpec impl)
        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

        public FileSpec​(@Nullable
                        java.util.Map<java.lang.String,​java.lang.Object> map,
                        @Nonnull
                        IServer server,
                        int index)
        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 - map
        server - server
        index - index
    • Method Detail

      • setCodes

        public FileSpec setCodes​(int rawCode)
        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

        public FilePath getPath​(@Nullable
                                FilePath.PathType pathType)
        Description copied from interface: IFileSpec
        Get 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.
        Specified by:
        getPath in interface IFileSpec
        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 file path
      • setPath

        public void setPath​(@Nullable
                            FilePath filePath)
        Description copied from interface: IFileSpec
        Set 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.
        Specified by:
        setPath in interface IFileSpec
        Parameters:
        filePath - candidate file path; may be null.
      • getAction

        public FileAction getAction()
        Specified by:
        getAction in interface IFileSpec
        Returns:
        the file action associated with this file, if any. Returns null if no such action has been set.
      • getChangelistId

        public int getChangelistId()
        Description copied from interface: IFileSpec
        Get the ID of the changelist associated with this file spec. Returns IChangelist.UNKNOWN if no changelist ID has been set.
        Specified by:
        getChangelistId in interface IFileSpec
        Returns:
        change
      • setSyncTime

        public void setSyncTime​(long syncTime)
        Specified by:
        setSyncTime in interface IFileSpec
      • getClientName

        public java.lang.String getClientName()
        Specified by:
        getClientName in interface IFileSpec
        Returns:
        the name of the client associated with this file spec, or null if not set or known.
      • getClientPath

        public FilePath getClientPath()
        Description copied from interface: IFileSpec
        Convenience method for getPath(CLIENT).
        Specified by:
        getClientPath in interface IFileSpec
        Returns:
        client path
      • getContents

        public java.io.InputStream getContents​(boolean noHeaderLine)
                                        throws ConnectionException,
                                               RequestException,
                                               AccessException
        Description copied from interface: IFileSpec
        Get 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:
        getContents in interface IFileSpec
        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 request
        AccessException - if the Perforce server denies access to the caller
      • getContents

        public java.io.InputStream getContents​(GetFileContentsOptions opts)
                                        throws P4JavaException
        Description copied from interface: IFileSpec
        Get 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:
        getContents in interface IFileSpec
        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

        public FilePath getDepotPath()
        Description copied from interface: IFileSpec
        Convenience method for getPath(DEPOT).
        Specified by:
        getDepotPath in interface IFileSpec
        Returns:
        depot path
      • getEndRevision

        public int getEndRevision()
        Description copied from interface: IFileSpec
        Get 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:
        getEndRevision in interface IFileSpec
        Returns:
        revision
      • getFileType

        public java.lang.String getFileType()
        Specified by:
        getFileType in interface IFileSpec
        Returns:
        the file type string for this file spec, or null if not known.
      • getLabel

        public java.lang.String getLabel()
        Specified by:
        getLabel in interface IFileSpec
        Returns:
        the label string associated with this file spec, if any. Returns null if no such label string has been set.
      • getLocalPath

        public FilePath getLocalPath()
        Description copied from interface: IFileSpec
        Convenience method for getPath(LOCAL).
        Specified by:
        getLocalPath in interface IFileSpec
        Returns:
        local path
      • getOpStatus

        public FileSpecOpStatus getOpStatus()
        Description copied from interface: IFileOperationResult
        Return the particular Perforce operation status associated with the specific Perforce file spec operation.
        Specified by:
        getOpStatus in interface IFileOperationResult
        Returns:
        non-null FileSpecOpStatus for the specific file spec return.
      • getPreferredPath

        public FilePath getPreferredPath()
        Description copied from interface: IFileSpec
        Get 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:
        getPreferredPath in interface IFileSpec
        Returns:
        possibly-null preferred path
      • getRevisionHistory

        public java.util.Map<IFileSpec,​java.util.List<IFileRevisionData>> getRevisionHistory​(int maxRevs,
                                                                                                   boolean contentHistory,
                                                                                                   boolean includeInherited,
                                                                                                   boolean longOutput,
                                                                                                   boolean truncatedLongOutput)
                                                                                            throws ConnectionException,
                                                                                                   RequestException,
                                                                                                   AccessException
        Description copied from interface: IFileSpec
        Get 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:
        getRevisionHistory in interface IFileSpec
        Parameters:
        maxRevs - if positive, return at most maxRev revisions for this file.
        contentHistory - if true, return the content history
        includeInherited - if true, causes inherited file history to be returned as well.
        longOutput - if true, return the full descriptions associated with each revision
        truncatedLongOutput - 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 request
        AccessException - if the Perforce server denies access to the caller
      • getRevisionHistory

        public java.util.Map<IFileSpec,​java.util.List<IFileRevisionData>> getRevisionHistory​(GetRevisionHistoryOptions opts)
                                                                                            throws P4JavaException
        Description copied from interface: IFileSpec
        Get 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:
        getRevisionHistory in interface IFileSpec
        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 java.util.List<IFileAnnotation> getAnnotations​(DiffType wsOptions,
                                                              boolean allResults,
                                                              boolean useChangeNumbers,
                                                              boolean followBranches)
                                                       throws ConnectionException,
                                                              RequestException,
                                                              AccessException
        Description copied from interface: IFileSpec
        Get the file annotations associated with this file.
        Specified by:
        getAnnotations in interface IFileSpec
        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 revision
        useChangeNumbers - if true, annotate with change numbers rather than revision numbers with each line
        followBranches - 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 request
        AccessException - if the Perforce server denies access to the caller
      • getAnnotations

        public java.util.List<IFileAnnotation> getAnnotations​(GetFileAnnotationsOptions opts)
                                                       throws P4JavaException
        Description copied from interface: IFileSpec
        Get the file annotations associated with this file.
        Specified by:
        getAnnotations in interface IFileSpec
        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 java.util.List<IFileSpec> move​(int changelistId,
                                              boolean listOnly,
                                              boolean noClientMove,
                                              java.lang.String fileType,
                                              IFileSpec toFile)
                                       throws ConnectionException,
                                              RequestException,
                                              AccessException
        Description copied from interface: IFileSpec
        Move 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:
        move in interface IFileSpec
        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 performed
        noClientMove - 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 request
        AccessException - if the Perforce server denies access to the caller
      • move

        public java.util.List<IFileSpec> move​(IFileSpec toFile,
                                              MoveFileOptions opts)
                                       throws P4JavaException
        Description copied from interface: IFileSpec
        Move 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:
        move in interface IFileSpec
        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:
        getStartRevision in interface IFileSpec
        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

        public java.lang.String getStatusMessage()
        Description copied from interface: IFileOperationResult
        Return 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:
        getStatusMessage in interface IFileOperationResult
        Returns:
        possibly-null Perforce operation message.
      • getSeverityCode

        public int getSeverityCode()
        Description copied from interface: IFileOperationResult
        Get 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:
        getSeverityCode in interface IFileOperationResult
        Returns:
        integer severity code.
      • getGenericCode

        public int getGenericCode()
        Description copied from interface: IFileOperationResult
        Get 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:
        getGenericCode in interface IFileOperationResult
        Returns:
        integer generic code.
      • getUserName

        public java.lang.String getUserName()
        Specified by:
        getUserName in interface IFileSpec
        Returns:
        the Perforce user name of the file's owner, or null if this is not set or known.
      • isLocked

        public boolean isLocked()
        Specified by:
        isLocked in interface IFileSpec
        Returns:
        true if the associated file has been locked.
      • getDiffStatus

        public java.lang.String getDiffStatus()
        Description copied from interface: IFileSpec
        Get the diff status for this file spec.
        Specified by:
        getDiffStatus in interface IFileSpec
        Returns:
        diff status
      • getResolveType

        public java.lang.String getResolveType()
        Specified by:
        getResolveType in interface IFileSpec
        Returns:
        the resolve type for this file spec.
      • getContentResolveType

        public java.lang.String getContentResolveType()
        Specified by:
        getContentResolveType in interface IFileSpec
        Returns:
        the content resolve type for this file spec.
      • getShelvedChange

        public int getShelvedChange()
        Specified by:
        getShelvedChange in interface IFileSpec
        Returns:
        the shelved change for this file spec.
      • setStatusMessage

        public void setStatusMessage​(java.lang.String statusMessage)
      • setOriginalPath

        public void setOriginalPath​(FilePath path)
      • setDepotPath

        public void setDepotPath​(FilePath depotPath)
      • setClientPath

        public void setClientPath​(FilePath clientPath)
      • setLocalPath

        public void setLocalPath​(FilePath localPath)
      • setFileType

        public void setFileType​(java.lang.String fileType)
        Description copied from interface: IFileSpec
        Set the file type for this file spec.
        Specified by:
        setFileType in interface IFileSpec
        Parameters:
        fileType - type
      • setStartRevision

        public void setStartRevision​(int startRevision)
        Description copied from interface: IFileSpec
        Set the start revision for this file spec.
        Specified by:
        setStartRevision in interface IFileSpec
        Parameters:
        startRevision - revision
      • setEndRevision

        public void setEndRevision​(int endRevision)
        Description copied from interface: IFileSpec
        Set the end revision for this file spec.
        Specified by:
        setEndRevision in interface IFileSpec
        Parameters:
        endRevision - revision
      • setChangelistId

        public void setChangelistId​(int changeListId)
        Description copied from interface: IFileSpec
        Set the changelist ID for this file spec.
        Specified by:
        setChangelistId in interface IFileSpec
        Parameters:
        changeListId - change
      • setLabel

        public void setLabel​(java.lang.String label)
        Description copied from interface: IFileSpec
        Set the label associated with this file spec.
        Specified by:
        setLabel in interface IFileSpec
        Parameters:
        label - label
      • setAction

        public void setAction​(FileAction action)
        Description copied from interface: IFileSpec
        Set the file action for this file spec.
        Specified by:
        setAction in interface IFileSpec
        Parameters:
        action - action
      • setUserName

        public void setUserName​(java.lang.String userName)
        Description copied from interface: IFileSpec
        Set the Perforce user name for this file spec.
        Specified by:
        setUserName in interface IFileSpec
        Parameters:
        userName - userName
      • setClientName

        public void setClientName​(java.lang.String clientName)
        Description copied from interface: IFileSpec
        Set the Perforce client name for this file spec.
        Specified by:
        setClientName in interface IFileSpec
        Parameters:
        clientName - clientName
      • setClient

        public void setClient​(IClient client)
      • getEndFromRev

        public int getEndFromRev()
        Specified by:
        getEndFromRev in interface IFileSpec
        Returns:
        the end "from" revision of the last integration, if any.
      • getEndToRev

        public int getEndToRev()
        Specified by:
        getEndToRev in interface IFileSpec
        Returns:
        the end "from" revision of the last integration, if any.
      • getFromFile

        public java.lang.String getFromFile()
        Specified by:
        getFromFile in interface IFileSpec
        Returns:
        the file this file spec was integrated from if any. Returns null if no such file.
      • getHowResolved

        public java.lang.String getHowResolved()
        Specified by:
        getHowResolved in interface IFileSpec
        Returns:
        a string representation of how the last resolve happened. Returns null if unknown or not relevant.
      • getOtherAction

        public FileAction getOtherAction()
        Specified by:
        getOtherAction in interface IFileSpec
        Returns:
        the other action. Returns null if no such action.
      • getStartFromRev

        public int getStartFromRev()
        Specified by:
        getStartFromRev in interface IFileSpec
        Returns:
        the start "from" revision of the last integration, if any.
      • getStartToRev

        public int getStartToRev()
        Specified by:
        getStartToRev in interface IFileSpec
        Returns:
        the start "to" revision of the last integration, if any.
      • getToFile

        public java.lang.String getToFile()
        Specified by:
        getToFile in interface IFileSpec
        Returns:
        the "to" file for the integration, if it exists. Returns null otherwise.
      • getWorkRev

        public int getWorkRev()
        Specified by:
        getWorkRev in interface IFileSpec
        Returns:
        the work revision.
      • isUnmap

        public boolean isUnmap()
        Specified by:
        isUnmap in interface IFileSpec
        Returns:
        if this file spec is not mapped.
      • setDate

        public void setDate​(java.util.Date date)
        Description copied from interface: IFileSpec
        Set the date for this file spec.
        Specified by:
        setDate in interface IFileSpec
        Parameters:
        date - date
      • setFromFile

        public void setFromFile​(java.lang.String fromFile)
        Description copied from interface: IFileSpec
        Set the from file for this file spec.
        Specified by:
        setFromFile in interface IFileSpec
        Parameters:
        fromFile - pathStr
      • setEndFromRev

        public void setEndFromRev​(int endFromRev)
        Description copied from interface: IFileSpec
        Set the end from revision for this file spec.
        Specified by:
        setEndFromRev in interface IFileSpec
        Parameters:
        endFromRev - rev
      • setStartFromRev

        public void setStartFromRev​(int startFromRev)
        Description copied from interface: IFileSpec
        Set the end from revision for this file spec.
        Specified by:
        setStartFromRev in interface IFileSpec
        Parameters:
        startFromRev - rev
      • setToFile

        public void setToFile​(java.lang.String toFile)
        Description copied from interface: IFileSpec
        Set the to file for this file spec.
        Specified by:
        setToFile in interface IFileSpec
        Parameters:
        toFile - pathStr
      • setEndToRev

        public void setEndToRev​(int endToRev)
        Description copied from interface: IFileSpec
        Set the end to revision for this file spec.
        Specified by:
        setEndToRev in interface IFileSpec
        Parameters:
        endToRev - rev
      • setStartToRev

        public void setStartToRev​(int startToRev)
        Description copied from interface: IFileSpec
        Set the start to revision for this file spec.
        Specified by:
        setStartToRev in interface IFileSpec
        Parameters:
        startToRev - rev
      • setWorkRev

        public void setWorkRev​(int workRev)
        Description copied from interface: IFileSpec
        Set the work revision for this file spec.
        Specified by:
        setWorkRev in interface IFileSpec
        Parameters:
        workRev - rev
      • setHowResolved

        public void setHowResolved​(java.lang.String howResolved)
        Description copied from interface: IFileSpec
        Set the "how resolved" string for this file spec.
        Specified by:
        setHowResolved in interface IFileSpec
        Parameters:
        howResolved - howStr
      • setOtherAction

        public void setOtherAction​(FileAction otherAction)
        Description copied from interface: IFileSpec
        Set the other action for this file spec.
        Specified by:
        setOtherAction in interface IFileSpec
        Parameters:
        otherAction - action
      • setLocked

        public void setLocked​(boolean locked)
        Description copied from interface: IFileSpec
        Set the locked status for this file spec.
        Specified by:
        setLocked in interface IFileSpec
        Parameters:
        locked - locked
      • setDiffStatus

        public void setDiffStatus​(java.lang.String diffStatus)
        Description copied from interface: IFileSpec
        Set the diff status for this file spec.
        Specified by:
        setDiffStatus in interface IFileSpec
        Parameters:
        diffStatus - status
      • setResolveType

        public void setResolveType​(java.lang.String resolveType)
        Description copied from interface: IFileSpec
        Set the resolve type for this file spec.
        Specified by:
        setResolveType in interface IFileSpec
        Parameters:
        resolveType - resolve type
      • setContentResolveType

        public void setContentResolveType​(java.lang.String contentResolveType)
        Description copied from interface: IFileSpec
        Set the content resolve type for this file spec.
        Specified by:
        setContentResolveType in interface IFileSpec
        Parameters:
        contentResolveType - contentResolveType
      • setShelvedChange

        public void setShelvedChange​(int shelvedChange)
        Description copied from interface: IFileSpec
        Set the shelved change for this file spec.
        Specified by:
        setShelvedChange in interface IFileSpec
        Parameters:
        shelvedChange - shelvedChange
      • setUnmap

        public void setUnmap​(boolean unmap)
        Description copied from interface: IFileSpec
        Set the unmap status value for this file spec.
        Specified by:
        setUnmap in interface IFileSpec
        Parameters:
        unmap - unmap
      • setRepoName

        public void setRepoName​(java.lang.String repoName)
        Specified by:
        setRepoName in interface IFileSpec
      • setSha

        public void setSha​(java.lang.String sha)
        Specified by:
        setSha in interface IFileSpec
      • setBranch

        public void setBranch​(java.lang.String branch)
        Specified by:
        setBranch in interface IFileSpec
      • getBlobSha

        public java.lang.String getBlobSha()
        Specified by:
        getBlobSha in interface IFileSpec
      • setBlobSha

        public void setBlobSha​(java.lang.String sha)
        Specified by:
        setBlobSha in interface IFileSpec
      • getCommitSha

        public java.lang.String getCommitSha()
        Specified by:
        getCommitSha in interface IFileSpec
      • setCommitSha

        public void setCommitSha​(java.lang.String sha)
        Specified by:
        setCommitSha in interface IFileSpec
      • getTreeSha

        public java.lang.String getTreeSha()
        Specified by:
        getTreeSha in interface IFileSpec
      • setTreeSha

        public void setTreeSha​(java.lang.String sha)
        Specified by:
        setTreeSha in interface IFileSpec
      • getRevFromString

        public static int getRevFromString​(java.lang.String str)
      • getClientPathString

        public java.lang.String getClientPathString()
        Description copied from interface: IFileSpec
        Convenience method for getPathString(CLIENT).
        Specified by:
        getClientPathString in interface IFileSpec
        Returns:
        client path
      • getDepotPathString

        public java.lang.String getDepotPathString()
        Description copied from interface: IFileSpec
        Convenience method for getPathString(DEPOT).
        Specified by:
        getDepotPathString in interface IFileSpec
        Returns:
        depot path
      • getLocalPathString

        public java.lang.String getLocalPathString()
        Description copied from interface: IFileSpec
        Convenience method for getPathString(LOCAL).
        Specified by:
        getLocalPathString in interface IFileSpec
        Returns:
        local path
      • getOriginalPath

        public FilePath getOriginalPath()
        Description copied from interface: IFileSpec
        Convenience method for getPath(ORIGINAL).
        Specified by:
        getOriginalPath in interface IFileSpec
        Returns:
        path
      • getOriginalPathString

        public java.lang.String getOriginalPathString()
        Description copied from interface: IFileSpec
        Convenience method for getPathString(ORIGINAL).
        Specified by:
        getOriginalPathString in interface IFileSpec
        Returns:
        path
      • getPathString

        public java.lang.String getPathString​(FilePath.PathType pathType)
        Description copied from interface: IFileSpec
        Get the unannotated path string for this Perforce file.
        Specified by:
        getPathString in interface IFileSpec
        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

        public java.lang.String getAnnotatedPathString​(FilePath.PathType pathType)
        Description copied from interface: IFileSpec
        Get 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:
        getAnnotatedPathString in interface IFileSpec
        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

        public java.lang.String getPreferredPathString()
        Description copied from interface: IFileSpec
        Get 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:
        getPreferredPathString in interface IFileSpec
        Returns:
        possibly-null annotated preferred path string.
      • getAnnotatedPreferredPathString

        public java.lang.String getAnnotatedPreferredPathString()
        Description copied from interface: IFileSpec
        Get 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:
        getAnnotatedPreferredPathString in interface IFileSpec
        Returns:
        possibly-null annotated preferred path string.
      • toString

        public java.lang.String toString()
        Description copied from interface: IFileSpec
        Useful alias for getPreferredPathString().
        Specified by:
        toString in interface IFileSpec
        Overrides:
        toString in class java.lang.Object
      • setPathFromString

        public void setPathFromString​(FilePath.PathType pathType,
                                      java.lang.String pathStr)
        Description copied from interface: IFileSpec
        Set 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:
        setPathFromString in interface IFileSpec
        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

        public java.util.Date getDate()
        Description copied from interface: IFileSpec
        Get the Perforce date of this file spec. Returns null if no date has been set.
        Specified by:
        getDate in interface IFileSpec
        Returns:
        date
      • setClientPath

        public void setClientPath​(java.lang.String pathStr)
        Description copied from interface: IFileSpec
        Convenience method for setPath(new FilePath(PathType.CLIENT, pathStr));
        Specified by:
        setClientPath in interface IFileSpec
        Parameters:
        pathStr - path
      • setDepotPath

        public void setDepotPath​(java.lang.String pathStr)
        Description copied from interface: IFileSpec
        Convenience method for setPath(new FilePath(PathType.DEPOT, pathStr));
        Specified by:
        setDepotPath in interface IFileSpec
        Parameters:
        pathStr - path
      • setLocalPath

        public void setLocalPath​(java.lang.String pathStr)
        Description copied from interface: IFileSpec
        Convenience method for setPath(new FilePath(PathType.LOCAL, pathStr));
        Specified by:
        setLocalPath in interface IFileSpec
        Parameters:
        pathStr - path
      • setOriginalPath

        public void setOriginalPath​(java.lang.String pathStr)
        Description copied from interface: IFileSpec
        Convenience method for setPath(new FilePath(PathType.ORIGINAL, pathStr));
        Specified by:
        setOriginalPath in interface IFileSpec
        Parameters:
        pathStr - path
      • getBaseRev

        public int getBaseRev()
        Specified by:
        getBaseRev in interface IFileSpec
        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: IFileSpec
        Set the base revision on this object. Makes no sense for general users to call this.
        Specified by:
        setBaseRev in interface IFileSpec
        Parameters:
        baseRev - rev
      • getBaseName

        public java.lang.String getBaseName()
        Specified by:
        getBaseName in interface IFileSpec
        Returns:
        the base name as reported by integ -o or equivalent. This may be null if no base name exists.
      • setBaseName

        public void setBaseName​(java.lang.String baseName)
        Description copied from interface: IFileSpec
        Set the base name on this object. Makes no sense for general users to call this.
        Specified by:
        setBaseName in interface IFileSpec
        Parameters:
        baseName - basename
      • getBaseFile

        public java.lang.String getBaseFile()
        Specified by:
        getBaseFile in interface IFileSpec
        Returns:
        the base file as reported by resolve -o or equivalent. This may be null if no base file exists.
      • setBaseFile

        public void setBaseFile​(java.lang.String baseFile)
        Description copied from interface: IFileSpec
        Set the base file on this object. Makes no sense for general users to call this.
        Specified by:
        setBaseFile in interface IFileSpec
        Parameters:
        baseFile - basefile
      • getRawCode

        public int getRawCode()
        Description copied from interface: IFileOperationResult
        Get 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:
        getRawCode in interface IFileOperationResult
        Returns:
        raw code
      • getUniqueCode

        public int getUniqueCode()
        Description copied from interface: IFileOperationResult
        Get 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:
        getUniqueCode in interface IFileOperationResult
        Returns:
        'unqieu' code
      • getSubCode

        public int getSubCode()
        Description copied from interface: IFileOperationResult
        Get 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:
        getSubCode in interface IFileOperationResult
        Returns:
        'sub' code
      • getSubSystem

        public int getSubSystem()
        Description copied from interface: IFileOperationResult
        Get 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:
        getSubSystem in interface IFileOperationResult
        Returns:
        sub system code
      • getRepoName

        public java.lang.String getRepoName()
        Specified by:
        getRepoName in interface IFileSpec
      • getSha

        public java.lang.String getSha()
        Specified by:
        getSha in interface IFileSpec
      • getBranch

        public java.lang.String getBranch()
        Specified by:
        getBranch in interface IFileSpec
      • getResolveTypes

        public java.util.List<java.lang.String> getResolveTypes()
        Specified by:
        getResolveTypes in interface IFileSpec
      • setResolveTypes

        public void setResolveTypes​(java.util.List<java.lang.String> types)
        Specified by:
        setResolveTypes in interface IFileSpec