Package org.tmatesoft.svn.core.wc
Class SVNInfo
- java.lang.Object
-
- org.tmatesoft.svn.core.wc.SVNInfo
-
public class SVNInfo extends java.lang.ObjectThe SVNInfo class is a wrapper for versioned item's (located either in a Working Copy or a repository) information details. When running an info operation invoking a doInfo() method of the SVNWCClient class all collected item information data is packed inside an SVNInfo object and depending on the exact doInfo() method being in use is either dispatched to an implementation of ISVNInfoHandler or just returned by the method (per single item info operation).There are two approaches how to process SVNInfo objects:
1. Implementing an ISVNInfoHandler:import org.tmatesoft.svn.core.wc.ISVNInfoHandler; import org.tmatesoft.svn.core.wc.SVNInfo; ... public class MyCustomInfoHandler implements ISVNInfoHandler { public void handleInfo(SVNInfo info) { //parsing info here ... } }
...and providing an info handler implementation to an SVNWCClient's doInfo() method:... import org.tmatesoft.svn.core.wc.SVNWCClient; ... SVNWCClient wcClient; ... wcClient.doInfo(...., new MyCustomInfoHandler()); ...
2. Or process an SVNInfo like this:... SVNInfo info = wcClient.doInfo(new File(myPath), SVNRevision.WORKING); //parsing info here ...
- Since:
- 1.2
- Version:
- 1.3
- Author:
- TMate Software Ltd.
- See Also:
ISVNInfoHandler,SVNWCClient, Examples
-
-
Constructor Summary
Constructors Constructor Description SVNInfo(java.io.File file, SVNURL url, SVNURL rootURL, long revision, SVNNodeKind kind, java.lang.String uuid, long committedRevision, java.lang.String committedDate, java.lang.String author, java.lang.String schedule, SVNURL copyFromURL, long copyFromRevision, java.lang.String textTime, java.lang.String propTime, java.lang.String checksum, java.lang.String conflictOld, java.lang.String conflictNew, java.lang.String conflictWorking, java.lang.String propRejectFile, SVNLock lock, SVNDepth depth, java.lang.String changelistName, long wcSize, SVNTreeConflictDescription treeConflict)SVNInfo(java.lang.String path, SVNURL url, SVNRevision revision, SVNNodeKind kind, java.lang.String uuid, SVNURL reposRootURL, long comittedRevision, java.util.Date date, java.lang.String author, SVNLock lock, SVNDepth depth, long size)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SVNInfocreateInfo(java.io.File file, org.tmatesoft.svn.core.internal.wc.admin.SVNEntry entry)static SVNInfocreateInfo(java.io.File file, SVNTreeConflictDescription tc)static SVNInfocreateInfo(java.lang.String path, SVNURL reposRootURL, java.lang.String uuid, SVNURL url, SVNRevision revision, SVNDirEntry dirEntry, SVNLock lock)java.lang.StringgetAuthor()Gets the item's last commit author.java.lang.StringgetChangelistName()Gets the name of the changelist the item belongs to.java.lang.StringgetChecksum()Gets the file item's checksum.java.util.DategetCommittedDate()Gets the item's last commit date.SVNRevisiongetCommittedRevision()Gets the item's last committed revision.java.io.FilegetConflictNewFile()Gets the temporary file that contains all latest changes from the repository which led to a conflict with local changes.java.io.FilegetConflictOldFile()Gets the temporary BASE revision file of that working file that is currently in conflict with changes received from the repository.java.io.FilegetConflictWrkFile()Gets the temporary '.mine' file with all current local changes to the original file.SVNRevisiongetCopyFromRevision()Gets the revision of the item's ancestor from which the item was copied.SVNURLgetCopyFromURL()Gets the URL (repository location) of the ancestor from which the item was copied.SVNDepthgetDepth()Gets the item's depth.java.io.FilegetFile()Gets the item's local path.SVNNodeKindgetKind()Gets the item's node kind.SVNLockgetLock()Gets the file item's lock.java.io.FilegetMovedFromPath()java.io.FilegetMovedToPath()java.lang.StringgetPath()Gets the item's path (relative to the repository root).java.io.FilegetPropConflictFile()Gets the '.prej' file containing details on properties conflicts.java.util.DategetPropTime()Gets the value of the item'sSVNProperty.PROP_TIMEproperty.SVNURLgetRepositoryRootURL()Gets the repository root url (where the repository itself is installed).longgetRepositorySize()Returns the size of the file in the repository.java.lang.StringgetRepositoryUUID()Gets the repository Universal Unique IDentifier (UUID).SVNRevisiongetRevision()Gets the item's revision.java.lang.StringgetSchedule()Gets the item's schedule status.java.util.DategetTextTime()Gets the value of the item'sSVNProperty.TEXT_TIMEproperty.SVNTreeConflictDescriptiongetTreeConflict()Returns a tree conflict description on the item represented by this object.SVNURLgetURL()Gets the item's URL - its repository location.java.io.FilegetWorkingCopyRoot()longgetWorkingSize()Returns the size of the working copy file.booleanisRemote()Finds out whether the item for which this SVNInfo is generated is local (located in a user's Working Copy) or remote (located in a repository).voidsetMovedFromPath(java.io.File movedFrom)voidsetMovedToPath(java.io.File movedTo)voidsetWorkingCopyRoot(java.io.File root)
-
-
-
Constructor Detail
-
SVNInfo
public SVNInfo(java.io.File file, SVNURL url, SVNURL rootURL, long revision, SVNNodeKind kind, java.lang.String uuid, long committedRevision, java.lang.String committedDate, java.lang.String author, java.lang.String schedule, SVNURL copyFromURL, long copyFromRevision, java.lang.String textTime, java.lang.String propTime, java.lang.String checksum, java.lang.String conflictOld, java.lang.String conflictNew, java.lang.String conflictWorking, java.lang.String propRejectFile, SVNLock lock, SVNDepth depth, java.lang.String changelistName, long wcSize, SVNTreeConflictDescription treeConflict)
-
SVNInfo
public SVNInfo(java.lang.String path, SVNURL url, SVNRevision revision, SVNNodeKind kind, java.lang.String uuid, SVNURL reposRootURL, long comittedRevision, java.util.Date date, java.lang.String author, SVNLock lock, SVNDepth depth, long size)
-
-
Method Detail
-
createInfo
public static SVNInfo createInfo(java.io.File file, org.tmatesoft.svn.core.internal.wc.admin.SVNEntry entry) throws SVNException
- Throws:
SVNException
-
createInfo
public static SVNInfo createInfo(java.io.File file, SVNTreeConflictDescription tc)
-
createInfo
public static SVNInfo createInfo(java.lang.String path, SVNURL reposRootURL, java.lang.String uuid, SVNURL url, SVNRevision revision, SVNDirEntry dirEntry, SVNLock lock)
-
getAuthor
public java.lang.String getAuthor()
Gets the item's last commit author. This is the value of the item'sSVNProperty.LAST_AUTHORproperty.- Returns:
- the author who last changed (committed) the item
-
getChecksum
public java.lang.String getChecksum()
Gets the file item's checksum. This is the value of the file item'sSVNProperty.CHECKSUMproperty.- Returns:
- the file item's checksum
-
getCommittedDate
public java.util.Date getCommittedDate()
Gets the item's last commit date. This is the value of the item'sSVNProperty.COMMITTED_DATEproperty.- Returns:
- the item's last commit date
-
getCommittedRevision
public SVNRevision getCommittedRevision()
Gets the item's last committed revision. This is the value of the item'sSVNProperty.COMMITTED_REVISIONproperty.- Returns:
- the item's last committed revision.
-
getConflictNewFile
public java.io.File getConflictNewFile()
Gets the temporary file that contains all latest changes from the repository which led to a conflict with local changes. This file is at the HEAD revision.Taken from the item's
SVNProperty.CONFLICT_NEWproperty.- Returns:
- an autogenerated temporary file just as it is in the latest revision in the repository
-
getConflictOldFile
public 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. This file does not contain the latest user's modifications, only 'pristine' contents.Taken from the item's
SVNProperty.CONFLICT_OLDproperty.- Returns:
- an autogenerated temporary file just as the conflicting file was before any modifications to it
-
getConflictWrkFile
public java.io.File getConflictWrkFile()
Gets the temporary '.mine' file with all current local changes to the original file. That is if the file item is in conflict with changes that came during an update this temporary file is created to get the snapshot of the user's file with only the user's local modifications and nothing more.Taken from the item's
SVNProperty.CONFLICT_WRKproperty.- Returns:
- an autogenerated temporary file with only the user's modifications
-
getTreeConflict
public SVNTreeConflictDescription getTreeConflict()
Returns a tree conflict description on the item represented by this object.- Returns:
- a tree conflict description object or
nullif no tree conflict exists on this item - Since:
- 1.3
-
getCopyFromRevision
public SVNRevision getCopyFromRevision()
Gets the revision of the item's ancestor from which the item was copied.- Returns:
- the ancestor's revision (taken from the
SVNProperty.COPYFROM_REVISIONproperty)
-
getCopyFromURL
public SVNURL getCopyFromURL()
Gets the URL (repository location) of the ancestor from which the item was copied.- Returns:
- the item ancestor's URL (taken from the
SVNProperty.COPYFROM_URLproperty)
-
getFile
public java.io.File getFile()
Gets the item's local path. Applicable for local info operation invocations, however if an info operation is invoked for remote items, usegetPath()instead.- Returns:
- the item's local path
-
isRemote
public boolean isRemote()
Finds out whether the item for which this SVNInfo is generated is local (located in a user's Working Copy) or remote (located in a repository). It depends on the type of an info operation to perform - that is on anSVNWCClient's doInfo() method to use. Also applicability of some methods of the SVNInfo class depends on the item's location that can be determined calling this method.- Returns:
- true if the item is located in a repository, otherwise false and the item is in a Working Copy
-
getKind
public SVNNodeKind getKind()
Gets the item's node kind. Used to find out whether the item is a file, directory, etc.- Returns:
- the item's node kind
-
getLock
public SVNLock getLock()
Gets the file item's lock. Used to get lock information - lock token, comment, etc.- Returns:
- the file item's lock.
-
getPath
public java.lang.String getPath()
Gets the item's path (relative to the repository root). Applicable for remote info operation invocations, however if an info operation is invoked for Working Copy items, usegetFile()instead.- Returns:
- the item's path in the repository
-
getPropConflictFile
public java.io.File getPropConflictFile()
Gets the '.prej' file containing details on properties conflicts. If the item's properties are in conflict with those that came during an update this file will contain a conflict description. This is the value of the item'sSVNProperty.PROP_REJECT_FILEproperty.- Returns:
- the properties conflicts file
-
getPropTime
public java.util.Date getPropTime()
Gets the value of the item'sSVNProperty.PROP_TIMEproperty. It corresponds to the last time when properties were committed.- Returns:
- the value of the item's prop-time property
-
getRepositoryRootURL
public SVNURL getRepositoryRootURL()
Gets the repository root url (where the repository itself is installed). Applicable only for remote info operation invocations (for items in a repository).- Returns:
- the repository's root URL
-
getRepositoryUUID
public java.lang.String getRepositoryUUID()
Gets the repository Universal Unique IDentifier (UUID). This is the value of theSVNProperty.UUIDproperty.- Returns:
- the repository UUID
-
getRevision
public SVNRevision getRevision()
Gets the item's revision.- Returns:
- the item's revision
-
getSchedule
public java.lang.String getSchedule()
Gets the item's schedule status. Schedule status is inapplicable when running a remote info operation (for items in a repository). If it's a local info operation and the return value is null then it corresponds to the SVN's 'normal' schedule status.- Returns:
- the item's schedule status
-
getTextTime
public java.util.Date getTextTime()
Gets the value of the item'sSVNProperty.TEXT_TIMEproperty. It corresponds to the last commit time.- Returns:
- the value of the item's text-time property
-
getURL
public SVNURL getURL()
Gets the item's URL - its repository location.- Returns:
- the item's URL
-
getDepth
public SVNDepth getDepth()
Gets the item's depth.- Returns:
- depth value
- Since:
- 1.2.0, SVN 1.5.0
-
getChangelistName
public java.lang.String getChangelistName()
Gets the name of the changelist the item belongs to.- Returns:
- changelist name
- Since:
- 1.2.0, SVN 1.5.0
-
getWorkingSize
public long getWorkingSize()
Returns the size of the working copy file. Relevant for file items only.- Returns:
- working file size in bytes
- Since:
- 1.2.0, SVN 1.5.0
-
getRepositorySize
public long getRepositorySize()
Returns the size of the file in the repository. Relevant for file items only and in case of a remote operation (i.e. info fetched just from the working copy will always return -1 in this method).- Returns:
- repository file size in bytes
- Since:
- 1.2.0, SVN 1.5.0
-
getWorkingCopyRoot
public java.io.File getWorkingCopyRoot()
-
getMovedFromPath
public java.io.File getMovedFromPath()
-
getMovedToPath
public java.io.File getMovedToPath()
-
setWorkingCopyRoot
public void setWorkingCopyRoot(java.io.File root)
-
setMovedFromPath
public void setMovedFromPath(java.io.File movedFrom)
-
setMovedToPath
public void setMovedToPath(java.io.File movedTo)
-
-