com.starbase.starteam
Class StarTeamFinder

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

public class StarTeamFinder
extends java.lang.Object

A utility class for easily obtaining a connection to a StarTeam server and finding various objects like projects, views, folders and files.


Method Summary
static File findFile(Folder source, java.lang.String name, boolean matchCase)
          Finds the specified file from the specified folder.
static Folder findFolder(Folder from, java.lang.String folderPath)
          Given a folder and a path to a subfolder this method will return the subfolder if found.
static Folder findSubFolder(Folder from, java.lang.String subFolderName)
          Finds a subfolder in the specified folder.
static Folder openFolder(java.lang.String url)
          Connects to and logs on to the specified server and finds the specified folder.
static Folder openFolderWithOverride(java.lang.String url, java.lang.String viewPath)
          Connects to and logs on to the specified server and finds the specified folder.
static Project openProject(java.lang.String url)
          Connects to and logs on to the specified server and finds the specified project.
static Server openServer(java.lang.String url)
          Connect to and log on to a server object specified by the StarTeam url string.
static View openView(java.lang.String url)
          Connects to and logs on to the specified server and finds the specified view.
static View openViewWithOverride(java.lang.String url, java.lang.String viewPath)
          Connects to and logs on to the specified server and finds the specified view.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

openServer

public static Server openServer(java.lang.String url)
Connect to and log on to a server object specified by the StarTeam url string. The form of the url must at least include the username, password, host address and port (or server description). For example:

"fred:password@localhost:49201", or
"fred:password@MyStarTeamServer"

The url may additionally include project view and folder information but those will be ignored. Note that the password cannot contain the '@' symbol

Parameters:
url - a valid StarTeamURL string.
Returns:
a Server object that has been logged in to
See Also:
StarTeamURL

openProject

public static Project openProject(java.lang.String url)
Connects to and logs on to the specified server and finds the specified project. The url must contain at least the username, password, host address and port (or server description), and project name. For example:

"fred:password@localhost:49201/Project", or
"fred:password@MyStarTeamServer/Project"

The url may additionally include view and folder information but those will be ignored. Note that the password cannot contain the '@' symbol

Parameters:
url - a valid StarTeamURL string.
Returns:
the specified Project object
See Also:
StarTeamURL

openViewWithOverride

public static View openViewWithOverride(java.lang.String url,
                                        java.lang.String viewPath)
Connects to and logs on to the specified server and finds the specified view. The url must contain at least the username, password, host address and port (or server description), project and view name. For example:

"fred:password@localhost:49201/Project/ViewName", or
"fred:password@MyStarTeamServer/Project/ViewName"

The url may additionally include folder information but it will be ignored. You may also provide an override of the view's root folder's working directory. Note that the password cannot contain the '@' symbol

Parameters:
url - a valid StarTeamURL string.
viewPath - if not null then this specifies a new working directory for the view's root folder
Returns:
the specified View object
See Also:
StarTeamURL, Folder.setAlternatePathFragment(java.lang.String)

openView

public static View openView(java.lang.String url)
Connects to and logs on to the specified server and finds the specified view. The url must contain at least the username, password, host address and port (or server description), project and view name. For example:

"fred:password@localhost:49201/Project/ViewName", or
"fred:password@MyStarTeamServer/Project/ViewName"

The url may additionally include folder information but it will be ignored. Note that the password cannot contain the '@' symbol

Parameters:
url - a valid StarTeamURL string.
Returns:
the specified View object
See Also:
StarTeamURL

openFolderWithOverride

public static Folder openFolderWithOverride(java.lang.String url,
                                            java.lang.String viewPath)
Connects to and logs on to the specified server and finds the specified folder. The url must contain the username, password, host address and port (or server description), project, view name and folder path. For example:

"fred:password@localhost:49201/Project/ViewName/FolderA/FolderB", or
"fred:password@MyStarTeamServer/Project/ViewName/FolderA/FolderB"

You may also provide an override of the view's root folder's working directory. Note that the password cannot contain the '@' symbol

Parameters:
url - a valid StarTeamURL string.
viewPath - if not null then this specifies a new working directory for the view's root folder
Returns:
the specified Folder object
See Also:
StarTeamURL, Folder.setAlternatePathFragment(java.lang.String)

openFolder

public static Folder openFolder(java.lang.String url)
Connects to and logs on to the specified server and finds the specified folder. The url must contain the username, password, host address and port (or server description), project, view name and folder path. For example:

"fred:password@localhost:49201/Project/ViewName/FolderA/FolderB", or
"fred:password@MyStarTeamServer/Project/ViewName/FolderA/FolderB"

Note that the password cannot contain the '@' symbol

Parameters:
url - a valid StarTeamURL string.
Returns:
the specified Folder object
See Also:
StarTeamURL, Folder.setAlternatePathFragment(java.lang.String)

findFolder

public static Folder findFolder(Folder from,
                                java.lang.String folderPath)
Given a folder and a path to a subfolder this method will return the subfolder if found. This will return null if the specified folder can not be found. The specified path should be relative to the folder being searched from.

Parameters:
from - the folder from which to start the search
folderPath - the path to the subfolder. This should not include the from folder's name.
Returns:
the specified sub folder or null if not found.

findSubFolder

public static Folder findSubFolder(Folder from,
                                   java.lang.String subFolderName)
Finds a subfolder in the specified folder. Returns null if not found. The name comparisons are case insensitive.

Parameters:
from - the folder being searched
subFolderName - the name of the subfolder to be found
Returns:
the subfolder with the specified name or null if not found.

findFile

public static File findFile(Folder source,
                            java.lang.String name,
                            boolean matchCase)
Finds the specified file from the specified folder. You can specify whether comparisons should be case sensitive or not.

Parameters:
source - the folder to be searched
name - the name of the file to be found
matchCase - should be true if comparison is case sensitive
Returns:
the specified file or null if not found


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