public class RegionStorage extends DataStorage
TopiaContext
des regions.
Created: 17 août 2005 03:44:57 CESTModifier and Type | Field and Description |
---|---|
protected File |
commentForNextCommitFile
File to use to store next commit region comment.
|
static String |
MAP_DIRECTORY |
static String |
REGION_PATH |
protected static Map<String,RegionStorage> |
regions
Instance cache.
|
protected static Set<StorageChangeListener> |
storageListeners |
DATA_BACKUP_FILENAME, memstorage, name, storage
file, root
Modifier | Constructor and Description |
---|---|
protected |
RegionStorage(File directory,
String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addCommentForNextCommit(String commentToAdd)
Add new comment in comment used for the next cvs commit.
|
static void |
addStorageListener(StorageChangeListener storageListener) |
static RegionStorage |
checkout(String name)
Checkout not existing Region locally from server
|
void |
clearCommentForNextCommit()
rename commentForNextCommitFile with current date at end
must be used in user application after commit
|
static RegionStorage |
create(String name)
Permet de creer une nouvelle region.
|
void |
delete(boolean cvsDelete)
Permet de supprimer un fichier ou répertoire versionné ou non.
|
static boolean |
exists(String name)
Verifie si la region exists en local ou sur le serveur CVS.
|
String |
getCommentForNextCommit() |
static FisheryRegion |
getFisheryRegion(org.nuiton.topia.TopiaContext context) |
File |
getMapRepository() |
static List<String> |
getNewRegionNames()
Retourne la liste des noms de toutes les régions disponible en local qui
ne sont pas encore sur le serveur VCS.
|
static List<String> |
getNewRemoteRegionNames()
Retourne la liste des noms de toutes les régions disponible sur le
serveur VCS qui ne sont pas encore en local.
|
static RegionStorage |
getRegion(String name)
Recupere le TopiaContext d'une region.
|
static File |
getRegionDirectory() |
static File |
getRegionDirectory(String name) |
static List<String> |
getRegionNames()
Retourne la liste des noms de toutes les régions disponible en local.
|
static List<RegionStorage> |
getRegions()
Retourne la liste de toutes les régions disponible en local.
|
static List<String> |
getRemoteRegionNames()
Retourne la liste des noms de toutes les régions disponible sur le
serveur VCS.
|
static RegionStorage |
importAndRenameZip(File file,
String newName)
Import zipped region.
|
static RegionStorage |
importZip(File file)
Import zipped region.
|
protected boolean |
isVersionnableFile(File file)
Permet de savoir si un fichier doit etre géré par le vcs ou non.
|
void |
rename(String toName)
Renome juste le repertoire, s'il y a besoin de modifier des données dans
le TopiaContext il faut surcharger cette methode.
|
void |
setCommentForNextCommit(String commentForNextCommit) |
closeMemStorage, closeStorage, copy, createZip, createZip, createZip, finalize, getDataBackupFile, getDirectory, getMemStorage, getName, getStorage, getStorageDirectory, prepare
add, checkout, commit, diff, getCommunityDatabaseDirectory, getCommunityVCS, getContextDatabaseDirectory, getCurrentVCS, getCurrentVCS, getFile, getFiles, getFiles, getRemoteStorageNames, getRoot, getStorageNames, getVCS, isOnRemote, isUpToDate, registerWatcher, update
public static final String REGION_PATH
public static final String MAP_DIRECTORY
protected static Map<String,RegionStorage> regions
protected static Set<StorageChangeListener> storageListeners
protected File commentForNextCommitFile
public static void addStorageListener(StorageChangeListener storageListener)
public static File getRegionDirectory()
public String getCommentForNextCommit() throws IOException
IOException
- if IO problem while reading filepublic void setCommentForNextCommit(String commentForNextCommit) throws IOException
commentForNextCommit
- The commentForNextCommit to set.IOException
- if io problem while writing filepublic void clearCommentForNextCommit()
protected boolean isVersionnableFile(File file)
VersionStorage
isVersionnableFile
in class DataStorage
file
- le fichier a testertrue
si le fichier est versionnépublic void addCommentForNextCommit(String commentToAdd) throws IOException
commentToAdd
- the comment to addIOException
- if IO problem while writing filepublic void rename(String toName) throws StorageException
DataStorage
rename
in class DataStorage
toName
- le nouveau nomStorageException
- si problème lors du renommagepublic File getMapRepository()
public static RegionStorage checkout(String name) throws VCSException, org.nuiton.topia.TopiaException
name
- name of region to retrieveVCSException
- if problem with vcs while checkoutorg.nuiton.topia.TopiaException
- if problem while restoring dbpublic static RegionStorage getRegion(String name)
name
- le nom de la region a recupererpublic static boolean exists(String name)
name
- le nom de la regionpublic static RegionStorage create(String name) throws StorageException
name
- Le nom de la nouvelle regionStorageException
- Si le nom est deja uitlisépublic void delete(boolean cvsDelete) throws StorageException
VersionStorage
delete
in class DataStorage
cvsDelete
- si vrai alors le fichier sera aussi supprimé sur le
vcs si elle existait. Cela prend effet immediatement (un commit est fait)StorageException
- if delete operation failpublic static List<String> getRegionNames()
public static List<RegionStorage> getRegions()
public static List<String> getNewRegionNames()
public static List<String> getRemoteRegionNames()
public static List<String> getNewRemoteRegionNames()
public static FisheryRegion getFisheryRegion(org.nuiton.topia.TopiaContext context) throws StorageException
StorageException
public static RegionStorage importZip(File file) throws IOException, StorageException, RegionAlreadyExistException
file
- zipped region fileIOException
- if IO problem while import zipRegionAlreadyExistException
- if problem while restoring dbStorageException
public static RegionStorage importAndRenameZip(File file, String newName) throws IOException, RegionAlreadyExistException, StorageException
file
- zipped region filenewName
- new name for the imported simulationIOException
- if IO problem while import zipRegionAlreadyExistException
- if problem while restoring dbStorageException
Copyright © 1999–2020 CodeLutin. All rights reserved.