net.sf.statsvn.util

## Interface ISvnInfoProcessor

All Known Implementing Classes:
  SvnInfoUtils, SvnKitInfo

    public interface ISvnInfoProcessor

Performs svn info queries.

Author:
  jkealey

### Method Summary

Methods
`java.lang.String` `absolutePathToUrl(java.lang.String absolute)` Converts an absolute path in the repository to a URL, using the repository URL
`java.lang.String` `absoluteToRelativePath(java.lang.String absolute)` Converts an absolute path in the repository to a path relative to the working folder root.
`void` `addDirectory(java.lang.String relativePath)` Adds a directory to the list of known directories.
`void` `checkRepoRootAvailable()` Verifies that the "svn info" command can return the repository root (info available in svn >= 1.3.0)
`boolean` `existsInWorkingCopy(java.lang.String relativePath)` Returns true if the file exists in the working copy (according to the svn metadata, and not file system checks).
`java.lang.String` `getModuleName()` Assumes #loadInfo(String) has been called.
`java.lang.String` `getRepositoryUrl()` Assumes #loadInfo() has been invoked.
`java.lang.String` `getRepositoryUuid()` Assumes #loadInfo() has been invoked.
`java.lang.String` `getRevisionNumber(java.lang.String relativePath)` Returns the revision number of the file in the working copy.
`java.lang.String` `getRootRevisionNumber()` Assumes #loadInfo() has been invoked.
`java.lang.String` `getRootUrl()` Assumes #loadInfo() has been invoked.
`boolean` `isDirectory(java.lang.String relativePath)` Returns true if the path has been identified as a directory.
`void` `loadInfo()` Initializes our representation of the repository.
`void` `loadInfo(java.io.InputStream stream)` Loads the information from svn info if needed.
`java.lang.String` `relativePathToUrl(java.lang.String relative)` Converts a relative path in the working folder to a URL, using the working folder's root URL
`java.lang.String` `relativeToAbsolutePath(java.lang.String relative)` Converts a relative path in the working folder to an absolute path in the repository.
`java.lang.String` `urlToAbsolutePath(java.lang.String url)` Converts a url to an absolute path in the repository.
`java.lang.String` `urlToRelativePath(java.lang.String url)` Converts a url to a relative path in the repository.

### Method Detail

#### absoluteToRelativePath

    java.lang.String absoluteToRelativePath(java.lang.String absolute)

Converts an absolute path in the repository to a path relative to the working folder root. Will return null if absolute path does not start with getModuleName();

Parameters:
  `absolute` - Example (assume getModuleName() returns /trunk/statsvn) /trunk/statsvn/package.html
Returns:
  Example: package.html

#### absolutePathToUrl

    java.lang.String absolutePathToUrl(java.lang.String absolute)

Converts an absolute path in the repository to a URL, using the repository URL

Parameters:
  `absolute` - Example: /trunk/statsvn/package.html
Returns:
  Example: svn://svn.statsvn.org/statsvn/trunk/statsvn/package.html

#### relativePathToUrl

    java.lang.String relativePathToUrl(java.lang.String relative)

Converts a relative path in the working folder to a URL, using the working folder's root URL

Parameters:
  `relative` - Example: src/Messages.java
Returns:
  Example: svn://svn.statsvn.org/statsvn/trunk/statsvn/src/Messages.java

#### relativeToAbsolutePath

    java.lang.String relativeToAbsolutePath(java.lang.String relative)

Converts a relative path in the working folder to an absolute path in the repository.

Parameters:
  `relative` - Example: src/Messages.java
Returns:
  Example: /trunk/statsvn/src/Messages.java

#### existsInWorkingCopy

    boolean existsInWorkingCopy(java.lang.String relativePath)

Returns true if the file exists in the working copy (according to the svn metadata, and not file system checks).

Parameters:
  `relativePath` - the path
Returns:
  `true` if it exists

#### getModuleName

    java.lang.String getModuleName()

Assumes #loadInfo(String) has been called. Never ends with /, might be empty.

Returns:
  The absolute path of the root of the working folder in the repository.

#### getRevisionNumber

    java.lang.String getRevisionNumber(java.lang.String relativePath)

Returns the revision number of the file in the working copy.

Parameters:
  `relativePath` - the filename
Returns:
  the revision number if it exists in the working copy, null otherwise.

#### getRootRevisionNumber

    java.lang.String getRootRevisionNumber()

Assumes #loadInfo() has been invoked.

Returns:
  the root of the working folder's revision number (last checked out revision number)

#### getRootUrl

    java.lang.String getRootUrl()

Assumes #loadInfo() has been invoked.

Returns:
  the root of the working folder's url (example: svn://svn.statsvn.org/statsvn/trunk/statsvn)

#### getRepositoryUuid

    java.lang.String getRepositoryUuid()

Assumes #loadInfo() has been invoked.

Returns:
  the uuid of the repository

#### getRepositoryUrl

    java.lang.String getRepositoryUrl()

Assumes #loadInfo() has been invoked.

Returns:
  the repository url (example: svn://svn.statsvn.org/statsvn)

#### isDirectory

    boolean isDirectory(java.lang.String relativePath)

Returns true if the path has been identified as a directory.

Parameters:
  `relativePath` - the path
Returns:
  true if it is a known directory.

#### addDirectory

    void addDirectory(java.lang.String relativePath)

Adds a directory to the list of known directories. Used when inferring implicit actions on deleted paths.

Parameters:
  `relativePath` - the relative path.

#### loadInfo

    void loadInfo(java.io.InputStream stream)
                  throws net.sf.statcvs.input.LogSyntaxException,
                         java.io.IOException

Loads the information from svn info if needed.

Parameters:
  `stream` - the input stream representing an svn info command.
Throws:
  `net.sf.statcvs.input.LogSyntaxException` - if the format of the svn info is invalid
  `java.io.IOException` - if we can't read from the response stream.

#### loadInfo

    void loadInfo()
                  throws net.sf.statcvs.input.LogSyntaxException,
                         java.io.IOException

Initializes our representation of the repository.

Throws:
  `net.sf.statcvs.input.LogSyntaxException` - if the svn info --xml is malformed
  `java.io.IOException` - if there is an error reading from the stream

#### urlToAbsolutePath

    java.lang.String urlToAbsolutePath(java.lang.String url)

Converts a url to an absolute path in the repository.

Parameters:
  `url` - Examples: svn://svn.statsvn.org/statsvn/trunk/statsvn, svn://svn.statsvn.org/statsvn/trunk/statsvn/package.html
Returns:
  Example: /trunk/statsvn, /trunk/statsvn/package.html

#### urlToRelativePath

    java.lang.String urlToRelativePath(java.lang.String url)

Converts a url to a relative path in the repository.

Parameters:
  `url` - Examples: svn://svn.statsvn.org/statsvn/trunk/statsvn, svn://svn.statsvn.org/statsvn/trunk/statsvn/package.html
Returns:
  Example: ".", package.html

#### checkRepoRootAvailable

    void checkRepoRootAvailable()
                                throws SvnVersionMismatchException

Verifies that the "svn info" command can return the repository root (info available in svn >= 1.3.0)

Throws:
  `SvnVersionMismatchException` - if `svn info` failed to provide a non-empty repository root