com.tek42.perforce.parse
Class Workspaces

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

public class Workspaces
extends AbstractPerforceTemplate

Base API object for interacting with workspaces.

Author:
Mike Wille

Constructor Summary
Workspaces(Depot depot)
           
 
Method Summary
 Workspace getWorkspace(java.lang.String name)
          Returns a workspace specified by name.
 void saveWorkspace(Workspace workspace)
          Saves changes to an existing workspace, or creates a new one.
 java.lang.StringBuilder syncDryRun()
          Test whether there are any changes pending for the current client (P4CLIENT env var).
 java.lang.StringBuilder syncTo(java.lang.String path, boolean forceSync)
          Provides method to sync to a depot path and allows for any revision, changelist, label, etc.
 java.lang.StringBuilder syncToHead(java.lang.String path)
          Synchronizes to the latest change for the specified path.
 java.lang.StringBuilder syncToHead(java.lang.String path, boolean forceSync)
          Synchronizes to the latest change for the specified path.
 
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

Workspaces

public Workspaces(Depot depot)
Method Detail

getWorkspace

public Workspace getWorkspace(java.lang.String name)
                       throws PerforceException
Returns a workspace specified by name.

Parameters:
name -
Returns:
Throws:
PerforceException

saveWorkspace

public void saveWorkspace(Workspace workspace)
                   throws PerforceException
Saves changes to an existing workspace, or creates a new one.

Parameters:
workspace -
Throws:
PerforceException

syncToHead

public java.lang.StringBuilder syncToHead(java.lang.String path)
                                   throws PerforceException
Synchronizes to the latest change for the specified path. Convenience function for syncTo(String, boolean)

Parameters:
path -
Returns:
Throws:
PerforceException

syncToHead

public java.lang.StringBuilder syncToHead(java.lang.String path,
                                          boolean forceSync)
                                   throws PerforceException
Synchronizes to the latest change for the specified path. Allows a force sync to be performed by passing true to forceSync parameter.

Parameters:
path - The depot path to sync to
forceSync - True to force sync and overwrite local files
Returns:
StringBuilder containing output of p4 response.
Throws:
PerforceException

syncTo

public java.lang.StringBuilder syncTo(java.lang.String path,
                                      boolean forceSync)
                               throws PerforceException
Provides method to sync to a depot path and allows for any revision, changelist, label, etc. to be appended to the path.

A force sync can be specified by passing true to forceSync.

Parameters:
path - The depot path to sync to. Perforce suffix for [revRange] is allowed.
forceSync - Should we force a sync to grab all files regardless of version on disk?
Returns:
A StringBuilder that contains the output of the p4 execution.
Throws:
PerforceException

syncDryRun

public java.lang.StringBuilder syncDryRun()
                                   throws PerforceException
Test whether there are any changes pending for the current client (P4CLIENT env var).

Returns:
A StringBuilder that contains the output of the p4 execution.
Throws:
PerforceException


Copyright © 2009. All Rights Reserved.