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

Nested Class Summary
 
Nested classes/interfaces inherited from class com.tek42.perforce.parse.AbstractPerforceTemplate
AbstractPerforceTemplate.ResponseFilter
 
Constructor Summary
Workspaces(Depot depot)
           
 
Method Summary
 StringBuilder flushTo(String path)
           
 Workspace getWorkspace(String ws_name, String stream_name)
          Returns a workspace specified by name.
 void saveWorkspace(Workspace workspace)
          Saves changes to an existing workspace, or creates a new one.
 StringBuilder syncDryRun()
          Test whether there are any changes pending for the current client (P4CLIENT env var).
 StringBuilder syncTo(String path, boolean forceSync, boolean populateOnly)
          Provides method to sync to a depot path and allows for any revision, changelist, label, etc.
 StringBuilder syncToHead(String path)
          Synchronizes to the latest change for the specified path.
 StringBuilder syncToHead(String path, boolean forceSync)
          Synchronizes to the latest change for the specified path.
 
Methods inherited from class com.tek42.perforce.parse.AbstractPerforceTemplate
getExtraParams, getLogger, getP4Exe, getPerforceResponse, getPerforceResponse, getRawPerforceResponseBytes, 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(String ws_name,
                              String stream_name)
                       throws PerforceException
Returns a workspace specified by name. Stream name is required if a stream workspace is created, can be empty otherwise.

Parameters:
ws_name - Workspace name
stream_name - Stream 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 StringBuilder syncToHead(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 StringBuilder syncToHead(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 StringBuilder syncTo(String path,
                            boolean forceSync,
                            boolean populateOnly)
                     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

flushTo

public StringBuilder flushTo(String path)
                      throws PerforceException
Throws:
PerforceException

syncDryRun

public 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 © 2004-2013 Hudson. All Rights Reserved.