com.starteam
Class ServerInfoCollection

java.lang.Object
  extended by com.starteam.StarTeamCollection
      extended by com.starteam.ServerInfoCollection
All Implemented Interfaces:
java.lang.Iterable, java.util.Collection

public final class ServerInfoCollection
extends StarTeamCollection

Collection of Server configuration parameters


Constructor Summary
ServerInfoCollection()
          Start with an empty server info collection
ServerInfoCollection(java.io.File file)
          Loads the server list from the specified file.
 
Method Summary
 boolean add(java.lang.Object o)
          Adds the specified ServerInfo to this ServerList.
 ServerInfo find(java.lang.String description)
          Find a ServerInfo by description.
static java.io.File getDefaultFile()
          The default location that StarTeam applications should use for the server list.
 boolean remove(java.lang.Object o)
          Removes a single instance of the specified element from this collection, if it is present
 void saveTo(java.io.File file)
          Writes the server list out to the specified file.
 
Methods inherited from class com.starteam.StarTeamCollection
addAll, addAll, addTo, attach, clear, contains, containsAll, detach, get, getSyncRoot, indexOf, insert, isEmpty, isFixedSize, isModified, isReadOnly, isSynchronized, iterator, positionOf, removeAll, removeAt, resetCapacity, retainAll, set, size, toArray, toArray
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

ServerInfoCollection

public ServerInfoCollection()
Start with an empty server info collection


ServerInfoCollection

public ServerInfoCollection(java.io.File file)
                     throws java.io.IOException
Loads the server list from the specified file. This will throw an exception if there are any problems reading the file or if the file is not a properly formatted server list file.

Parameters:
file - the from which to load the server list.
Throws:
java.io.IOException
Method Detail

remove

public boolean remove(java.lang.Object o)
Removes a single instance of the specified element from this collection, if it is present

Specified by:
remove in interface java.util.Collection
Overrides:
remove in class StarTeamCollection
Parameters:
o - serverinfo instance
Returns:
true if the collection changed

add

public boolean add(java.lang.Object o)
Adds the specified ServerInfo to this ServerList. An instance of a ServerInfo object can belong to only one ServerList. The server info will be added in alphabetical order (using case insensitive comparison).

Specified by:
add in interface java.util.Collection
Overrides:
add in class StarTeamCollection
Parameters:
o - the server info to add (cannot be null)
Returns:
true if this collection changed as a result of the call.
Throws:
DuplicateServerListEntryException - if the list already contains an entry with the same name (case-insensitive)

find

public ServerInfo find(java.lang.String description)
Find a ServerInfo by description.

Parameters:
description - the description to match
Returns:
a ServerInfo object with the given description, or null

getDefaultFile

public static java.io.File getDefaultFile()
                                   throws java.io.IOException
The default location that StarTeam applications should use for the server list.

Returns:
The default location that StarTeam applications should use for the server list. The default file name is "starteam-servers.xml".
Throws:
java.io.IOException

saveTo

public void saveTo(java.io.File file)
            throws java.io.IOException
Writes the server list out to the specified file.

Parameters:
file - the file to save the list to
Throws:
java.io.IOException - if an error occurs writing to the file


StarTeam SDK 14.0, Build 21
Copyright © 2003-2012 Borland Software Corporation. All rights reserved.