com.perforce.p4java.impl.generic.core.file
Class ExtendedFileSpec

java.lang.Object
  extended by com.perforce.p4java.impl.generic.core.ServerResource
      extended by com.perforce.p4java.impl.generic.core.file.FileSpec
          extended by com.perforce.p4java.impl.generic.core.file.ExtendedFileSpec
All Implemented Interfaces:
IExtendedFileSpec, IFileOperationResult, IFileSpec, IServerResource

public class ExtendedFileSpec
extends FileSpec
implements IExtendedFileSpec

Useful generic implementation class for the IExtendedFileSpec interface. Fields below generally correspond exactly with the similarly-named Perforce fstat call fields, and will not be documented in detail here.


Field Summary
 
Fields inherited from class com.perforce.p4java.impl.generic.core.file.FileSpec
action, baseFile, baseName, baseRev, changeListId, client, clientName, clientPath, date, depotPath, endRevision, fileType, genericCode, label, localPath, opStatus, originalPath, rawCode, severityCode, startRevision, statusMessage, subCode, subSystem, uniqueCode, unmap, userName
 
Fields inherited from class com.perforce.p4java.impl.generic.core.ServerResource
refreshable, server, updateable
 
Fields 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
ExtendedFileSpec()
          Default constructor.
ExtendedFileSpec(FileSpecOpStatus status, String errStr)
          Construct an ExtendedFileSpec object from a status, message string pair.
ExtendedFileSpec(FileSpecOpStatus status, String errStr, int rawCode)
           
ExtendedFileSpec(FileSpecOpStatus status, String errStr, int genericCode, int severityCode)
          Construct an ExtendedFileSpec object from a status, message string, generic code, severity code tuple.
ExtendedFileSpec(FileSpecOpStatus status, String errStr, String errCodeStr)
           
ExtendedFileSpec(Map<String,Object> map, IServer server, int index)
          Construct an ExtendedFileSpec object from the passed-in map.
ExtendedFileSpec(String pathStr)
          Given a candidate path string (which may include version and changelist annotations, at least), try to construct a corresponding extended file spec.
 
Method Summary
 String getActionOwner()
           
 Map<String,byte[]> getAttributes()
          Get the file attributes of this file, if they're available.
 Map<String,byte[]> getAttributeTypes()
           
 String getCharset()
           
 String getDesc()
           
 String getDigest()
           
 long getFileSize()
           
 int getHaveRev()
           
 FileAction getHeadAction()
           
 int getHeadChange()
           
 String getHeadCharset()
           
 Date getHeadModTime()
           
 int getHeadRev()
           
 Date getHeadTime()
           
 String getHeadType()
           
 String getMovedFile()
           
 FileAction getOpenAction()
           
 String getOpenActionOwner()
           
 int getOpenChangelistId()
           
 String getOpenType()
           
 List<String> getOtherActionList()
           
 List<String> getOtherChangelist()
           
 List<String> getOtherOpenList()
           
 Map<String,byte[]> getPropagatingAttributes()
           
 List<IResolveRecord> getResolveRecords()
           
 String getVerifyStatus()
           
 boolean isMapped()
           
 boolean isOtherLocked()
           
 boolean isReresolvable()
           
 boolean isResolved()
           
 boolean isShelved()
           
 boolean isUnresolved()
           
 void setActionOwner(String actionOwner)
           
 void setCharset(String charset)
           
 void setDesc(String desc)
           
 void setDigest(String digest)
           
 void setFileSize(long fileSize)
           
 void setHaveRev(int haveRev)
           
 void setHeadAction(FileAction headAction)
           
 void setHeadChange(int headChange)
           
 void setHeadCharset(String headCharset)
           
 void setHeadModTime(Date headModTime)
           
 void setHeadRev(int headRev)
           
 void setHeadTime(Date headTime)
           
 void setHeadType(String headType)
           
 void setMapped(boolean mapped)
           
 void setMovedFile(String movedFile)
           
 void setOpenAction(FileAction openAction)
           
 void setOpenActionOwner(String openActionOwner)
           
 void setOpenChangelistId(int openChangelistId)
           
 void setOpenType(String openType)
           
 void setOtherActionList(List<String> otherActionList)
           
 void setOtherChangelist(List<String> otherChangelist)
           
 void setOtherLocked(boolean otherLocked)
           
 void setOtherOpenList(List<String> otherOpenList)
           
 void setReresolvable(boolean reresolvable)
           
 void setResolved(boolean resolved)
           
 void setResolveRecords(List<IResolveRecord> resolveRecords)
           
 void setUnresolved(boolean unresolved)
           
 void setVerifyStatus(String verifyStatus)
           
 
