Package org.tmatesoft.svn.core

# Class SVNDirEntry

java.lang.Object
org.tmatesoft.svn.core.SVNDirEntry

All 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.

Since:
  1.2
Version:
  1.3
Author:
  TMate Software Ltd.
See Also:
  - `ISVNDirEntryHandler`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`DIRENT_ALL`
Represents a combination of all the entry fields.
`static final int`
`DIRENT_COMMIT_MESSAGE`
Represents commit log message for the last changed revision.
`static final int`
`DIRENT_CREATED_REVISION`
Represents the last revision when the entry was changed.
`static final int`
`DIRENT_HAS_PROPERTIES`
Contains the information whether the entry has any properties.
`static final int`
`DIRENT_KIND`
Represents entry kind (if it is a file or a directory).
`static final int`
`DIRENT_LAST_AUTHOR`
Represents the author of the last changed revision.
`static final int`
`DIRENT_SIZE`
Represents file size (if the entry is a file).
`static final int`
`DIRENT_TIME`
Represents the time of the last changed revision.

## Constructor Summary

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

## Method Summary

Modifier and Type
Method
Description
`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.
`SVNURL`
`getExternalParentUrl()`
`String`
`getExternalTarget()`
`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 relative to the target directory.
`SVNURL`
`getRepositoryRoot()`
Returns the entry's repository root URL.
`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`
`setExternalParentUrl(SVNURL myExternalParentUrl)`
`void`
`setExternalTarget(String myExternalTarget)`
`void`
`setLock(SVNLock lock)`
Sets the lock object for this entry (if it's locked).
`void`
`setName(String name)`
This method is used by SVNKit internals and not intended for users (from an API point of view).
`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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### DIRENT_KIND

public static final int DIRENT_KIND
Represents entry kind (if it is a file or a directory).

Since:
  1.2.0
See Also:
  - Constant Field Values

### DIRENT_SIZE

public static final int DIRENT_SIZE
Represents file size (if the entry is a file).

Since:
  1.2.0
See Also:
  - Constant Field Values

### DIRENT_HAS_PROPERTIES

public static final int DIRENT_HAS_PROPERTIES
Contains the information whether the entry has any properties.

Since:
  1.2.0
See Also:
  - Constant Field Values

### DIRENT_CREATED_REVISION

public static final int DIRENT_CREATED_REVISION
Represents the last revision when the entry was changed.

Since:
  1.2.0
See Also:
  - Constant Field Values

### DIRENT_TIME

public static final int DIRENT_TIME
Represents the time of the last changed revision.

Since:
  1.2.0
See Also:
  - Constant Field Values

### DIRENT_LAST_AUTHOR

public static final int DIRENT_LAST_AUTHOR
Represents the author of the last changed revision.

Since:
  1.2.0
See Also:
  - Constant Field Values

### DIRENT_COMMIT_MESSAGE

public static final int DIRENT_COMMIT_MESSAGE
Represents commit log message for the last changed revision.

Since:
  1.2.0
See Also:
  - Constant Field Values

### DIRENT_ALL

public static final int DIRENT_ALL
Represents a combination of all the entry fields.

Since:
  1.2.0
See Also:
  - Constant Field Values

## Constructor Details

### SVNDirEntry

public SVNDirEntry(SVNURL url, SVNURL repositoryRoot, 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
  `repositoryRoot` - a url of the root of repository this entry belongs to
  `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, SVNURL repositoryRoot, 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
  `repositoryRoot` - a url of the root of repository this entry belongs to
  `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

### getURL

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

Returns:
  this entry's URL.

### getRepositoryRoot

public SVNURL getRepositoryRoot()
Returns the entry's repository root URL.

Returns:
  the URL of repository root.

### getName

public String getName()
Gets the the directory entry name

Returns:
  the name of this entry

### getSize

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

Returns:
  the size of this entry in bytes

### 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

### hasProperties

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

Returns:
  true if has, false otherwise

### getKind

public SVNNodeKind getKind()
Returns the entry node kind.

Returns:
  the node kind of this entry
See Also:
  - `SVNNodeKind`

### getDate

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

Returns:
  the datestamp when the entry was last changed

### getRevision

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

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

### getAuthor

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

Returns:
  the last author's name.

### getRelativePath

public String getRelativePath()
Returns the entry's path relative to the target directory.

This method is guaranteed to return a non-null path only for `list` operations. It always returns a path relative to the target location which a list operation is launched on. When listing a directory the relative path for the target directory itself is `""`, for its children - just their names, for deeper directories (when listing recursively) - paths relative to the target directory path.

Returns:
  path relative to the target directory

### getPath

public String getPath()
Deprecated.
use `getRelativePath()` instead.

Returns:
  repository path

### getCommitMessage

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

This is guaranteed to be non-null only for the target entry returned by the `SVNRepository.getDir(String, long, boolean, java.util.Collection)` method.

Returns:
  a commit log message

### getLock

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

Returns:
  a lock object or null

### setName

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

Parameters:
  `name` - this entry's name

### 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

### 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

### getExternalParentUrl

public SVNURL getExternalParentUrl()

### setExternalParentUrl

public void setExternalParentUrl(SVNURL myExternalParentUrl)

### getExternalTarget

public String getExternalTarget()

### setExternalTarget

public void setExternalTarget(String myExternalTarget)

### toString

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

Overrides:
  `toString` in class `Object`
Returns:
  a string representation of this directory entry

### compareTo

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

Specified by:
  `compareTo` in interface `Comparable`
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