public class SVNURL
extends java.lang.Object
To create a new SVNURL representation, pass an original url string (like "http://userInfo@host:port/path") to a corresponding parse method of this class.
Modifier and Type | Method and Description |
---|---|
SVNURL |
appendPath(java.lang.String segment,
boolean uriEncoded)
Constructs a new SVNURL representation appending a new path
segment to the path component of this representation.
|
static SVNURL |
create(java.lang.String protocol,
java.lang.String userInfo,
java.lang.String host,
int port,
java.lang.String path,
boolean uriEncoded)
Creates a new SVNURL representation from the given url
components.
|
boolean |
equals(java.lang.Object obj)
Compares this object with another one.
|
static SVNURL |
fromFile(java.io.File repositoryPath)
Creates a "file:///" SVNURL
representation given a filesystem style repository path.
|
static int |
getDefaultPortNumber(java.lang.String protocol)
Returns the default port number for the specified protocol.
|
java.lang.String |
getHost()
Returns the host component of the url represented by this object.
|
java.lang.String |
getPath()
Returns the path component of the url represented by this object
as a uri-decoded string
|
int |
getPort()
Returns the port number specified (or default) for the host.
|
java.lang.String |
getProtocol()
Returns the protocol component of the url represented by this
object.
|
java.lang.String |
getURIEncodedPath()
Returns the path component of the url represented by this object
as a uri-encoded string
|
java.lang.String |
getUserInfo()
Returns the user info component of the url represented by this
object.
|
int |
hashCode()
Calculates and returns a hash code for this object.
|
boolean |
hasPort()
Says if the url is provided with a non-default port number or not.
|
static SVNURL |
parseURIDecoded(java.lang.String url)
Deprecated.
|
static SVNURL |
parseURIEncoded(java.lang.String url)
Parses the given UTF-8 encoded url string and creates a new
SVNURL representation for this url.
|
static void |
registerProtocol(java.lang.String protocolName,
int defaultPort)
Sets the default protocol for a repository access protocol.
|
SVNURL |
removePathTail()
Constructs a new SVNURL representation removing a tail path
segment from the path component of this representation.
|
SVNURL |
setPath(java.lang.String path,
boolean uriEncoded)
Creates a new SVNURL object replacing a path component of
this object with a new provided one.
|
java.lang.String |
toDecodedString()
Returns a string representing a decoded url.
|
java.lang.String |
toString()
Returns a string representing a UTF-8 encoded url.
|
public static SVNURL create(java.lang.String protocol, java.lang.String userInfo, java.lang.String host, int port, java.lang.String path, boolean uriEncoded) throws SVNException
protocol
- a protocol componentuserInfo
- a user info componenthost
- a host componentport
- a port numberpath
- a path componenturiEncoded
- true if
path
is UTF-8 encoded,
false
otherwiseSVNException
- if the resultant url (composed of the given
components) is malformed@Deprecated public static SVNURL parseURIDecoded(java.lang.String url) throws SVNException
url
- an input url string (like 'http://myhost/mypath')url
SVNException
- if url
is malformedpublic static SVNURL parseURIEncoded(java.lang.String url) throws SVNException
url
- an input url string (like 'http://myhost/my%20path')url
SVNException
- if url
is malformedpublic static SVNURL fromFile(java.io.File repositoryPath) throws SVNException
repositoryPath
- a repository path as a filesystem pathSVNException
public static int getDefaultPortNumber(java.lang.String protocol)
protocol
- a particular access protocolpublic static void registerProtocol(java.lang.String protocolName, int defaultPort)
protocolName
- protocol namedefaultPort
- default port valuepublic java.lang.String getProtocol()
http
)public java.lang.String getHost()
public int getPort()
public boolean hasPort()
getPort()
public java.lang.String getPath()
public java.lang.String getURIEncodedPath()
public java.lang.String getUserInfo()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toDecodedString()
public SVNURL appendPath(java.lang.String segment, boolean uriEncoded) throws SVNException
segment
- a new path segmenturiEncoded
- true if
segment
is UTF-8 encoded,
false
otherwiseSVNException
- if a parse error occurredpublic SVNURL setPath(java.lang.String path, boolean uriEncoded) throws SVNException
path
- a path componenturiEncoded
- true if path
is UTF-8 encodedSVNException
- if a parse error occurredpublic SVNURL removePathTail() throws SVNException
SVNException
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- an object to compare withobj
is an instance of SVNURL and has got the same
url components as this object haspublic int hashCode()
hashCode
in class java.lang.Object
Copyright © 2004-2012 TMate Software Ltd. All Rights Reserved.