Methods inherited from class com.perforce.p4java.impl.generic.core.file.FileSpec
getAction, getAnnotatedPathString, getAnnotatedPreferredPathString, getAnnotations, getAnnotations, getBaseFile, getBaseName, getBaseRev, getChangelistId, getClientName, getClientPath, getClientPathString, getContentResolveType, getContents, getContents, getDate, getDepotPath, getDepotPathString, getDiffStatus, getEndFromRev, getEndRevision, getEndToRev, getFileType, getFromFile, getGenericCode, getHowResolved, getLabel, getLocalPath, getLocalPathString, getOpStatus, getOriginalPath, getOriginalPathString, getOtherAction, getPath, getPathString, getPreferredPath, getPreferredPathString, getRawCode, getResolveType, getRevFromString, getRevisionHistory, getRevisionHistory, getSeverityCode, getShelvedChange, getStartFromRev, getStartRevision, getStartToRev, getStatusMessage, getSubCode, getSubSystem, getToFile, getUniqueCode, getUserName, getWorkRev, isLocked, isUnmap, move, move, setAction, setBaseFile, setBaseName, setBaseRev, setChangelistId, setClient, setClientName, setClientPath, setClientPath, setCodes, setContentResolveType, setDate, setDepotPath, setDepotPath, setDiffStatus, setEndFromRev, setEndRevision, setEndToRev, setFileType, setFromFile, setHowResolved, setLabel, setLocalPath, setLocalPath, setLocked, setOpStatus, setOriginalPath, setOriginalPath, setOtherAction, setPath, setPathFromString, setResolveType, setShelvedChange, setStartFromRev, setStartRevision, setStartToRev, setStatusMessage, setToFile, setUnmap, setUserName, setWorkRev, toString
 
Methods inherited from class com.perforce.p4java.impl.generic.core.ServerResource
canRefresh, canUpdate, complete, refresh, setRefreshable, setServer, update, update, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.perforce.p4java.core.file.IFileSpec
getAction, getAnnotatedPathString, getAnnotatedPreferredPathString, getAnnotations, getAnnotations, getBaseFile, getBaseName, getBaseRev, getChangelistId, getClientName, getClientPath, getClientPathString, getContentResolveType, getContents, getContents, getDate, getDepotPath, getDepotPathString, getDiffStatus, getEndFromRev, getEndRevision, getEndToRev, getFileType, getFromFile, getHowResolved, getLabel, getLocalPath, getLocalPathString, getOriginalPath, getOriginalPathString, getOtherAction, getPath, getPathString, getPreferredPath, getPreferredPathString, getResolveType, getRevisionHistory, getRevisionHistory, getShelvedChange, getStartFromRev, getStartRevision, getStartToRev, getToFile, getUserName, getWorkRev, isLocked, isUnmap, move, move, setAction, setBaseFile, setBaseName, setBaseRev, setChangelistId, setClientName, setClientPath, setContentResolveType, setDate, setDepotPath, setDiffStatus, setEndFromRev, setEndRevision, setEndToRev, setFileType, setFromFile, setHowResolved, setLabel, setLocalPath, setLocked, setOriginalPath, setOtherAction, setPath, setPathFromString, setResolveType, setShelvedChange, setStartFromRev, setStartRevision, setStartToRev, setToFile, setUnmap, setUserName, setWorkRev, toString
 
Methods inherited from interface com.perforce.p4java.core.file.IFileOperationResult
getGenericCode, getOpStatus, getRawCode, getSeverityCode, getStatusMessage, getSubCode, getSubSystem, getUniqueCode
 
Methods inherited from interface com.perforce.p4java.core.IServerResource
canRefresh, canUpdate, refresh, setServer, update, update, update
 

Constructor Detail

ExtendedFileSpec

public ExtendedFileSpec()
Default constructor. Sets all boolean fields to false, object fields to null, integers to zero.


ExtendedFileSpec

public ExtendedFileSpec(Map<String,Object> map,
                        IServer server,
                        int index)
Construct an ExtendedFileSpec object from the passed-in map. The map must be (or have the same keys and semantics as) a map as returned from a suitable Perforce server call; the semantics and format of this map are not spelled out here.

Parameters:
map - suitable field map from Perforce server; if null, this constructor has the same semantics as the default constructor.
server - non-null server object
index - passed to the superclass FileSpec(Map map, IServer server, int index) constructor but not otherwise used here.

ExtendedFileSpec

