Package org.nuxeo.drive.service.impl
Class FileSystemItemManagerImpl
- java.lang.Object
-
- org.nuxeo.drive.service.impl.FileSystemItemManagerImpl
-
- All Implemented Interfaces:
FileSystemItemManager
public class FileSystemItemManagerImpl extends Object implements FileSystemItemManager
Default implementation of theFileSystemItemManager.- Author:
- Antoine Taillefer
-
-
Constructor Summary
Constructors Constructor Description FileSystemItemManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanMove(String srcId, String destId, NuxeoPrincipal principal)Return true if theFileSystemItemwith the given source id can be moved to theFileSystemItemwith the given destination id for the given principal.FileItemcreateFile(String parentId, Blob blob, NuxeoPrincipal principal, boolean overwrite)Creates a file with the given blob in theFileSystemItemwith the given id for the given principal.FolderItemcreateFolder(String parentId, String name, NuxeoPrincipal principal, boolean overwrite)Creates a folder with the given name in theFileSystemItemwith the given id for the given principal.voiddelete(String id, String parentId, NuxeoPrincipal principal)Deletes theFileSystemItemwith the given id and parent id for the given principal.voiddelete(String id, NuxeoPrincipal principal)Deletes theFileSystemItemwith the given id for the given principal.protected voiddelete(FileSystemItem fsItem)booleanexists(String id, NuxeoPrincipal principal)Returns true if aFileSystemItemwith the given id exists for the given principal.List<FileSystemItem>getChildren(String id, NuxeoPrincipal principal)Gets the children of theFileSystemItemwith the given id for the given principal.protected FileSystemItemAdapterServicegetFileSystemItemAdapterService()FileSystemItemgetFileSystemItemById(String id, String parentId, NuxeoPrincipal principal)Gets theFileSystemItemwith the given id and parent id for the given principal.FileSystemItemgetFileSystemItemById(String id, NuxeoPrincipal principal)Gets theFileSystemItemwith the given id for the given principal.FolderItemgetTopLevelFolder(NuxeoPrincipal principal)Gets the top levelFolderItemfor the given principal.FileSystemItemmove(String srcId, String destId, NuxeoPrincipal principal)Moves theFileSystemItemwith the given source id to theFileSystemItemwith the given destination id for the given principal.FileSystemItemrename(String id, String name, NuxeoPrincipal principal)Renames theFileSystemItemwith the given id with the given name for the given principal.ScrollFileSystemItemListscrollDescendants(String id, NuxeoPrincipal principal, String scrollId, int batchSize, long keepAlive)Retrieves at mostbatchSizedescendants of theFolderItemwith the givenidfor the givenprincipaland the givenscrollId.FileItemupdateFile(String id, String parentId, Blob blob, NuxeoPrincipal principal)Updates theFileSystemItemwith the given id and parent id with the given blob for the given principal.FileItemupdateFile(String id, Blob blob, NuxeoPrincipal principal)Updates theFileSystemItemwith the given id with the given blob for the given principal.protected FileItemupdateFile(FileSystemItem fsItem, Blob blob)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.drive.service.FileSystemItemManager
createFile, createFolder
-
-
-
-
Method Detail
-
getTopLevelFolder
public FolderItem getTopLevelFolder(NuxeoPrincipal principal)
Description copied from interface:FileSystemItemManagerGets the top levelFolderItemfor the given principal.- Specified by:
getTopLevelFolderin interfaceFileSystemItemManager
-
exists
public boolean exists(String id, NuxeoPrincipal principal)
Description copied from interface:FileSystemItemManagerReturns true if aFileSystemItemwith the given id exists for the given principal.- Specified by:
existsin interfaceFileSystemItemManager- See Also:
FileSystemItemFactory.exists(String, NuxeoPrincipal)
-
getFileSystemItemById
public FileSystemItem getFileSystemItemById(String id, NuxeoPrincipal principal)
Description copied from interface:FileSystemItemManagerGets theFileSystemItemwith the given id for the given principal.- Specified by:
getFileSystemItemByIdin interfaceFileSystemItemManager- Returns:
- the
FileSystemItemor null if none matches the given id - See Also:
FileSystemItemFactory.getFileSystemItemById(String, NuxeoPrincipal)
-
getFileSystemItemById
public FileSystemItem getFileSystemItemById(String id, String parentId, NuxeoPrincipal principal)
Description copied from interface:FileSystemItemManagerGets theFileSystemItemwith the given id and parent id for the given principal.- Specified by:
getFileSystemItemByIdin interfaceFileSystemItemManager- Returns:
- the
FileSystemItemor null if none matches the given id and parent id - See Also:
FileSystemItemManager.getFileSystemItemById(String, NuxeoPrincipal)
-
getChildren
public List<FileSystemItem> getChildren(String id, NuxeoPrincipal principal)
Description copied from interface:FileSystemItemManagerGets the children of theFileSystemItemwith the given id for the given principal.- Specified by:
getChildrenin interfaceFileSystemItemManager- See Also:
FolderItem.getChildren()
-
scrollDescendants
public ScrollFileSystemItemList scrollDescendants(String id, NuxeoPrincipal principal, String scrollId, int batchSize, long keepAlive)
Description copied from interface:FileSystemItemManagerRetrieves at mostbatchSizedescendants of theFolderItemwith the givenidfor the givenprincipaland the givenscrollId.When passing a null
scrollIdthe initial search request is executed and the first batch of results is returned along with ascrollIdwhich 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
keepAlivemilliseconds ifkeepAliveis positive.Results are not necessarily sorted.
- Specified by:
scrollDescendantsin interfaceFileSystemItemManager- See Also:
FolderItem.scrollDescendants(String, int, long)
-
canMove
public boolean canMove(String srcId, String destId, NuxeoPrincipal principal)
Description copied from interface:FileSystemItemManagerReturn true if theFileSystemItemwith the given source id can be moved to theFileSystemItemwith the given destination id for the given principal.- Specified by:
canMovein interfaceFileSystemItemManager- See Also:
FileSystemItem.canMove(FolderItem)
-
createFolder
public FolderItem createFolder(String parentId, String name, NuxeoPrincipal principal, boolean overwrite)
Description copied from interface:FileSystemItemManagerCreates a folder with the given name in theFileSystemItemwith the given id for the given principal.- Specified by:
createFolderin interfaceFileSystemItemManageroverwrite- allows to overwrite an existing folder with the same title- See Also:
FolderItem.createFolder(String, boolean)
-
createFile
public FileItem createFile(String parentId, Blob blob, NuxeoPrincipal principal, boolean overwrite)
Description copied from interface:FileSystemItemManagerCreates a file with the given blob in theFileSystemItemwith the given id for the given principal.- Specified by:
createFilein interfaceFileSystemItemManageroverwrite- allows to overwrite an existing file with the same title- See Also:
FolderItem.createFile(Blob, boolean)
-
updateFile
public FileItem updateFile(String id, Blob blob, NuxeoPrincipal principal)
Description copied from interface:FileSystemItemManagerUpdates theFileSystemItemwith the given id with the given blob for the given principal.- Specified by:
updateFilein interfaceFileSystemItemManager- See Also:
FileItem.setBlob(Blob)
-
updateFile
public FileItem updateFile(String id, String parentId, Blob blob, NuxeoPrincipal principal)
Description copied from interface:FileSystemItemManagerUpdates theFileSystemItemwith the given id and parent id with the given blob for the given principal.- Specified by:
updateFilein interfaceFileSystemItemManager- See Also:
FileSystemItemManager.updateFile(String, Blob, NuxeoPrincipal)
-
delete
public void delete(String id, NuxeoPrincipal principal)
Description copied from interface:FileSystemItemManagerDeletes theFileSystemItemwith the given id for the given principal.- Specified by:
deletein interfaceFileSystemItemManager- See Also:
FileSystemItem.delete()
-
delete
public void delete(String id, String parentId, NuxeoPrincipal principal)
Description copied from interface:FileSystemItemManagerDeletes theFileSystemItemwith the given id and parent id for the given principal.- Specified by:
deletein interfaceFileSystemItemManager- See Also:
FileSystemItemManager.delete(String, NuxeoPrincipal)
-
rename
public FileSystemItem rename(String id, String name, NuxeoPrincipal principal)
Description copied from interface:FileSystemItemManagerRenames theFileSystemItemwith the given id with the given name for the given principal.- Specified by:
renamein interfaceFileSystemItemManager- See Also:
FileSystemItem.rename(String)
-
move
public FileSystemItem move(String srcId, String destId, NuxeoPrincipal principal)
Description copied from interface:FileSystemItemManagerMoves theFileSystemItemwith the given source id to theFileSystemItemwith the given destination id for the given principal.- Specified by:
movein interfaceFileSystemItemManager- See Also:
FileSystemItem.move(FolderItem)
-
getFileSystemItemAdapterService
protected FileSystemItemAdapterService getFileSystemItemAdapterService()
-
updateFile
protected FileItem updateFile(FileSystemItem fsItem, Blob blob)
-
delete
protected void delete(FileSystemItem fsItem)
-
-