public class LocalRepositoryManager extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
LocalRepositoryManager.LocalRepository
A repository on the local disk.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
KAR_LOCAL_REPOS_TABLE_NAME |
Constructor and Description |
---|
LocalRepositoryManager()
Empty Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addLocalRepoRootDir(java.io.File directory)
Convenience method for addLocalRepoRootDir(File, String)
|
void |
addLocalRepoRootDir(java.io.File directory,
java.lang.String name)
Add a local repository for a given root directory and name.
|
boolean |
changedSinceCheckpoint()
Check to see if the LocalRepositories have changed since the last time
setCheckpoint() was called.
|
LocalRepositoryManager.LocalRepository |
getContainingLocalRepository(java.io.File aFile)
Given a file, return the local repository that it is in or null if it is
not in a local repository.
|
javax.swing.tree.TreeModel |
getFolderModel(java.lang.String name) |
javax.swing.tree.DefaultMutableTreeNode |
getFolderModelNode(java.io.File folder)
Given the File object for a folder in a local repository, return the
corresponding DefaultMutableTreeNode object from the Folder model.
|
static LocalRepositoryManager |
getInstance()
Method for getting an instance of this singleton class.
|
java.util.Vector<java.io.File> |
getKarFiles()
Return a list of all the KAR files that were found after calling
scanReposForKarFiles()
|
java.util.LinkedHashMap<LocalRepositoryManager.LocalRepository,java.lang.String> |
getLocalRepositories() |
static java.lang.String |
getLocalRepositoryName(java.lang.String moduleName)
Get the display name of a local repository for a module.
|
LocalRepositoryManager.LocalRepository |
getRepositoryForFile(java.io.File file)
Get the repository for a file.
|
java.io.File |
getSaveRepository() |
java.util.Vector<java.io.File> |
getXMLFiles()
Return a list of all the XML files that were found after calling
scanReposForXMLFiles()
|
boolean |
isInLocalRepository(java.io.File aFile)
Given a file, return true if it is in a local repository, false if it is
not.
|
boolean |
isLocalRepositoryName(java.lang.String name) |
void |
refreshFolderModelForFolder(java.io.File folder) |
void |
refreshFolderModelForRepo(LocalRepositoryManager.LocalRepository repo)
Refresh the folder model for the specified local repository.
|
void |
removeLocalRepoRootDir(java.io.File directory)
This method only removes the given directory from the in-memory repository
list.
|
void |
restoreCheckpoint()
Reset the list of local repositories to be what it was the last time the
setCheckpoint() method was called.
|
void |
scanReposForKarFiles()
Search for Kar files in local Kar Repositories and build a list of all
the KAR files that are found.
|
java.util.LinkedHashMap<LocalRepositoryManager.LocalRepository,java.lang.String> |
selectReposFromDB() |
void |
setCheckpoint()
Save the local repo dirs to a private variable so we can determine when
they have changed between build points.
|
void |
setDefaultLocalRepos()
Set the default local repositories to be the kar directories for each of
the modules in the system along with a default workflows directory.
|
void |
setDefaultSaveRepo()
Set the default Save repository.
|
void |
setFolderModel(java.util.LinkedHashMap<java.lang.String,javax.swing.tree.TreeModel> folderModel) |
void |
setLocalRepoName(java.io.File directory,
java.lang.String name)
Change the name of a local repository.
|
void |
setLocalSaveRepo(java.io.File dir) |
void |
synchronizeDB()
Synchronize the KAR_LOCAL_REPOS table with the _localRepositories private variable list.
|
public static final java.lang.String KAR_LOCAL_REPOS_TABLE_NAME
public LocalRepositoryManager()
public javax.swing.tree.TreeModel getFolderModel(java.lang.String name)
public void setFolderModel(java.util.LinkedHashMap<java.lang.String,javax.swing.tree.TreeModel> folderModel)
public java.util.LinkedHashMap<LocalRepositoryManager.LocalRepository,java.lang.String> selectReposFromDB()
public java.util.Vector<java.io.File> getKarFiles()
public java.util.Vector<java.io.File> getXMLFiles()
public void scanReposForKarFiles()
public void refreshFolderModelForRepo(LocalRepositoryManager.LocalRepository repo)
repo
- public javax.swing.tree.DefaultMutableTreeNode getFolderModelNode(java.io.File folder)
folder
- public void refreshFolderModelForFolder(java.io.File folder)
public void setLocalSaveRepo(java.io.File dir)
directory
- public void setDefaultSaveRepo()
java.lang.Exception
public void setDefaultLocalRepos()
public void setCheckpoint()
public void restoreCheckpoint()
public boolean changedSinceCheckpoint()
public boolean isLocalRepositoryName(java.lang.String name)
public void removeLocalRepoRootDir(java.io.File directory) throws java.lang.Exception
directory
- java.lang.Exception
- if the directory could not be removedpublic void synchronizeDB()
public void setLocalRepoName(java.io.File directory, java.lang.String name) throws java.lang.Exception
directory
- the default root directory of the repositoryname
- java.lang.Exception
public boolean isInLocalRepository(java.io.File aFile)
aFile
- public LocalRepositoryManager.LocalRepository getContainingLocalRepository(java.io.File aFile)
aFile
- public void addLocalRepoRootDir(java.io.File directory) throws java.lang.Exception
directory
- java.lang.Exception
public void addLocalRepoRootDir(java.io.File directory, java.lang.String name) throws java.lang.Exception
directory
- java.lang.Exception
public java.util.LinkedHashMap<LocalRepositoryManager.LocalRepository,java.lang.String> getLocalRepositories()
public java.io.File getSaveRepository()
public LocalRepositoryManager.LocalRepository getRepositoryForFile(java.io.File file)
public static LocalRepositoryManager getInstance()
public static java.lang.String getLocalRepositoryName(java.lang.String moduleName) throws java.lang.Exception
java.lang.Exception