public ExtendedFileSpec(FileSpecOpStatus status,
                        String errStr)
Construct an ExtendedFileSpec object from a status, message string pair. See the corresponding FileSpec constructor for details -- this constructor does not add any ExtendedFileSpec-specific semantics.

Parameters:
status - FileSpecOpStatus status.
errStr - error / info message string.

ExtendedFileSpec

public ExtendedFileSpec(FileSpecOpStatus status,
                        String errStr,
                        int genericCode,
                        int severityCode)
Construct an ExtendedFileSpec object from a status, message string, generic code, severity code tuple. See the corresponding FileSpec constructor for details -- this constructor does not add any ExtendedFileSpec-specific semantics.

Parameters:
status - FileSpecOpStatus status.
errStr - error / info message string.
genericCode - Perforce generic code to use
severityCode - Perforce severity code to use.

ExtendedFileSpec

public ExtendedFileSpec(FileSpecOpStatus status,
                        String errStr,
                        String errCodeStr)

ExtendedFileSpec

public ExtendedFileSpec(FileSpecOpStatus status,
                        String errStr,
                        int rawCode)

ExtendedFileSpec

public ExtendedFileSpec(String pathStr)
Given a candidate path string (which may include version and changelist annotations, at least), try to construct a corresponding extended file spec.

See the corresponding FileSpec constructor for details -- this constructor does not add any ExtendedFileSpec-specific semantics.

Parameters:
pathStr - candidate path string
Method Detail

getDesc

public String getDesc()
Specified by:
getDesc in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.getDesc()

getDigest

public String getDigest()
Specified by:
getDigest in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.getDigest()

getFileSize

public long getFileSize()
Specified by:
getFileSize in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.getFileSize()

getHaveRev

public int getHaveRev()
Specified by:
getHaveRev in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.getHaveRev()

getHeadAction

public FileAction getHeadAction()
Specified by:
getHeadAction in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.getHeadAction()

getHeadChange

public int getHeadChange()
Specified by:
getHeadChange in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.getHeadChange()

getHeadModTime

public Date getHeadModTime()
Specified by:
getHeadModTime in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.getHeadModTime()

getHeadCharset

public String getHeadCharset()
Specified by:
getHeadCharset in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.getHeadCharset()

getHeadRev

public int getHeadRev()
Specified by:
getHeadRev in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.getHeadRev()

getHeadTime

public Date getHeadTime()
Specified by:
getHeadTime in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.getHeadTime()

getHeadType

public String getHeadType()
Specified by:
getHeadType in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.getHeadType()

getOpenAction

public FileAction getOpenAction()
Specified by:
getOpenAction in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.getOpenAction()

getOpenActionOwner

public String getOpenActionOwner()
Specified by:
getOpenActionOwner in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.getOpenActionOwner()

getOpenChangelistId

public int getOpenChangelistId()
Specified by:
getOpenChangelistId in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.getOpenChangelistId()

getOpenType

public String getOpenType()
Specified by:
getOpenType in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.getOpenType()

isMapped

public boolean isMapped()
Specified by:
isMapped in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.isMapped()

isResolved

public boolean isResolved()
Specified by:
isResolved in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.isResolved()

isUnresolved

public boolean isUnresolved()
Specified by:
isUnresolved in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.isUnresolved()

isReresolvable

public boolean isReresolvable()
Specified by:
isReresolvable in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.isReresolvable()

isOtherLocked

public boolean isOtherLocked()
Specified by:
isOtherLocked in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.isOtherLocked()

getOtherOpenList

public List<String> getOtherOpenList()
Specified by:
getOtherOpenList in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.getOtherOpenList()

getOtherChangelist

public List<String> getOtherChangelist()
Specified by:
getOtherChangelist in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.getOtherChangelist()

getOtherActionList

public List<String> getOtherActionList()
Specified by:
getOtherActionList in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.getOtherActionList()

setMapped

public void setMapped(boolean mapped)
Specified by:
setMapped in interface IExtendedFileSpec

setHeadAction

public void setHeadAction(FileAction headAction)
Specified by:
setHeadAction in interface IExtendedFileSpec

setHeadChange

public void setHeadChange(int headChange)
Specified by:
setHeadChange in interface IExtendedFileSpec

setHeadRev

public void setHeadRev(int headRev)
Specified by:
setHeadRev in interface IExtendedFileSpec

setHeadType

public void setHeadType(String headType)
Specified by:
setHeadType in interface IExtendedFileSpec

setHeadTime

public void setHeadTime(Date headTime)
Specified by:
setHeadTime in interface IExtendedFileSpec

