| java.lang.Object org.tmatesoft.svn.core.SVNURL
SVNURL | public class SVNURL (Code) | | The SVNURL class is used for representing urls. Those SVNKit
API methods, that need repository locations to carry out an operation,
receive a repository location url represented by SVNURL. This
class does all the basic work for a caller: parses an original url
string (splitting it to components), encodes/decodes a path component
to/from the UTF-8 charset, checks for validity (such as protocol support
- if SVNKit does not support a particular protocol, SVNURL
throws a corresponding exception).
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.
version: 1.1.1 author: TMate Software Ltd. See Also: Examples |
Method Summary | |
public SVNURL | appendPath(String segment, boolean uriEncoded) Constructs a new SVNURL representation appending a new path
segment to the path component of this representation. | public static SVNURL | create(String protocol, String userInfo, String host, int port, String path, boolean uriEncoded) Creates a new SVNURL representation from the given url
components. | public boolean | equals(Object obj) Compares this object with another one. | public static SVNURL | fromFile(File repositoryPath) Creates a "file:///" SVNURL
representation given a filesystem style repository path. | public static int | getDefaultPortNumber(String protocol) Returns the default port number for the specified protocol. | public String | getHost() Returns the host component of the url represented by this object. | public String | getPath() | public int | getPort() Returns the port number specified (or default) for the host. | public String | getProtocol() Returns the protocol component of the url represented by this
object. | public String | getURIEncodedPath() | public String | getUserInfo() Returns the user info component of the url represented by this
object. | public boolean | hasPort() Says if the url is provided with a non-default port number or not. | public int | hashCode() Calculates and returns a hash code for this object. | public static SVNURL | parseURIDecoded(String url) Parses the given decoded (not UTF-8 encoded) url string and creates
a new SVNURL representation for this url. | public static SVNURL | parseURIEncoded(String url) Parses the given UTF-8 encoded url string and creates a new
SVNURL representation for this url. | public static void | registerProtocol(String protocolName, int defaultPort) | public SVNURL | removePathTail() Constructs a new SVNURL representation removing a tail path
segment from the path component of this representation. | public SVNURL | setPath(String path, boolean uriEncoded) Creates a new SVNURL object replacing a path component of
this object with a new provided one. | public String | toDecodedString() Returns a string representing a decoded url. | public String | toString() Returns a string representing a UTF-8 encoded url. |
appendPath | public SVNURL appendPath(String segment, boolean uriEncoded) throws SVNException(Code) | | Constructs a new SVNURL representation appending a new path
segment to the path component of this representation.
Parameters: segment - a new path segment Parameters: uriEncoded - true if segment is UTF-8 encoded,false otherwise a new SVNURL representation throws: SVNException - if a parse error occurred |
create | public static SVNURL create(String protocol, String userInfo, String host, int port, String path, boolean uriEncoded) throws SVNException(Code) | | Creates a new SVNURL representation from the given url
components.
Parameters: protocol - a protocol component Parameters: userInfo - a user info component Parameters: host - a host component Parameters: port - a port number Parameters: path - a path component Parameters: uriEncoded - true if path is UTF-8 encoded,false otherwise a new SVNURL representation throws: SVNException - if the resultant url (composed of the given components) is malformed |
equals | public boolean equals(Object obj)(Code) | | Compares this object with another one.
Parameters: obj - an object to compare with true if obj is an instance of SVNURL and has got the sameurl components as this object has |
fromFile | public static SVNURL fromFile(File repositoryPath) throws SVNException(Code) | | Creates a "file:///" SVNURL
representation given a filesystem style repository path.
Parameters: repositoryPath - a repository path as a filesystem path an SVNURL representation throws: SVNException - |
getDefaultPortNumber | public static int getDefaultPortNumber(String protocol)(Code) | | Returns the default port number for the specified protocol.
Parameters: protocol - a particular access protocol default port number |
getHost | public String getHost()(Code) | | Returns the host component of the url represented by this object.
a host name |
getPath | public String getPath()(Code) | | Returns the path component of the url represented by this object
as a uri-decoded string
a uri-decoded path |
getPort | public int getPort()(Code) | | Returns the port number specified (or default) for the host.
a port number |
getProtocol | public String getProtocol()(Code) | | Returns the protocol component of the url represented by this
object.
a protocol name (like http ) |
getURIEncodedPath | public String getURIEncodedPath()(Code) | | Returns the path component of the url represented by this object
as a uri-encoded string
a uri-encoded path |
getUserInfo | public String getUserInfo()(Code) | | Returns the user info component of the url represented by this
object.
a user info part of the url (if it was provided) |
hasPort | public boolean hasPort()(Code) | | Says if the url is provided with a non-default port number or not.
true if the urlcomes with a non-default port number, false otherwise See Also: SVNURL.getPort() |
hashCode | public int hashCode()(Code) | | Calculates and returns a hash code for this object.
a hash code value |
parseURIDecoded | public static SVNURL parseURIDecoded(String url) throws SVNException(Code) | | Parses the given decoded (not UTF-8 encoded) url string and creates
a new SVNURL representation for this url.
Parameters: url - an input url string (like 'http://myhost/mypath') a new SVNURL representation of url throws: SVNException - if url is malformed |
parseURIEncoded | public static SVNURL parseURIEncoded(String url) throws SVNException(Code) | | Parses the given UTF-8 encoded url string and creates a new
SVNURL representation for this url.
Parameters: url - an input url string (like 'http://myhost/my%20path') a new SVNURL representation of url throws: SVNException - if url is malformed |
registerProtocol | public static void registerProtocol(String protocolName, int defaultPort)(Code) | | |
removePathTail | public SVNURL removePathTail() throws SVNException(Code) | | Constructs a new SVNURL representation removing a tail path
segment from the path component of this representation.
a new SVNURL representation throws: SVNException - |
setPath | public SVNURL setPath(String path, boolean uriEncoded) throws SVNException(Code) | | Creates a new SVNURL object replacing a path component of
this object with a new provided one.
Parameters: path - a path component Parameters: uriEncoded - true if path is UTF-8 encoded a new SVNURL representation throws: SVNException - if a parse error occurred |
toDecodedString | public String toDecodedString()(Code) | | Returns a string representing a decoded url.
a decoded url string |
toString | public String toString()(Code) | | Returns a string representing a UTF-8 encoded url.
an encoded url string |
|
|