Class LocalCollection
java.lang.Object
org.eclipse.dirigible.repository.local.LocalEntity
org.eclipse.dirigible.repository.local.LocalCollection
- All Implemented Interfaces:
ICollection,IEntity
public class LocalCollection extends LocalEntity implements ICollection
The file system based implementation of
ICollection.-
Constructor Summary
Constructors Constructor Description LocalCollection(FileSystemRepository repository, RepositoryPath path)Instantiates a new local collection. -
Method Summary
Modifier and Type Method Description voidcopyTo(String path)Copy to.voidcreate()Creates the.ICollectioncreateCollection(String name)Creates the collection.IResourcecreateResource(String name, byte[] content)Creates the resource.IResourcecreateResource(String name, byte[] content, boolean isBinary, String contentType)Creates the resource.voiddelete()Delete.booleanequals(Object obj)Equals.booleanexists()Exists.List<IEntity>getChildren()Gets the children.ICollectiongetCollection(String name)Gets the collection.List<ICollection>getCollections()Gets the collections.List<String>getCollectionsNames()Gets the collections names.LocalFoldergetFolder()Gets the folder.protected LocalFoldergetFolderSafe()Gets the folder safe.IResourcegetResource(String name)Gets the resource.List<IResource>getResources()Gets the resources.List<String>getResourcesNames()Gets the resources names.inthashCode()Hash code.booleanisEmpty()Checks if is empty.voidmoveTo(String path)Move to.voidremoveCollection(String name)Removes the collection.voidremoveCollection(ICollection childCollection)Removes the collection.voidremoveResource(String name)Removes the resource.voidremoveResource(IResource resource)Removes the resource.voidrenameTo(String name)Rename to.Methods inherited from class org.eclipse.dirigible.repository.local.LocalEntity
createAncestorsAndSelfIfMissing, createAncestorsIfMissing, getInformation, getLocalObject, getLocalObjectSafe, getName, getParent, getPath, getRepository, getRepositoryPathMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.dirigible.repository.api.IEntity
getInformation, getName, getParent, getPath, getRepository
-
Constructor Details
-
LocalCollection
Instantiates a new local collection.- Parameters:
repository- the repositorypath- the path
-
-
Method Details
-
create
Creates the.- Specified by:
createin interfaceIEntity- Throws:
RepositoryWriteException- the repository write exception
-
delete
Delete.- Specified by:
deletein interfaceIEntity- Throws:
RepositoryWriteException- the repository write exception
-
renameTo
Rename to.- Specified by:
renameToin interfaceIEntity- Parameters:
name- the name- Throws:
RepositoryWriteException- the repository write exception
-
moveTo
Move to.- Specified by:
moveToin interfaceIEntity- Parameters:
path- the path- Throws:
RepositoryWriteException- the repository write exception
-
copyTo
Copy to.- Specified by:
copyToin interfaceIEntity- Parameters:
path- the path- Throws:
RepositoryWriteException- the repository write exception
-
exists
Exists.- Specified by:
existsin interfaceIEntity- Returns:
- true, if successful
- Throws:
RepositoryWriteException- the repository write exception
-
isEmpty
Checks if is empty.- Specified by:
isEmptyin interfaceIEntity- Returns:
- true, if is empty
- Throws:
RepositoryReadException- the repository read exception
-
getCollections
Gets the collections.- Specified by:
getCollectionsin interfaceICollection- Returns:
- the collections
- Throws:
RepositoryReadException- the repository read exception
-
getCollectionsNames
Gets the collections names.- Specified by:
getCollectionsNamesin interfaceICollection- Returns:
- the collections names
- Throws:
RepositoryReadException- the repository read exception
-
createCollection
Creates the collection.- Specified by:
createCollectionin interfaceICollection- Parameters:
name- the name- Returns:
- the i collection
- Throws:
RepositoryWriteException- the repository write exception
-
getCollection
Gets the collection.- Specified by:
getCollectionin interfaceICollection- Parameters:
name- the name- Returns:
- the collection
-
removeCollection
Removes the collection.- Specified by:
removeCollectionin interfaceICollection- Parameters:
name- the name- Throws:
RepositoryWriteException- the repository write exception
-
removeCollection
Removes the collection.- Specified by:
removeCollectionin interfaceICollection- Parameters:
childCollection- the child collection- Throws:
RepositoryWriteException- the repository write exception
-
getResources
Gets the resources.- Specified by:
getResourcesin interfaceICollection- Returns:
- the resources
- Throws:
RepositoryReadException- the repository read exception
-
getResourcesNames
Gets the resources names.- Specified by:
getResourcesNamesin interfaceICollection- Returns:
- the resources names
- Throws:
RepositoryReadException- the repository read exception
-
getResource
Gets the resource.- Specified by:
getResourcein interfaceICollection- Parameters:
name- the name- Returns:
- the resource
- Throws:
RepositoryReadException- the repository read exception
-
createResource
public IResource createResource(String name, byte[] content, boolean isBinary, String contentType) throws RepositoryWriteExceptionCreates the resource.- Specified by:
createResourcein interfaceICollection- Parameters:
name- the namecontent- the contentisBinary- the is binarycontentType- the content type- Returns:
- the i resource
- Throws:
RepositoryWriteException- the repository write exception
-
createResource
Creates the resource.- Specified by:
createResourcein interfaceICollection- Parameters:
name- the namecontent- the content- Returns:
- the i resource
- Throws:
RepositoryWriteException- the repository write exception
-
removeResource
Removes the resource.- Specified by:
removeResourcein interfaceICollection- Parameters:
name- the name- Throws:
RepositoryWriteException- the repository write exception
-
removeResource
Removes the resource.- Specified by:
removeResourcein interfaceICollection- Parameters:
resource- the resource- Throws:
RepositoryWriteException- the repository write exception
-
getChildren
Gets the children.- Specified by:
getChildrenin interfaceICollection- Returns:
- the children
- Throws:
RepositoryReadException- the repository read exception
-
equals
Equals.- Overrides:
equalsin classLocalEntity- Parameters:
obj- the obj- Returns:
- true, if successful
-
hashCode
public int hashCode()Hash code.- Overrides:
hashCodein classLocalEntity- Returns:
- the int
-
getFolder
Gets the folder.- Returns:
- the folder
- Throws:
RepositoryReadException- the repository read exception
-
getFolderSafe
Gets the folder safe.- Returns:
- the folder safe
- Throws:
RepositoryNotFoundException- the repository not found exception
-