setHeadModTime

public void setHeadModTime(Date headModTime)
Specified by:
setHeadModTime in interface IExtendedFileSpec

setHeadCharset

public void setHeadCharset(String headCharset)
Specified by:
setHeadCharset in interface IExtendedFileSpec

setHaveRev

public void setHaveRev(int haveRev)
Specified by:
setHaveRev in interface IExtendedFileSpec

setDesc

public void setDesc(String desc)
Specified by:
setDesc in interface IExtendedFileSpec

setDigest

public void setDigest(String digest)
Specified by:
setDigest in interface IExtendedFileSpec

setFileSize

public void setFileSize(long fileSize)
Specified by:
setFileSize in interface IExtendedFileSpec

setOpenAction

public void setOpenAction(FileAction openAction)
Specified by:
setOpenAction in interface IExtendedFileSpec

setOpenType

public void setOpenType(String openType)
Specified by:
setOpenType in interface IExtendedFileSpec

setOpenActionOwner

public void setOpenActionOwner(String openActionOwner)
Specified by:
setOpenActionOwner in interface IExtendedFileSpec

setOpenChangelistId

public void setOpenChangelistId(int openChangelistId)
Specified by:
setOpenChangelistId in interface IExtendedFileSpec

setUnresolved

public void setUnresolved(boolean unresolved)
Specified by:
setUnresolved in interface IExtendedFileSpec

setResolved

public void setResolved(boolean resolved)
Specified by:
setResolved in interface IExtendedFileSpec

setReresolvable

public void setReresolvable(boolean reresolvable)
Specified by:
setReresolvable in interface IExtendedFileSpec

setOtherLocked

public void setOtherLocked(boolean otherLocked)
Specified by:
setOtherLocked in interface IExtendedFileSpec

setOtherOpenList

public void setOtherOpenList(List<String> otherOpenList)
Specified by:
setOtherOpenList in interface IExtendedFileSpec

setOtherChangelist

public void setOtherChangelist(List<String> otherChangelist)
Specified by:
setOtherChangelist in interface IExtendedFileSpec

setOtherActionList

public void setOtherActionList(List<String> otherActionList)
Specified by:
setOtherActionList in interface IExtendedFileSpec

getActionOwner

public String getActionOwner()
Specified by:
getActionOwner in interface IExtendedFileSpec

setActionOwner

public void setActionOwner(String actionOwner)
Specified by:
setActionOwner in interface IExtendedFileSpec

getCharset

public String getCharset()
Specified by:
getCharset in interface IExtendedFileSpec

setCharset

public void setCharset(String charset)
Specified by:
setCharset in interface IExtendedFileSpec

isShelved

public boolean isShelved()
Specified by:
isShelved in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.isShelved()

getResolveRecords

public List<IResolveRecord> getResolveRecords()
Specified by:
getResolveRecords in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.getResolveRecords()

setResolveRecords

public void setResolveRecords(List<IResolveRecord> resolveRecords)
Specified by:
setResolveRecords in interface IExtendedFileSpec
See Also:
IExtendedFileSpec.setResolveRecords(java.util.List)

getMovedFile

public String getMovedFile()
Specified by:
getMovedFile in interface IExtendedFileSpec
Returns:
the movedFile

setMovedFile

public void setMovedFile(String movedFile)
Specified by:
setMovedFile in interface IExtendedFileSpec
Parameters:
movedFile - the movedFile to set

getAttributes

public Map<String,byte[]> getAttributes()
Description copied from interface: IExtendedFileSpec
Get the file attributes of this file, if they're available. Attributes will only be available if getExtendedFiles was called with the correct FileStatAncilliaryOptions settings; see the main Perforce file attribute documentation. Attributes are treated by the Perforce server as bytes (they're commonly used to store raw data such as thumbnails); it is up to the consumer to determine the "real" type and convert as appropriate.

Specified by:
getAttributes in interface IExtendedFileSpec
Returns:
non-null but possibly-empty map of file attributes keyed by attribute name. Individual attribute values may be null.

getPropagatingAttributes

public Map<String,byte[]> getPropagatingAttributes()

getAttributeTypes

public Map<String,byte[]> getAttributeTypes()

getVerifyStatus

public String getVerifyStatus()
Specified by:
getVerifyStatus in interface IExtendedFileSpec

setVerifyStatus

public void setVerifyStatus(String verifyStatus)
Specified by:
setVerifyStatus in interface IExtendedFileSpec


Copyright © 2015 Perforce Software. All Rights Reserved.