|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.tmatesoft.svn.core.wc.SVNStatus
public class SVNStatus
The SVNStatus class is used to provide detailed status information for a Working Copy item as a result of a status operation invoked by a doStatus() method of SVNStatusClient. SVNStatus objects are generated for each 'interesting' local item and depending on the doStatus() method in use either passed for notification to an ISVNStatusHandler implementation or such an object is just returned by the method as a status info for a single item.
Within the status handler implementation a developer decides how to interpret status information. For some purposes this way may be more flexible in comparison with calling doStatus() that returns an SVNStatus per one local item. However the latter one may be useful when needing to find out the status of the concrete item.
There are two approaches how to process SVNStatus objects:
1. Implementing an ISVNStatusHandler:
import org.tmatesoft.svn.core.wc.ISVNStatusHandler; import org.tmatesoft.svn.core.wc.SVNStatus; import org.tmatesoft.svn.core.wc.SVNStatusType; ... public class MyCustomStatusHandler implements ISVNStatusHandler { public void handleStatus(SVNStatus status) { //parse the item's contents status if(status.getContentsStatus() == SVNStatusType.STATUS_MODIFIED) { ... } else if(status.getContentsStatus() == SVNStatusType.STATUS_CONFLICTED) { ... } ... //parse properties status if(status.getPropertiesStatus() == SVNStatusType.STATUS_MODIFIED) { ... } ... } }
... import org.tmatesoft.svn.core.wc.SVNStatusClient; ... SVNStatusClient statusClient; ... statusClient.doStatus(...., new MyCustomStatusHandler()); ...
... SVNStatus status = statusClient.doStatus(new File(myPath), false); //parsing status info here ...
SVNStatus's methods which names start with getRemote
are
relevant for remote status invocations - that is when a doStatus() method of
SVNStatusClient is called with the flag remote
set to
true.
ISVNStatusHandler
,
SVNStatusType
,
ExamplesConstructor Summary | |
---|---|
SVNStatus()
|
|
SVNStatus(SVNURL url,
java.io.File file,
SVNNodeKind kind,
SVNRevision revision,
SVNRevision committedRevision,
java.util.Date committedDate,
java.lang.String author,
SVNStatusType contentsStatus,
SVNStatusType propertiesStatus,
SVNStatusType remoteContentsStatus,
SVNStatusType remotePropertiesStatus,
boolean isLocked,
boolean isCopied,
boolean isSwitched,
boolean isFileExternal,
java.io.File conflictNewFile,
java.io.File conflictOldFile,
java.io.File conflictWrkFile,
java.io.File projRejectFile,
java.lang.String copyFromURL,
SVNRevision copyFromRevision,
SVNLock remoteLock,
SVNLock localLock,
java.util.Map entryProperties,
java.lang.String changelistName,
int wcFormatVersion,
SVNTreeConflictDescription treeConflict)
Constructs an SVNStatus object filling it with status information details. |
Method Summary | |
---|---|
java.lang.String |
getAuthor()
Gets the author who last changed the item. |
java.lang.String |
getChangelistName()
Returns the name of the changelist which the working copy item, denoted by this object, belongs to. |
SVNStatusType |
getCombinedNodeAndContentsStatus()
|
java.util.Date |
getCommittedDate()
Gets the timestamp when the item was last changed (committed). |
SVNRevision |
getCommittedRevision()
Gets the revision when the item was last changed (committed). |
java.io.File |
getConflictNewFile()
Gets the temporary file that contains all latest changes from the repository which led to a conflict with local changes. |
java.io.File |
getConflictOldFile()
Gets the temporary BASE revision file of that working file that is currently in conflict with changes received from the repository. |
java.io.File |
getConflictWrkFile()
Gets the temporary '.mine' file with all current local changes to the original file. |
SVNStatusType |
getContentsStatus()
Gets the Working Copy local item's contents status type. |
SVNRevision |
getCopyFromRevision()
Gets the revision of the item's ancestor from which the item was copied (the item is added with history). |
java.lang.String |
getCopyFromURL()
Gets the URL (repository location) of the ancestor from which the item was copied. |
SVNDepth |
getDepth()
|
org.tmatesoft.svn.core.internal.wc.admin.SVNEntry |
getEntry()
Returns a WC entry for which this object is generated. |
java.util.Map |
getEntryProperties()
Gets the item's SVN specific '<entry' properties. |
java.io.File |
getFile()
Gets the item's path in the filesystem. |
SVNNodeKind |
getKind()
Gets the item's node kind characterizing it as an entry. |
SVNLock |
getLocalLock()
Gets the file item's local lock. |
SVNStatusType |
getNodeStatus()
|
SVNStatusType |
getPropertiesStatus()
Gets the Working Copy local item's properties status type. |
java.io.File |
getPropRejectFile()
Gets the '.prej' file containing details on properties conflicts. |
java.lang.String |
getRemoteAuthor()
Gets the item's last changed author. |
SVNStatusType |
getRemoteContentsStatus()
Gets the Working Copy item's contents status type against the repository - that is comparing the item's BASE revision and the latest one in the repository when the item was changed. |
java.util.Date |
getRemoteDate()
Gets the item's last changed date. |
SVNNodeKind |
getRemoteKind()
Returns the kind of the item got from the repository. |
SVNLock |
getRemoteLock()
Gets the file item's repository lock - applicable for a remote status invocation. |
SVNStatusType |
getRemoteNodeStatus()
|
SVNStatusType |
getRemotePropertiesStatus()
Gets the Working Copy item's properties status type against the repository - that is comparing the item's BASE revision and the latest one in the repository when the item was changed. |
SVNRevision |
getRemoteRevision()
Gets the item's last committed repository revision. |
SVNURL |
getRemoteURL()
Gets the item's latest repository location. |
java.lang.String |
getRepositoryRelativePath()
|
SVNURL |
getRepositoryRootURL()
|
java.lang.String |
getRepositoryUUID()
|
SVNRevision |
getRevision()
Gets the item's current working revision. |
SVNTreeConflictDescription |
getTreeConflict()
Returns a tree conflict description. |
SVNURL |
getURL()
Gets the item's repository location. |
java.util.Date |
getWorkingContentsDate()
Returns the last modified local time of the file item. |
int |
getWorkingCopyFormat()
Returns the working copy format number for the admin directory which the statused item is versioned under. |
java.util.Date |
getWorkingPropertiesDate()
Returns the last modified local time of file or directory properties. |
boolean |
isConflicted()
|
boolean |
isCopied()
Finds out if the item is added with history. |
boolean |
isFileExternal()
Tells if this is an externals file or not. |
boolean |
isLocked()
Finds out if the item is locked (not a user lock but a driver's one when during an operation a Working Copy is locked in .svn administrative areas to prevent from other operations interrupting until the running one finishes). |
boolean |
isSwitched()
Finds out whether the item is switched to a different repository location. |
boolean |
isVersioned()
|
void |
markExternal()
Marks the item as an external. |
void |
setAuthor(java.lang.String author)
|
void |
setChangelistName(java.lang.String changelistName)
|
void |
setCommittedDate(java.util.Date committedDate)
|
void |
setCommittedRevision(SVNRevision committedRevision)
|
void |
setConflicted(boolean isConflicted)
|
void |
setConflictNewFile(java.io.File conflictNewFile)
|
void |
setConflictOldFile(java.io.File conflictOldFile)
|
void |
setConflictWrkFile(java.io.File conflictWrkFile)
|
void |
setContentsStatus(SVNStatusType statusType)
Sets the item's contents status type. |
void |
setCopyFromRevision(SVNRevision copyFromRevision)
|
void |
setCopyFromURL(java.lang.String copyFromURL)
|
void |
setDepth(SVNDepth depth)
|
void |
setEntry(org.tmatesoft.svn.core.internal.wc.admin.SVNEntry entry)
Sets a WC entry for which this object is generated. |
void |
setEntryProperties(java.util.Map entryProperties)
|
void |
setFile(java.io.File file)
|
void |
setIsConflicted(boolean isConflicted)
|
void |
setIsCopied(boolean isCopied)
|
void |
setIsFileExternal(boolean isFileExternal)
|
void |
setIsLocked(boolean isLocked)
|
void |
setIsSwitched(boolean isSwitched)
|
void |
setIsVersioned(boolean isVersioned)
|
void |
setKind(SVNNodeKind kind)
|
void |
setLocalContentsDate(java.util.Date localContentsDate)
|
void |
setLocalLock(SVNLock localLock)
|
void |
setLocalPropertiesDate(java.util.Date localPropertiesDate)
|
void |
setNodeStatus(SVNStatusType nodeStatus)
|
void |
setPropertiesStatus(SVNStatusType propertiesStatus)
|
void |
setPropRejectFile(java.io.File propRejectFile)
|
void |
setRemoteAuthor(java.lang.String remoteAuthor)
|
void |
setRemoteContentsStatus(SVNStatusType remoteContentsStatus)
|
void |
setRemoteDate(java.util.Date remoteDate)
|
void |
setRemoteKind(SVNNodeKind remoteKind)
|
void |
setRemoteLock(SVNLock remoteLock)
|
void |
setRemoteNodeStatus(SVNStatusType remoteNodeStatus)
|
void |
setRemotePropertiesStatus(SVNStatusType remotePropertiesStatus)
|
void |
setRemoteRevision(SVNRevision remoteRevision)
|
void |
setRemoteStatus(SVNStatusType contents,
SVNStatusType props,
SVNLock lock,
SVNNodeKind kind)
Sets the item's remote status. |
void |
setRemoteStatus(SVNURL url,
SVNStatusType contents,
SVNStatusType props,
SVNLock lock,
SVNNodeKind kind,
SVNRevision revision,
java.util.Date date,
java.lang.String author)
Sets the item's remote status. |
void |
setRemoteURL(SVNURL remoteURL)
|
void |
setRepositoryRelativePath(java.lang.String repositoryRelativePath)
|
void |
setRepositoryRootURL(SVNURL repositoryRootURL)
|
void |
setRepositoryUUID(java.lang.String repositoryUUID)
|
void |
setRevision(SVNRevision revision)
|
void |
setTreeConflict(SVNTreeConflictDescription treeConflict)
|
void |
setURL(SVNURL uRL)
|
void |
setWorkingCopyFormat(int workingCopyFormat)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SVNStatus(SVNURL url, java.io.File file, SVNNodeKind kind, SVNRevision revision, SVNRevision committedRevision, java.util.Date committedDate, java.lang.String author, SVNStatusType contentsStatus, SVNStatusType propertiesStatus, SVNStatusType remoteContentsStatus, SVNStatusType remotePropertiesStatus, boolean isLocked, boolean isCopied, boolean isSwitched, boolean isFileExternal, java.io.File conflictNewFile, java.io.File conflictOldFile, java.io.File conflictWrkFile, java.io.File projRejectFile, java.lang.String copyFromURL, SVNRevision copyFromRevision, SVNLock remoteLock, SVNLock localLock, java.util.Map entryProperties, java.lang.String changelistName, int wcFormatVersion, SVNTreeConflictDescription treeConflict)
Used by SVNKit internals to construct and initialize an SVNStatus object. It's not intended for users (from an API point of view).
url
- item's repository locationfile
- item's path in a File representationkind
- item's node kindrevision
- item's working revisioncommittedRevision
- item's last changed revisioncommittedDate
- item's last changed dateauthor
- item's last commit authorcontentsStatus
- local status of item's contentspropertiesStatus
- local status of item's propertiesremoteContentsStatus
- status of item's contents against a repositoryremotePropertiesStatus
- status of item's properties against a repositoryisLocked
- if the item is locked by the driver (not a user lock)isCopied
- if the item is added with historyisSwitched
- if the item is switched to a different URLisFileExternal
- tells if the item is an external fileconflictNewFile
- temp file with latest changes from the repositoryconflictOldFile
- temp file just as the conflicting one was at the BASE revisionconflictWrkFile
- temp file with all user's current local modificationsprojRejectFile
- temp file describing properties conflictscopyFromURL
- url of the item's ancestor from which the item was copiedcopyFromRevision
- item's ancestor revision from which the item was copiedremoteLock
- item's lock in the repositorylocalLock
- item's local lockentryProperties
- item's SVN specific '<entry' propertieschangelistName
- changelist name which the item belongs towcFormatVersion
- working copy format numbertreeConflict
- tree conflict descriptionpublic SVNStatus()
Method Detail |
---|
public SVNURL getURL()
SVNProperty.URL
property.
public SVNURL getRemoteURL()
getURL()
returns the item's URL as it's defined in a URL entry property.
Applicable for a remote status invocation.
public java.io.File getFile()
public SVNNodeKind getKind()
public SVNRevision getRevision()
public SVNRevision getCommittedRevision()
public java.util.Date getCommittedDate()
public java.lang.String getAuthor()
public SVNStatusType getContentsStatus()
public SVNStatusType getPropertiesStatus()
public SVNStatusType getRemoteContentsStatus()
If the remote contents status type != SVNStatusType.STATUS_NONE
the local file may be out of date.
public SVNStatusType getRemotePropertiesStatus()
If the remote properties status type != SVNStatusType.STATUS_NONE
the local file may be out of date.
public boolean isLocked()
To clean up a Working Copy use doCleanup()
.
public boolean isCopied()
public boolean isSwitched()
public boolean isFileExternal()
public java.io.File getConflictNewFile()
public java.io.File getConflictOldFile()
public java.io.File getConflictWrkFile()
public java.io.File getPropRejectFile()
public java.lang.String getCopyFromURL()
public SVNRevision getCopyFromRevision()
public SVNLock getRemoteLock()
public SVNLock getLocalLock()
public java.util.Map getEntryProperties()
SVNProperty.SVN_ENTRY_PREFIX
.
public SVNRevision getRemoteRevision()
public SVNNodeKind getRemoteKind()
public java.util.Date getRemoteDate()
public java.lang.String getRemoteAuthor()
public java.util.Date getWorkingContentsDate()
Date(0)
).
public java.util.Date getWorkingPropertiesDate()
public void markExternal()
public void setRemoteStatus(SVNStatusType contents, SVNStatusType props, SVNLock lock, SVNNodeKind kind)
contents
- item's contents status type against the repositoryprops
- item's properties status type against the repositorylock
- item's lock in the repositorykind
- item's node kindpublic void setRemoteStatus(SVNURL url, SVNStatusType contents, SVNStatusType props, SVNLock lock, SVNNodeKind kind, SVNRevision revision, java.util.Date date, java.lang.String author)
url
- item's repository URLcontents
- item's contents status type against the repositoryprops
- item's properties status type against the repositorylock
- item's lock in the repositorykind
- item's node kindrevision
- item's latest revision when it was last committeddate
- last item's committed dateauthor
- last item's committed authorpublic void setContentsStatus(SVNStatusType statusType)
statusType
- status type of the item's contentspublic void setEntry(org.tmatesoft.svn.core.internal.wc.admin.SVNEntry entry)
entry
- a WC entrypublic org.tmatesoft.svn.core.internal.wc.admin.SVNEntry getEntry()
public java.lang.String getChangelistName()
public SVNTreeConflictDescription getTreeConflict()
null
if no conflict
description exists on this itempublic int getWorkingCopyFormat()
-1
.
-1
for remote statuspublic void setConflicted(boolean isConflicted)
public boolean isConflicted()
public boolean isVersioned()
public SVNStatusType getRemoteNodeStatus()
public SVNStatusType getCombinedNodeAndContentsStatus()
public SVNStatusType getNodeStatus()
public SVNURL getRepositoryRootURL()
public java.lang.String getRepositoryUUID()
public java.lang.String getRepositoryRelativePath()
public SVNDepth getDepth()
public void setRemoteNodeStatus(SVNStatusType remoteNodeStatus)
public void setNodeStatus(SVNStatusType nodeStatus)
public void setRepositoryRootURL(SVNURL repositoryRootURL)
public void setRepositoryUUID(java.lang.String repositoryUUID)
public void setRepositoryRelativePath(java.lang.String repositoryRelativePath)
public void setURL(SVNURL uRL)
public void setFile(java.io.File file)
public void setKind(SVNNodeKind kind)
public void setRevision(SVNRevision revision)
public void setCommittedRevision(SVNRevision committedRevision)
public void setCommittedDate(java.util.Date committedDate)
public void setAuthor(java.lang.String author)
public void setPropertiesStatus(SVNStatusType propertiesStatus)
public void setRemoteContentsStatus(SVNStatusType remoteContentsStatus)
public void setRemotePropertiesStatus(SVNStatusType remotePropertiesStatus)
public void setIsLocked(boolean isLocked)
public void setIsCopied(boolean isCopied)
public void setIsSwitched(boolean isSwitched)
public void setIsFileExternal(boolean isFileExternal)
public void setConflictNewFile(java.io.File conflictNewFile)
public void setConflictOldFile(java.io.File conflictOldFile)
public void setConflictWrkFile(java.io.File conflictWrkFile)
public void setPropRejectFile(java.io.File propRejectFile)
public void setCopyFromURL(java.lang.String copyFromURL)
public void setCopyFromRevision(SVNRevision copyFromRevision)
public void setRemoteLock(SVNLock remoteLock)
public void setLocalLock(SVNLock localLock)
public void setEntryProperties(java.util.Map entryProperties)
public void setRemoteRevision(SVNRevision remoteRevision)
public void setRemoteURL(SVNURL remoteURL)
public void setRemoteKind(SVNNodeKind remoteKind)
public void setRemoteAuthor(java.lang.String remoteAuthor)
public void setRemoteDate(java.util.Date remoteDate)
public void setLocalContentsDate(java.util.Date localContentsDate)
public void setLocalPropertiesDate(java.util.Date localPropertiesDate)
public void setChangelistName(java.lang.String changelistName)
public void setWorkingCopyFormat(int workingCopyFormat)
public void setTreeConflict(SVNTreeConflictDescription treeConflict)
public void setIsConflicted(boolean isConflicted)
public void setIsVersioned(boolean isVersioned)
public void setDepth(SVNDepth depth)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |