org.tmatesoft.svn.core

Class SVNDirEntry

public class SVNDirEntry extends Object implements Comparable

The SVNDirEntry class is a representation of a versioned directory entry.

SVNDirEntry keeps an entry name, entry kind (is it a file or directory), file size (in case an entry is a file), the last changed revision, the date when the entry was last changed, the name of the author who last changed the entry, the commit log message for the last changed revision. SVNDirEntry also knows if the entry has any properties.

Version: 1.1.1

Author: TMate Software Ltd.

See Also: ISVNDirEntryHandler

Constructor Summary
SVNDirEntry(SVNURL url, String name, SVNNodeKind kind, long size, boolean hasProperties, long revision, Date createdDate, String lastAuthor)
Constructs an instance of SVNDirEntry.
SVNDirEntry(SVNURL url, String name, SVNNodeKind kind, long size, boolean hasProperties, long revision, Date createdDate, String lastAuthor, String commitMessage)
Constructs an instance of SVNDirEntry.
Method Summary
intcompareTo(Object o)
Compares this object with another one.
StringgetAuthor()
Retrieves the name of the author who last changed this entry.
StringgetCommitMessage()
Returns the commit log message for the revision of this entry.
DategetDate()
Returns the date the entry was last changed.
SVNNodeKindgetKind()
Returns the entry node kind.
SVNLockgetLock()
Gets the lock object for this entry (if it's locked).
StringgetName()
Gets the the directory entry name
StringgetPath()
StringgetRelativePath()
Returns the entry's path.
longgetRevision()
Gets the last changed revision of this entry.
longgetSize()
Returns the file size in bytes (if this entry is a file).
SVNURLgetURL()
Returns the entry's URL.
booleanhasProperties()
Tells if the entry has any properties.
voidsetCommitMessage(String message)
This method is used by SVNKit internals and not intended for users (from an API point of view).
voidsetLock(SVNLock lock)
Sets the lock object for this entry (if it's locked).
voidsetRelativePath(String path)
This method is used by SVNKit internals and not intended for users (from an API point of view).
longsize()
Returns the file size in bytes (if this entry is a file).
StringtoString()
Retirns a string representation of this object.

Constructor Detail

SVNDirEntry

public SVNDirEntry(SVNURL url, String name, SVNNodeKind kind, long size, boolean hasProperties, long revision, Date createdDate, String lastAuthor)
Constructs an instance of SVNDirEntry.

Parameters: url a url of this entry name an entry name kind the node kind for the entry size the entry size in bytes hasProperties true if the entry has properties, otherwise false revision the last changed revision of the entry createdDate the date the entry was last changed lastAuthor the person who last changed the entry

SVNDirEntry

public SVNDirEntry(SVNURL url, String name, SVNNodeKind kind, long size, boolean hasProperties, long revision, Date createdDate, String lastAuthor, String commitMessage)
Constructs an instance of SVNDirEntry.

Parameters: url a url of this entry name an entry name kind the node kind for the entry size the entry size in bytes hasProperties true if the entry has properties, otherwise false revision the last changed revision of the entry createdDate the date the entry was last changed lastAuthor the person who last changed the entry commitMessage the log message of the last change commit

Method Detail

compareTo

public int compareTo(Object o)
Compares this object with another one.

Parameters: o an object to compare with

Returns:

getAuthor

public String getAuthor()
Retrieves the name of the author who last changed this entry.

Returns: the last author's name.

getCommitMessage

public String getCommitMessage()
Returns the commit log message for the revision of this entry.

Returns: a commit log message

getDate

public Date getDate()
Returns the date the entry was last changed.

Returns: the datestamp when the entry was last changed

getKind

public SVNNodeKind getKind()
Returns the entry node kind.

Returns: the node kind of this entry

See Also: SVNNodeKind

getLock

public SVNLock getLock()
Gets the lock object for this entry (if it's locked).

Returns: a lock object or null

getName

public String getName()
Gets the the directory entry name

Returns: the name of this entry

getPath

public String getPath()

Deprecated: use getRelativePath instead.

getRelativePath

public String getRelativePath()
Returns the entry's path.

This method always returns the name of an entry (i.e. a path relative to the parent folder) when an SVNDirEntry object is provided by an SVNRepository driver.

This property (relative path) is longer than just an entry name only when an SVNDirEntry object is obtained via a recursive call to a doList() method of the SVNLogClient class. In that case an SVNDirEntry object located deep in the hierarchy will return a path relative to the URL doList() was called for.

Returns: a path relative to a repository location or null if no path is specified

getRevision

public long getRevision()
Gets the last changed revision of this entry.

Returns: the revision of this entry when it was last changed

getSize

public long getSize()
Returns the file size in bytes (if this entry is a file).

Returns: the size of this entry in bytes

getURL

public SVNURL getURL()
Returns the entry's URL.

Returns: this entry's URL.

hasProperties

public boolean hasProperties()
Tells if the entry has any properties.

Returns: true if has, false otherwise

setCommitMessage

public void setCommitMessage(String message)
This method is used by SVNKit internals and not intended for users (from an API point of view).

Parameters: message a commit message

setLock

public void setLock(SVNLock lock)
Sets the lock object for this entry (if it's locked).

Parameters: lock a lock object

setRelativePath

public void setRelativePath(String path)
This method is used by SVNKit internals and not intended for users (from an API point of view).

Parameters: path this entry's path

size

public long size()

Deprecated: use getSize instead

Returns the file size in bytes (if this entry is a file).

Returns: the size of this entry in bytes

toString

public String toString()
Retirns a string representation of this object.

Returns: a string representation of this directory entry

Copyright © 2004-2007 TMate Software Ltd. All Rights Reserved.