com.tek42.perforce.parse
Class Status

java.lang.Object
  extended by com.tek42.perforce.parse.AbstractPerforceTemplate
      extended by com.tek42.perforce.parse.Status

public class Status
extends AbstractPerforceTemplate

Allows checking the status of the depot.

Author:
Mike Wille

Constructor Summary
Status(Depot depot)
           
 
Method Summary
 boolean exists(java.lang.String path)
          Checks the specified path to see if it exists in the depot.
 boolean isValid()
          Checks the environment to see if it is valid.
 
Methods inherited from class com.tek42.perforce.parse.AbstractPerforceTemplate
getExtraParams, getLogger, getPerforceResponse, getRawPerforceResponseLines, hitMax, login, parseList, saveToPerforce
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Status

public Status(Depot depot)
Method Detail

isValid

public boolean isValid()
                throws PerforceException
Checks the environment to see if it is valid. To check the validity of the environment, the user information is accessed. This ensures that the server can be contacted and that the password is set properly.

If the environment is valid, this method will return true. Otherwise, it will throw a PerforceException with a message regarding the failure.

Throws:
PerforceException

exists

public boolean exists(java.lang.String path)
               throws PerforceException
Checks the specified path to see if it exists in the depot. This may take a bit of time the first time it is called. It seems perforce takes a bit to wake up.

The path must end with the perforce wildcard: /... Otherwise it will return no results.

Note: this method may move once the API is more complete.

Parameters:
path - Path to check, example: //depot/MyProject/...
Returns:
True if it exists, false if not.
Throws:
PerforceException


Copyright © 2009. All Rights Reserved.