Class SVNDirEntry
- All Implemented Interfaces:
Comparable
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Represents a combination of all the entry fields.static final int
Represents commit log message for the last changed revision.static final int
Represents the last revision when the entry was changed.static final int
Contains the information whether the entry has any properties.static final int
Represents entry kind (if it is a file or a directory).static final int
Represents the author of the last changed revision.static final int
Represents file size (if the entry is a file).static final int
Represents the time of the last changed revision. -
Constructor Summary
ConstructorsConstructorDescriptionSVNDirEntry
(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 TypeMethodDescriptionint
Compares this object with another one.Retrieves the name of the author who last changed this entry.Returns the commit log message for the revision of this entry.getDate()
Returns the date the entry was last changed.getKind()
Returns the entry node kind.getLock()
Gets the lock object for this entry (if it's locked).getName()
Gets the the directory entry namegetPath()
Deprecated.Returns the entry's path relative to the target directory.Returns the entry's repository root URL.long
Gets the last changed revision of this entry.long
getSize()
Returns the file size in bytes (if this entry is a file).getURL()
Returns the entry's URL.boolean
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
Sets the lock object for this entry (if it's locked).void
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.usegetSize()
insteadtoString()
Retirns a string representation of this object.
-
Field Details
-
DIRENT_KIND
public static final int DIRENT_KINDRepresents entry kind (if it is a file or a directory).- Since:
- 1.2.0
- See Also:
-
DIRENT_SIZE
public static final int DIRENT_SIZERepresents file size (if the entry is a file).- Since:
- 1.2.0
- See Also:
-
DIRENT_HAS_PROPERTIES
public static final int DIRENT_HAS_PROPERTIESContains the information whether the entry has any properties.- Since:
- 1.2.0
- See Also:
-
DIRENT_CREATED_REVISION
public static final int DIRENT_CREATED_REVISIONRepresents the last revision when the entry was changed.- Since:
- 1.2.0
- See Also:
-
DIRENT_TIME
public static final int DIRENT_TIMERepresents the time of the last changed revision.- Since:
- 1.2.0
- See Also:
-
DIRENT_LAST_AUTHOR
public static final int DIRENT_LAST_AUTHORRepresents the author of the last changed revision.- Since:
- 1.2.0
- See Also:
-
DIRENT_COMMIT_MESSAGE
public static final int DIRENT_COMMIT_MESSAGERepresents commit log message for the last changed revision.- Since:
- 1.2.0
- See Also:
-
DIRENT_ALL
public static final int DIRENT_ALLRepresents a combination of all the entry fields.- Since:
- 1.2.0
- See Also:
-
-
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 entryrepositoryRoot
- a url of the root of repository this entry belongs toname
- an entry namekind
- the node kind for the entrysize
- the entry size in byteshasProperties
- true if the entry has properties, otherwise falserevision
- the last changed revision of the entrycreatedDate
- the date the entry was last changedlastAuthor
- 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 entryrepositoryRoot
- a url of the root of repository this entry belongs toname
- an entry namekind
- the node kind for the entrysize
- the entry size in byteshasProperties
- true if the entry has properties, otherwise falserevision
- the last changed revision of the entrycreatedDate
- the date the entry was last changedlastAuthor
- the person who last changed the entrycommitMessage
- the log message of the last change commit
-
-
Method Details
-
getURL
Returns the entry's URL.- Returns:
- this entry's URL.
-
getRepositoryRoot
Returns the entry's repository root URL.- Returns:
- the URL of repository root.
-
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.usegetSize()
insteadReturns 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
Returns the entry node kind.- Returns:
- the node kind of this entry
- See Also:
-
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
Retrieves the name of the author who last changed this entry.- Returns:
- the last author's name.
-
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
Deprecated.usegetRelativePath()
instead.- Returns:
- repository path
-
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 theSVNRepository.getDir(String, long, boolean, java.util.Collection)
method.- Returns:
- a commit log message
-
getLock
Gets the lock object for this entry (if it's locked).- Returns:
- a lock object or null
-
setName
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
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
This method is used by SVNKit internals and not intended for users (from an API point of view).- Parameters:
message
- a commit message
-
setLock
Sets the lock object for this entry (if it's locked).- Parameters:
lock
- a lock object
-
getExternalParentUrl
-
setExternalParentUrl
-
getExternalTarget
-
setExternalTarget
-
toString
Retirns a string representation of this object. -
compareTo
Compares this object with another one.- Specified by:
compareTo
in interfaceComparable
- 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 ofo
; - 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
- -1 - if
-
getRelativePath()
instead.