|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gate.versioning.svnkit.SandboxManager
public class SandboxManager
This class manages a set of Sandbox
es. This is a Spring Bean and it
is assumed that this will be a singleton. It ensures that there is never more
than one Sandbox
object for any given SVN-managed file tree, and it
linearises operations on these objects. It is intended to be thread-safe.
NOTE: this API assumes that its clients are friendly enough not to add
a sandbox that is a subdirectory of another sandbox also being managed. If
this rule is not followed then the results will be unpredictable!
Constructor Summary | |
---|---|
SandboxManager()
|
Method Summary | |
---|---|
boolean |
addSandbox(File location,
org.tmatesoft.svn.core.auth.ISVNAuthenticationManager authManager)
Add a new Sandbox. |
boolean |
addSandbox(File location,
String username,
String password)
Add a new Sandbox. |
void |
addSandboxes(List folderIds,
String username,
String password)
This method adds a list of sandboxes to the sandboxMap. |
org.tmatesoft.svn.core.SVNURL |
createLocalRepository(File location)
Create a new local SVN repository. |
void |
forgetSandbox(File sbDir)
Forget a sandbox. |
File |
getConfigDir()
|
Sandbox |
getSandbox(String id)
Get a sandbox from its ID (canonical path to the directory tree). |
String |
getSandboxId(File sbDir)
Generate an ID for a File that points to a sandbox tree on disk. |
List<Sandbox> |
getSandboxList()
Get an (immutable) list of all known sandboxes. |
Map<String,Sandbox> |
getSandboxMap()
Get an (immutable) map of all known sandboxes indexed by id. |
boolean |
isSandboxDir(File sbDir)
Check that a File points to a valid sandbox on disk. |
void |
setConfigDir(File dir)
|
void |
shutdown()
Close all managed sandboxes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SandboxManager()
Method Detail |
---|
public void setConfigDir(File dir)
public File getConfigDir()
public boolean addSandbox(File location, String username, String password) throws gate.util.GateException
location
- a file pointing to the top-level directory of the sandbox on disk.username
- - for svn authenticationpassword
- - for svn authentication
gate.util.GateException
- when the location doesn't exist or isn't under version control.public boolean addSandbox(File location, org.tmatesoft.svn.core.auth.ISVNAuthenticationManager authManager) throws gate.util.GateException
location
- a file pointing to the top-level directory of the sandbox on disk.authManager
- - custom authentication manager for svn authentication
gate.util.GateException
- when the location doesn't exist or isn't under version control.public String getSandboxId(File sbDir) throws gate.util.GateRuntimeException
gate.util.GateRuntimeException
- when the location won't resolve to a canonical path.public boolean isSandboxDir(File sbDir)
sbDir
- a file pointing to the top-level directory of the sandbox on disk.
public void forgetSandbox(File sbDir)
sbDir
- a file pointing to the top-level directory of the sandbox on disk
(it is assumed to be a File).public Sandbox getSandbox(String id)
id
- the ID of the Sandbox (if you only have the location of the
sandbox on disk, use getSandboxId(File)
and pass the
result to this method.public List<Sandbox> getSandboxList()
public Map<String,Sandbox> getSandboxMap()
public org.tmatesoft.svn.core.SVNURL createLocalRepository(File location) throws org.tmatesoft.svn.core.SVNException
org.tmatesoft.svn.core.SVNException
public void addSandboxes(List folderIds, String username, String password)
folderIds
- the list of full paths of the sandboxes to be added.username
- - for svn authenticationpassword
- - for svn authenticationpublic void shutdown()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |