Class SVNUrl
- java.lang.Object
-
- org.tigris.subversion.svnclientadapter.SVNUrl
-
public class SVNUrl extends java.lang.Object
We could have used URL, using custom protocols (svn, svn+ssl) (@see http://developer.java.sun.com/developer/onlineTraining/protocolhandlers/) but this is not really necessary as we don't want to open a connection directly with this class. We just want a string which represent a SVN url which can be used with our JNI methods. An SVNUrl is immutable.- Author:
- C�dric Chabanois cchabanois@ifrance.com
-
-
Field Summary
Fields Modifier and Type Field Description protected static char
SEGMENT_SEPARATOR
-
Constructor Summary
Constructors Constructor Description SVNUrl(java.lang.String svnUrl)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SVNUrl
appendPath(java.lang.String path)
Asnwer a new SVNUrl with added segmentsboolean
equals(java.lang.Object target)
static int
getDefaultPort(java.lang.String protocol)
get the default port for given protocoljava.lang.String
getHost()
java.lang.String
getLastPathSegment()
SVNUrl
getParent()
Return new SVNUrl which represents parent of the receiverjava.lang.String[]
getPathSegments()
get the path of the url.int
getPort()
java.lang.String
getProtocol()
get the protocolint
hashCode()
java.lang.String
toString()
-
-
-
Field Detail
-
SEGMENT_SEPARATOR
protected static final char SEGMENT_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
appendPath
public SVNUrl appendPath(java.lang.String path)
Asnwer a new SVNUrl with added segments- Parameters:
path
- a String of path segment(s) to ba appended to receiver- Returns:
- new SVNUrl
-
getDefaultPort
public static int getDefaultPort(java.lang.String protocol)
get the default port for given protocol- Parameters:
protocol
-- Returns:
- port number or -1 if protocol is unknown
-
getProtocol
public java.lang.String getProtocol()
get the protocol- Returns:
- either http, https, file, svn or svn+ssh
-
getHost
public java.lang.String getHost()
- Returns:
- Returns the host.
-
getPort
public int getPort()
- Returns:
- Returns the port.
-
getPathSegments
public java.lang.String[] getPathSegments()
get the path of the url.- Returns:
- an arrray of url path segments
-
getLastPathSegment
public java.lang.String getLastPathSegment()
- Returns:
- the "file" name, i.e. the element after last /
-
getParent
public SVNUrl getParent()
Return new SVNUrl which represents parent of the receiver- Returns:
- the parent url or null if no parent
-
equals
public boolean equals(java.lang.Object target)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-