Package org.nuxeo.drive.service.impl
Class FileSystemItemManagerImpl
java.lang.Object
org.nuxeo.drive.service.impl.FileSystemItemManagerImpl
- All Implemented Interfaces:
FileSystemItemManager
Default implementation of the
FileSystemItemManager
.- Author:
- Antoine Taillefer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canMove
(String srcId, String destId, NuxeoPrincipal principal) Return true if theFileSystemItem
with the given source id can be moved to theFileSystemItem
with the given destination id for the given principal.createFile
(String parentId, Blob blob, NuxeoPrincipal principal, boolean overwrite) Creates a file with the given blob in theFileSystemItem
with the given id for the given principal.createFolder
(String parentId, String name, NuxeoPrincipal principal, boolean overwrite) Creates a folder with the given name in theFileSystemItem
with the given id for the given principal.void
delete
(String id, String parentId, NuxeoPrincipal principal) Deletes theFileSystemItem
with the given id and parent id for the given principal.void
delete
(String id, NuxeoPrincipal principal) Deletes theFileSystemItem
with the given id for the given principal.protected void
delete
(FileSystemItem fsItem) boolean
exists
(String id, NuxeoPrincipal principal) Returns true if aFileSystemItem
with the given id exists for the given principal.getChildren
(String id, NuxeoPrincipal principal) Gets the children of theFileSystemItem
with the given id for the given principal.protected FileSystemItemAdapterService
getFileSystemItemById
(String id, String parentId, NuxeoPrincipal principal) Gets theFileSystemItem
with the given id and parent id for the given principal.getFileSystemItemById
(String id, NuxeoPrincipal principal) Gets theFileSystemItem
with the given id for the given principal.getTopLevelFolder
(NuxeoPrincipal principal) Gets the top levelFolderItem
for the given principal.move
(String srcId, String destId, NuxeoPrincipal principal) Moves theFileSystemItem
with the given source id to theFileSystemItem
with the given destination id for the given principal.rename
(String id, String name, NuxeoPrincipal principal) Renames theFileSystemItem
with the given id with the given name for the given principal.scrollDescendants
(String id, NuxeoPrincipal principal, String scrollId, int batchSize, long keepAlive) Retrieves at mostbatchSize
descendants of theFolderItem
with the givenid
for the givenprincipal
and the givenscrollId
.updateFile
(String id, String parentId, Blob blob, NuxeoPrincipal principal) Updates theFileSystemItem
with the given id and parent id with the given blob for the given principal.updateFile
(String id, Blob blob, NuxeoPrincipal principal) Updates theFileSystemItem
with the given id with the given blob for the given principal.protected FileItem
updateFile
(FileSystemItem fsItem, Blob blob)
-
Constructor Details
-
FileSystemItemManagerImpl
public FileSystemItemManagerImpl()
-
-
Method Details
-
getTopLevelFolder
Description copied from interface:FileSystemItemManager
Gets the top levelFolderItem
for the given principal.- Specified by:
getTopLevelFolder
in interfaceFileSystemItemManager
-
exists
Description copied from interface:FileSystemItemManager
Returns true if aFileSystemItem
with the given id exists for the given principal.- Specified by:
exists
in interfaceFileSystemItemManager
- See Also:
-
getFileSystemItemById
Description copied from interface:FileSystemItemManager
Gets theFileSystemItem
with the given id for the given principal.- Specified by:
getFileSystemItemById
in interfaceFileSystemItemManager
- Returns:
- the
FileSystemItem
or null if none matches the given id - See Also:
-
getFileSystemItemById
Description copied from interface:FileSystemItemManager
Gets theFileSystemItem
with the given id and parent id for the given principal.- Specified by:
getFileSystemItemById
in interfaceFileSystemItemManager
- Returns:
- the
FileSystemItem
or null if none matches the given id and parent id - See Also:
-
getChildren
Description copied from interface:FileSystemItemManager
Gets the children of theFileSystemItem
with the given id for the given principal.- Specified by:
getChildren
in interfaceFileSystemItemManager
- See Also:
-
scrollDescendants
public ScrollFileSystemItemList scrollDescendants(String id, NuxeoPrincipal principal, String scrollId, int batchSize, long keepAlive) Description copied from interface:FileSystemItemManager
Retrieves at mostbatchSize
descendants of theFolderItem
with the givenid
for the givenprincipal
and the givenscrollId
.When passing a null
scrollId
the initial search request is executed and the first batch of results is returned along with ascrollId
which should be passed to the next call in order to retrieve the next batch of results.Ideally, the search context made available by the initial search request is kept alive during
keepAlive
milliseconds ifkeepAlive
is positive.Results are not necessarily sorted.
- Specified by:
scrollDescendants
in interfaceFileSystemItemManager
- See Also:
-
canMove
Description copied from interface:FileSystemItemManager
Return true if theFileSystemItem
with the given source id can be moved to theFileSystemItem
with the given destination id for the given principal.- Specified by:
canMove
in interfaceFileSystemItemManager
- See Also:
-
createFolder
public FolderItem createFolder(String parentId, String name, NuxeoPrincipal principal, boolean overwrite) Description copied from interface:FileSystemItemManager
Creates a folder with the given name in theFileSystemItem
with the given id for the given principal.- Specified by:
createFolder
in interfaceFileSystemItemManager
overwrite
- allows to overwrite an existing folder with the same title- See Also:
-
createFile
Description copied from interface:FileSystemItemManager
Creates a file with the given blob in theFileSystemItem
with the given id for the given principal.- Specified by:
createFile
in interfaceFileSystemItemManager
overwrite
- allows to overwrite an existing file with the same title- See Also:
-
updateFile
Description copied from interface:FileSystemItemManager
Updates theFileSystemItem
with the given id with the given blob for the given principal.- Specified by:
updateFile
in interfaceFileSystemItemManager
- See Also:
-
updateFile
Description copied from interface:FileSystemItemManager
Updates theFileSystemItem
with the given id and parent id with the given blob for the given principal.- Specified by:
updateFile
in interfaceFileSystemItemManager
- See Also:
-
delete
Description copied from interface:FileSystemItemManager
Deletes theFileSystemItem
with the given id for the given principal.- Specified by:
delete
in interfaceFileSystemItemManager
- See Also:
-
delete
Description copied from interface:FileSystemItemManager
Deletes theFileSystemItem
with the given id and parent id for the given principal.- Specified by:
delete
in interfaceFileSystemItemManager
- See Also:
-
rename
Description copied from interface:FileSystemItemManager
Renames theFileSystemItem
with the given id with the given name for the given principal.- Specified by:
rename
in interfaceFileSystemItemManager
- See Also:
-
move
Description copied from interface:FileSystemItemManager
Moves theFileSystemItem
with the given source id to theFileSystemItem
with the given destination id for the given principal.- Specified by:
move
in interfaceFileSystemItemManager
- See Also:
-
getFileSystemItemAdapterService
-
updateFile
-
delete
-