org.tmatesoft.svn.core.wc
Class SVNInfo
The
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) {
...
}
}
...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);
...
SVNInfo(File file, SVNURL url, SVNURL rootURL, long revision, SVNNodeKind kind, String uuid, long committedRevision, String committedDate, String author, String schedule, SVNURL copyFromURL, long copyFromRevision, String textTime, String propTime, String checksum, String conflictOld, String conflictNew, String conflictWorking, String propRejectFile, SVNLock lock)
|
SVNInfo(String path, SVNURL url, SVNRevision revision, SVNNodeKind kind, String uuid, SVNURL reposRootURL, long comittedRevision, Date date, String author, SVNLock lock)
|
SVNInfo
protected SVNInfo(File file,
SVNURL url,
SVNURL rootURL,
long revision,
SVNNodeKind kind,
String uuid,
long committedRevision,
String committedDate,
String author,
String schedule,
SVNURL copyFromURL,
long copyFromRevision,
String textTime,
String propTime,
String checksum,
String conflictOld,
String conflictNew,
String conflictWorking,
String propRejectFile,
SVNLock lock)
getAuthor
public String getAuthor()
- the author who last changed (committed) the item
getChecksum
public String getChecksum()
getCommittedDate
public Date getCommittedDate()
- the item's last commit date
getCommittedRevision
public SVNRevision getCommittedRevision()
- the item's last committed revision.
getConflictNewFile
public 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_NEW
property.
- an autogenerated temporary file just as it is in the latest
revision in the repository
getConflictOldFile
public 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_OLD
property.
- an autogenerated temporary file just as the conflicting file was
before any modifications to it
getConflictWrkFile
public 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_WRK
property.
- an autogenerated temporary file with only the user's modifications
getCopyFromRevision
public SVNRevision getCopyFromRevision()
Gets the revision of the item's ancestor from which the item was
copied.
getCopyFromURL
public SVNURL getCopyFromURL()
Gets the URL (repository location) of the ancestor from which the
item was copied.
getFile
public File getFile()
Gets the item's local path. Applicable for local info operation
invocations, however if an info operation is invoked for remote
items, use
getPath() instead.
getKind
public SVNNodeKind getKind()
Gets the item's node kind. Used to find out whether the item is
a file, directory, etc.
getLock
public SVNLock getLock()
Gets the file item's lock. Used to get lock information - lock
token, comment, etc.
getPath
public 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, use
getFile() instead.
- the item's path in the repository
getPropConflictFile
public 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's
SVNProperty.PROP_REJECT_FILE
property.
- the properties conflicts file
getPropTime
public Date getPropTime()
Gets the value of the item's
SVNProperty.PROP_TIME property.
It corresponds to the last time when properties were committed.
- 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).
- the repository's root URL
getRepositoryUUID
public String getRepositoryUUID()
Gets the repository Universal Unique IDentifier (UUID). This is the
value of the
SVNProperty.UUID
property.
getRevision
public SVNRevision getRevision()
Gets the item's revision.
getSchedule
public 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.
- the item's schedule status
getTextTime
public Date getTextTime()
- the value of the item's text-time property
getURL
public SVNURL getURL()
Gets the item's URL - its repository location.
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 an
SVNWCClient'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.
- true if the item is located
in a repository, otherwise false
and the item is in a Working Copy
Copyright © 2004-2006 TMate Software Ltd. All Rights Reserved.