Class SVNDirEntry

java.lang.Object
org.tmatesoft.svn.core.SVNDirEntry
All Implemented Interfaces:
java.lang.Comparable

public class SVNDirEntry extends java.lang.Object implements java.lang.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
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static 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.
    private java.lang.String
     
    private java.util.Date
     
    private SVNURL
     
    private java.lang.String
     
    private boolean
     
    private SVNNodeKind
     
    private java.lang.String
     
    private SVNLock
     
    private java.lang.String
     
    private java.lang.String
     
    private SVNURL
     
    private long
     
    private long
     
    private SVNURL
     
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    int
    compareTo(java.lang.Object o)
    Compares this object with another one.
    java.lang.String
    Retrieves the name of the author who last changed this entry.
    java.lang.String
    Returns the commit log message for the revision of this entry.
    java.util.Date
    Returns the date the entry was last changed.
     
    java.lang.String
     
    Returns the entry node kind.
    Gets the lock object for this entry (if it's locked).
    java.lang.String
    Gets the the directory entry name
    java.lang.String
    Deprecated.
    use getRelativePath() instead.
    java.lang.String
    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
    Returns the file size in bytes (if this entry is a file).
    Returns the entry's URL.
    boolean
    Tells if the entry has any properties.
    void
    setCommitMessage(java.lang.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(java.lang.String myExternalTarget)
     
    void
    Sets the lock object for this entry (if it's locked).
    void
    setName(java.lang.String name)
    This method is used by SVNKit internals and not intended for users (from an API point of view).
    void
    setRelativePath(java.lang.String path)
    This method is used by SVNKit internals and not intended for users (from an API point of view).
    long
    Deprecated.
    use getSize() instead
    java.lang.String
    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:
    • DIRENT_SIZE

      public static final int DIRENT_SIZE
      Represents file size (if the entry is a file).
      Since:
      1.2.0
      See Also:
    • 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:
    • 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:
    • DIRENT_TIME

      public static final int DIRENT_TIME
      Represents the time of the last changed revision.
      Since:
      1.2.0
      See Also:
    • DIRENT_LAST_AUTHOR

      public static final int DIRENT_LAST_AUTHOR
      Represents the author of the last changed revision.
      Since:
      1.2.0
      See Also:
    • 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:
    • DIRENT_ALL

      public static final int DIRENT_ALL
      Represents a combination of all the entry fields.
      Since:
      1.2.0
      See Also:
    • myName

      private java.lang.String myName
    • myKind

      private SVNNodeKind myKind
    • mySize

      private long mySize
    • myHasProperties

      private boolean myHasProperties
    • myRevision

      private long myRevision
    • myCreatedDate

      private java.util.Date myCreatedDate
    • myLastAuthor

      private java.lang.String myLastAuthor
    • myPath

      private java.lang.String myPath
    • myCommitMessage

      private java.lang.String myCommitMessage
    • myLock

      private SVNLock myLock
    • myURL

      private SVNURL myURL
    • myRepositoryRoot

      private SVNURL myRepositoryRoot
    • myExternalParentUrl

      private SVNURL myExternalParentUrl
    • myExternalTarget

      private java.lang.String myExternalTarget
  • Constructor Details

    • SVNDirEntry

      public SVNDirEntry(SVNURL url, SVNURL repositoryRoot, java.lang.String name, SVNNodeKind kind, long size, boolean hasProperties, long revision, java.util.Date createdDate, java.lang.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, java.lang.String name, SVNNodeKind kind, long size, boolean hasProperties, long revision, java.util.Date createdDate, java.lang.String lastAuthor, java.lang.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 java.lang.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:
    • getDate

      public java.util.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 java.lang.String getAuthor()
      Retrieves the name of the author who last changed this entry.
      Returns:
      the last author's name.
    • getRelativePath

      public java.lang.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 java.lang.String getPath()
      Deprecated.
      use getRelativePath() instead.
      Returns:
      repository path
    • getCommitMessage

      public java.lang.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(java.lang.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(java.lang.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(java.lang.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 java.lang.String getExternalTarget()
    • setExternalTarget

      public void setExternalTarget(java.lang.String myExternalTarget)
    • toString

      public java.lang.String toString()
      Retirns a string representation of this object.
      Overrides:
      toString in class java.lang.Object
      Returns:
      a string representation of this directory entry
    • compareTo

      public int compareTo(java.lang.Object o)
      Compares this object with another one.
      Specified by:
      compareTo in interface java.lang.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