com.starbase.starteam
Class StarTeamURL

java.lang.Object
  |
  +--com.starbase.starteam.StarTeamURL

public class StarTeamURL
extends java.lang.Object

StarTeamURL uses a URL-like syntax to reference a StarTeam Server, Project, View or Folder. Used in conjunction with StarTeamFinder, it provides a convenient way to locate important StarTeam objects.

StarTeamURL supports the following syntax:

starteam://username:password@hostname:port/Project/View/FolderA/FolderB/...

The "starteam://" prefix is optional.

Alternatively, the following syntax is also supported:

starteam://username:password@server/Project/View/FolderA/FolderB/...

Thus, if no ":port" is specified, the hostname is interpreted as a server description. The description is looked up in the server list, and, if found, the connection information from the server list (host address, port, encryption and compression settings, and MPX profile name) are used to establish the server connection.

See Also:
StarTeamFinder, ServerList, Server.Server(ServerInfo)

Constructor Summary
StarTeamURL(java.lang.String url)
          Construct a new StarTeamURL with the given specifier.
 
Method Summary
 boolean equals(java.lang.Object source)
          returns true if this object instance is equal to the source
 java.util.StringTokenizer getFolders()
          Returns a StringTokenizer that can be used to enumerate the folder names found in the path portion of the URL.
 java.lang.String getHostName()
          Returns the host name specified in the URL or null of not found.
 java.lang.String getPassword()
          Returns the password specified in the URL or null of not found.
 java.lang.String getPath()
          Returns the path specified in the URL or null of not found.
 java.lang.String getPort()
          Returns the port specified in the URL or null of not found.
 java.lang.String getProjectName()
          Returns the project name specified in the URL or null of not found.
 int getProtocol()
          Returns the protocol specified in the URL or PROTOCOL_TCP_IP_SOCKETS of not found.
 java.lang.String getSource()
          Returns the source string for the URL.
 java.lang.String getUserName()
          Returns the user name specified in the URL or null of not found.
 int hashCode()
          returns a unique hash for all instances of this type
 java.lang.String toString()
          Returns a string representation of the various components of the URL.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StarTeamURL

public StarTeamURL(java.lang.String url)
Construct a new StarTeamURL with the given specifier. The most general form of the URL is: "username:password@hostname:port/projectname/view/folder/folder/" Additionally, you can prefix the string with an optional protocol prefix. Use "starteam://" to indicate the "TCP/IP Sockets" protocol, or "starteam:xml//" to indicate the "XML over TCP/IP" protocol. If no protocol prefix is specified, "TCP/IP Sockets" is assumed.

Parameters:
url - the string specifier of the StarTeamURL.
Method Detail

getSource

public java.lang.String getSource()
Returns the source string for the URL. This is the String the user passed in on the constructor.

Returns:
the original string provided when this StarTeamURL was created

getUserName

public java.lang.String getUserName()
Returns the user name specified in the URL or null of not found.

Returns:
the user name specified in the URL or null of not found.

getPassword

public java.lang.String getPassword()
Returns the password specified in the URL or null of not found.

Returns:
the password specified in the URL or null of not found.

getHostName

public java.lang.String getHostName()
Returns the host name specified in the URL or null of not found.

Returns:
the host name specified in the URL or null of not found.

getPort

public java.lang.String getPort()
Returns the port specified in the URL or null of not found.

Returns:
the port specified in the URL or null of not found.

getProtocol

public int getProtocol()
Returns the protocol specified in the URL or PROTOCOL_TCP_IP_SOCKETS of not found.

Returns:
the protocol specified in the URL or PROTOCOL_TCP_IP_SOCKETS of not found.
See Also:
ServerConfiguration.PROTOCOL_TCP_IP_SOCKETS

getProjectName

public java.lang.String getProjectName()
Returns the project name specified in the URL or null of not found.

Returns:
the project name specified in the URL or null of not found.

getPath

public java.lang.String getPath()
Returns the path specified in the URL or null of not found. The path is everything in the URL after the project specifier.

Returns:
the path specified in the URL or null of not found.

getFolders

public java.util.StringTokenizer getFolders()
Returns a StringTokenizer that can be used to enumerate the folder names found in the path portion of the URL.

Returns:
a StringTokenizer that can be used to enumerate the folder names found in the path portion of the URL.

toString

public java.lang.String toString()
Returns a string representation of the various components of the URL.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the various components of the URL.

equals

public boolean equals(java.lang.Object source)
returns true if this object instance is equal to the source

Overrides:
equals in class java.lang.Object
Parameters:
source - Object the source to comapre with
Returns:
boolean true if this object is equal to the source

hashCode

public int hashCode()
returns a unique hash for all instances of this type

Overrides:
hashCode in class java.lang.Object
Returns:
int a unique hash for all instances of this type


StarTeam SDK 10.4, Build 36
Copyright © 2003-2008 Borland Software Corporation. All rights reserved.