org.tmatesoft.svn.core

Class SVNDirEntry

Implemented Interfaces:
Comparable

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

int
compareTo(Object o)
Compares this object with another one.
String
getAuthor()
Retrieves the name of the author who last changed this entry.
String
getCommitMessage()
Returns the commit log message for the revision of this entry.
Date
getDate()
Returns the date the entry was last changed.
SVNNodeKind
getKind()
Returns the entry node kind.
SVNLock
getLock()
Gets the lock object for this entry (if it's locked).
String
getName()
Gets the the directory entry name
String
getPath()
Deprecated. use getRelativePath() instead.
String
getRelativePath()
Returns the entry's path.
long
getRevision()
Gets the last changed revision of this entry.
long
getSize()
Returns the file size in bytes (if this entry is a file).
SVNURL
getURL()
Returns the entry's URL.
boolean
hasProperties()
Tells if the entry has any properties.
void
setCommitMessage(String message)
This method is used by SVNKit internals and not intended for users (from an API point of view).
void
setLock(SVNLock lock)
Sets the lock object for this entry (if it's locked).
void
setRelativePath(String path)
This method is used by SVNKit internals and not intended for users (from an API point of view).
long
size()
Deprecated. use getSize() instead
String
toString()
Retirns a string representation of this object.

Constructor Details

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 Details

compareTo

public int compareTo(Object o)
Compares this object with another one.
Parameters:
o - an object to compare with
Returns:
  • -1 - if o is either null, or is not an instance of SVNDirEntry, or this entry's URL is lexicographically less than the name of o;
  • 1 - if this entry's URL is lexicographically greater than the name of o;
  • 0 - if and only if o has got the same URL as this one has

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.
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-2006 TMate Software Ltd. All Rights Reserved.