public class FileSystemLocation extends java.lang.Object implements Location, UserHomeable
Location.LocationType
SHARED_PATH_PREFIX
Constructor and Description |
---|
FileSystemLocation(java.io.File baseDir) |
FileSystemLocation(java.lang.String baseDir)
Create new FileSystemLocation for the given directory
|
Modifier and Type | Method and Description |
---|---|
void |
addModelToFolder(java.lang.String id,
java.lang.String path,
SingleUser user) |
boolean |
checkConnection()
Checks if this location is currently available.
|
ServerModel |
createNewModel(java.io.File modelFile,
java.lang.String path,
java.lang.String id,
SingleUser user,
java.lang.String comment)
Create new model
|
void |
createUserHome(SingleUser user) |
java.lang.String |
getAtticPath(SingleUser user)
Get path to the attic directory
|
java.util.Map<java.lang.String,java.util.List<ServerModel>> |
getIndex(java.util.Set<java.lang.String> usedIDs,
boolean forceRefresh)
Get index of this location.
|
DirectoryMetaDataHandler |
getMetaDataHandler()
Get meta data handler for this location
|
java.util.Set<java.lang.String> |
getModelIDs(java.lang.String path,
boolean recursive) |
java.util.Map<java.lang.String,AccessType> |
getModelsForUser(SingleUser user)
Get all models belonging to a certain user withing this location
|
java.lang.String |
getName()
Get this location's name
|
Location.LocationType |
getType()
Get the type of this location
|
java.lang.String |
getUserHome(SingleUser user) |
java.util.Set<java.lang.String> |
listPaths()
Get all paths belonging to this location
|
java.util.Set<java.lang.String> |
listPaths(SingleUser user)
Get all paths belonging to a certain user within this location
|
boolean |
moveFolder(java.lang.String folder,
java.lang.String target,
SingleUser user) |
void |
removeFolder(java.lang.String path,
SingleUser user) |
boolean |
removeModel(java.lang.String id,
SingleUser user)
Remove a certain model
|
ServerModel |
saveProcessModel(ProcessModel pm,
java.lang.String id,
int version) |
public FileSystemLocation(java.lang.String baseDir)
baseDir
- the path of the directorypublic FileSystemLocation(java.io.File baseDir)
public ServerModel saveProcessModel(ProcessModel pm, java.lang.String id, int version)
public boolean removeModel(java.lang.String id, SingleUser user)
Location
removeModel
in interface Location
id
- the model iduser
- the user that requested the deletionpublic java.lang.String getAtticPath(SingleUser user)
Location
getAtticPath
in interface Location
user
- the userpublic java.util.Map<java.lang.String,java.util.List<ServerModel>> getIndex(java.util.Set<java.lang.String> usedIDs, boolean forceRefresh)
Location
public DirectoryMetaDataHandler getMetaDataHandler()
Location
getMetaDataHandler
in interface Location
public Location.LocationType getType()
Location
public java.lang.String getName()
Location
public java.util.Set<java.lang.String> listPaths()
Location
public java.util.Set<java.lang.String> listPaths(SingleUser user)
Location
public java.util.Map<java.lang.String,AccessType> getModelsForUser(SingleUser user)
Location
getModelsForUser
in interface Location
user
- the userpublic ServerModel createNewModel(java.io.File modelFile, java.lang.String path, java.lang.String id, SingleUser user, java.lang.String comment)
Location
createNewModel
in interface Location
public void addModelToFolder(java.lang.String id, java.lang.String path, SingleUser user)
public boolean moveFolder(java.lang.String folder, java.lang.String target, SingleUser user)
public void removeFolder(java.lang.String path, SingleUser user)
public java.util.Set<java.lang.String> getModelIDs(java.lang.String path, boolean recursive)
public java.lang.String getUserHome(SingleUser user)
getUserHome
in interface UserHomeable
public void createUserHome(SingleUser user)
createUserHome
in interface UserHomeable
public boolean checkConnection()
Location
checkConnection
in interface Location