|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.statsvn.util.SvnInfoUtils
public final class SvnInfoUtils
Utilities class that manages calls to svn info. Used to find repository information, latest revision numbers, and directories.
| Nested Class Summary | |
|---|---|
protected static class |
SvnInfoUtils.SvnInfoHandler
SAX parser for the svn info --xml command. |
| Method Summary | |
|---|---|
static java.lang.String |
absolutePathToUrl(java.lang.String absolute)
Converts an absolute path in the repository to a URL, using the repository URL |
static java.lang.String |
absoluteToRelativePath(java.lang.String absolute)
Converts an absolute path in the repository to a path relative to the working folder root. |
static void |
addDirectory(java.lang.String relativePath)
Adds a directory to the list of known directories. |
static 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). |
static java.lang.String |
getModuleName()
Assumes #loadInfo(String) has been called. |
static java.lang.String |
getRepositoryUrl()
Assumes #loadInfo() has been invoked. |
static java.lang.String |
getRepositoryUuid()
Assumes #loadInfo() has been invoked. |
static java.lang.String |
getRevisionNumber(java.lang.String relativePath)
Returns the revision number of the file in the working copy. |
static java.lang.String |
getRootRevisionNumber()
Assumes #loadInfo() has been invoked. |
static java.lang.String |
getRootUrl()
Assumes #loadInfo() has been invoked. |
protected static ProcessUtils |
getSvnInfo(boolean bRootOnly)
Invokes svn info. |
static boolean |
isDirectory(java.lang.String relativePath)
Returns true if the path has been identified as a directory. |
protected static boolean |
isQueryNeeded(boolean bRootOnly)
Do we need to re-invoke svn info? |
static void |
loadInfo()
Initializes our representation of the repository. |
protected static void |
loadInfo(boolean bRootOnly)
Loads the information from svn info if needed. |
static void |
loadInfo(ProcessUtils pUtils)
Loads the information from svn info if needed. |
static 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 |
static java.lang.String |
relativeToAbsolutePath(java.lang.String relative)
Converts a relative path in the working folder to an absolute path in the repository. |
static java.lang.String |
replace(java.lang.String originalPattern,
java.lang.String newPattern,
java.lang.String originalString)
This method is a 1.4 replacement of the String.replace(CharSequence, CharSequence) found in 1.5. |
protected static void |
setRepositoryUrl(java.lang.String repositoryUrl)
Sets the project's repository URL. |
protected static void |
setRootUrl(java.lang.String rootUrl)
Sets the project's root URL. |
static java.lang.String |
urlToAbsolutePath(java.lang.String url)
Converts a url to an absolute path in the repository. |
static java.lang.String |
urlToRelativePath(java.lang.String url)
Converts a url to a relative path in the repository. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.lang.String absoluteToRelativePath(java.lang.String absolute)
absolute - Example (assume getModuleName() returns /trunk/statsvn)
/trunk/statsvn/package.html
public static java.lang.String absolutePathToUrl(java.lang.String absolute)
absolute - Example: /trunk/statsvn/package.html
public static java.lang.String relativePathToUrl(java.lang.String relative)
relative - Example: src/Messages.java
public static java.lang.String relativeToAbsolutePath(java.lang.String relative)
relative - Example: src/Messages.java
public static boolean existsInWorkingCopy(java.lang.String relativePath)
relativePath - the path
public static java.lang.String getModuleName()
public static java.lang.String getRevisionNumber(java.lang.String relativePath)
relativePath - the filename
public static java.lang.String getRootRevisionNumber()
public static java.lang.String getRootUrl()
public static java.lang.String getRepositoryUuid()
public static java.lang.String getRepositoryUrl()
protected static ProcessUtils getSvnInfo(boolean bRootOnly)
bRootOnly - true if should we check for the root only or false otherwise
(recurse for all files)
public static boolean isDirectory(java.lang.String relativePath)
relativePath - the path
public static void addDirectory(java.lang.String relativePath)
relativePath - the relative path.protected static boolean isQueryNeeded(boolean bRootOnly)
bRootOnly - true if we need the root only
protected static void loadInfo(boolean bRootOnly)
throws net.sf.statcvs.input.LogSyntaxException,
java.io.IOException
bRootOnly - load only the root?
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.
public static void loadInfo(ProcessUtils pUtils)
throws net.sf.statcvs.input.LogSyntaxException,
java.io.IOException
pUtils - the process util that contains the input stream representing
an svn info command.
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.
public static void loadInfo()
throws net.sf.statcvs.input.LogSyntaxException,
java.io.IOException
net.sf.statcvs.input.LogSyntaxException - if the svn info --xml is malformed
java.io.IOException - if there is an error reading from the streampublic static java.lang.String urlToAbsolutePath(java.lang.String url)
url - Examples: svn://svn.statsvn.org/statsvn/trunk/statsvn,
svn://svn.statsvn.org/statsvn/trunk/statsvn/package.html
public static java.lang.String urlToRelativePath(java.lang.String url)
url - Examples: svn://svn.statsvn.org/statsvn/trunk/statsvn,
svn://svn.statsvn.org/statsvn/trunk/statsvn/package.html
protected static void setRootUrl(java.lang.String rootUrl)
rootUrl - protected static void setRepositoryUrl(java.lang.String repositoryUrl)
repositoryUrl -
public static java.lang.String replace(java.lang.String originalPattern,
java.lang.String newPattern,
java.lang.String originalString)
originalPattern - newPattern - originalString -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||