Package org.nuxeo.drive.service
Interface FileSystemItemManager
-
- All Known Implementing Classes:
FileSystemItemManagerImpl
public interface FileSystemItemManagerProvides an API to manage usual file system operations on aFileSystemItemgiven its id. Allows the following actions:- Read
- Read children
- Read descendants
- Create
- Update
- Delete
- Rename
- Move
- Author:
- Antoine Taillefer
- See Also:
FileSystemItemManagerImpl
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated 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.default FileItemcreateFile(String parentId, Blob blob, NuxeoPrincipal principal)Deprecated.since 9.1, usecreateFile(String, Blob, NuxeoPrincipal, boolean)insteadFileItemcreateFile(String parentId, Blob blob, NuxeoPrincipal principal, boolean overwrite)Creates a file with the given blob in theFileSystemItemwith the given id for the given principal.default FolderItemcreateFolder(String parentId, String name, NuxeoPrincipal principal)Deprecated.since 9.1, usecreateFolder(String, String, NuxeoPrincipal, boolean)insteadFolderItemcreateFolder(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.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.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.
-
-
-
Method Detail
-
getTopLevelFolder
FolderItem getTopLevelFolder(NuxeoPrincipal principal)
Gets the top levelFolderItemfor the given principal.
-
exists
boolean exists(String id, NuxeoPrincipal principal)
Returns true if aFileSystemItemwith the given id exists for the given principal.
-
getFileSystemItemById
FileSystemItem getFileSystemItemById(String id, NuxeoPrincipal principal)
Gets theFileSystemItemwith the given id for the given principal.- Returns:
- the
FileSystemItemor null if none matches the given id - See Also:
FileSystemItemFactory.getFileSystemItemById(String, NuxeoPrincipal)
-
getFileSystemItemById
FileSystemItem getFileSystemItemById(String id, String parentId, NuxeoPrincipal principal)
Gets theFileSystemItemwith the given id and parent id for the given principal.- Returns:
- the
FileSystemItemor null if none matches the given id and parent id - Since:
- 6.0
- See Also:
getFileSystemItemById(String, NuxeoPrincipal)
-
getChildren
List<FileSystemItem> getChildren(String id, NuxeoPrincipal principal)
Gets the children of theFileSystemItemwith the given id for the given principal.- See Also:
FolderItem.getChildren()
-
scrollDescendants
ScrollFileSystemItemList scrollDescendants(String id, NuxeoPrincipal principal, String scrollId, int batchSize, long keepAlive)
Retrieves 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.
- Since:
- 8.3
- See Also:
FolderItem.scrollDescendants(String, int, long)
-
canMove
boolean canMove(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.- See Also:
FileSystemItem.canMove(FolderItem)
-
createFolder
@Deprecated default FolderItem createFolder(String parentId, String name, NuxeoPrincipal principal)
Deprecated.since 9.1, usecreateFolder(String, String, NuxeoPrincipal, boolean)insteadCreates a folder with the given name in theFileSystemItemwith the given id for the given principal.- See Also:
FolderItem.createFolder(String)
-
createFolder
FolderItem createFolder(String parentId, String name, NuxeoPrincipal principal, boolean overwrite)
Creates a folder with the given name in theFileSystemItemwith the given id for the given principal.- Parameters:
overwrite- allows to overwrite an existing folder with the same title- Since:
- 9.1
- See Also:
FolderItem.createFolder(String, boolean)
-
createFile
@Deprecated default FileItem createFile(String parentId, Blob blob, NuxeoPrincipal principal)
Deprecated.since 9.1, usecreateFile(String, Blob, NuxeoPrincipal, boolean)insteadCreates a file with the given blob in theFileSystemItemwith the given id for the given principal.- See Also:
FolderItem.createFile(Blob)
-
createFile
FileItem createFile(String parentId, Blob blob, NuxeoPrincipal principal, boolean overwrite)
Creates a file with the given blob in theFileSystemItemwith the given id for the given principal.- Parameters:
overwrite- allows to overwrite an existing file with the same title- Since:
- 9.1
- See Also:
FolderItem.createFile(Blob, boolean)
-
updateFile
FileItem updateFile(String id, Blob blob, NuxeoPrincipal principal)
Updates theFileSystemItemwith the given id with the given blob for the given principal.- See Also:
FileItem.setBlob(Blob)
-
updateFile
FileItem updateFile(String id, String parentId, Blob blob, NuxeoPrincipal principal)
Updates theFileSystemItemwith the given id and parent id with the given blob for the given principal.- Since:
- 6.0
- See Also:
updateFile(String, Blob, NuxeoPrincipal)
-
delete
void delete(String id, NuxeoPrincipal principal)
Deletes theFileSystemItemwith the given id for the given principal.- See Also:
FileSystemItem.delete()
-
delete
void delete(String id, String parentId, NuxeoPrincipal principal)
Deletes theFileSystemItemwith the given id and parent id for the given principal.- Since:
- 6.0
- See Also:
delete(String, NuxeoPrincipal)
-
rename
FileSystemItem rename(String id, String name, NuxeoPrincipal principal)
Renames theFileSystemItemwith the given id with the given name for the given principal.- See Also:
FileSystemItem.rename(String)
-
move
FileSystemItem move(String srcId, String destId, NuxeoPrincipal principal)
Moves theFileSystemItemwith the given source id to theFileSystemItemwith the given destination id for the given principal.- See Also:
FileSystemItem.move(FolderItem)
-
-