Package org.nuxeo.drive.service
Interface FileSystemItemManager
-
- All Known Implementing Classes:
FileSystemItemManagerImpl
public interface FileSystemItemManager
Provides an API to manage usual file system operations on aFileSystemItem
given 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 boolean
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.default FileItem
createFile(String parentId, Blob blob, NuxeoPrincipal principal)
Deprecated.since 9.1, usecreateFile(String, Blob, NuxeoPrincipal, boolean)
insteadFileItem
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.default FolderItem
createFolder(String parentId, String name, NuxeoPrincipal principal)
Deprecated.since 9.1, usecreateFolder(String, String, NuxeoPrincipal, boolean)
insteadFolderItem
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.boolean
exists(String id, NuxeoPrincipal principal)
Returns true if aFileSystemItem
with the given id exists for the given principal.List<FileSystemItem>
getChildren(String id, NuxeoPrincipal principal)
Gets the children of theFileSystemItem
with the given id for the given principal.FileSystemItem
getFileSystemItemById(String id, String parentId, NuxeoPrincipal principal)
Gets theFileSystemItem
with the given id and parent id for the given principal.FileSystemItem
getFileSystemItemById(String id, NuxeoPrincipal principal)
Gets theFileSystemItem
with the given id for the given principal.FolderItem
getTopLevelFolder(NuxeoPrincipal principal)
Gets the top levelFolderItem
for the given principal.FileSystemItem
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.FileSystemItem
rename(String id, String name, NuxeoPrincipal principal)
Renames theFileSystemItem
with the given id with the given name for the given principal.ScrollFileSystemItemList
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
.FileItem
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.FileItem
updateFile(String id, Blob blob, NuxeoPrincipal principal)
Updates theFileSystemItem
with the given id with the given blob for the given principal.
-
-
-
Method Detail
-
getTopLevelFolder
FolderItem getTopLevelFolder(NuxeoPrincipal principal)
Gets the top levelFolderItem
for the given principal.
-
exists
boolean exists(String id, NuxeoPrincipal principal)
Returns true if aFileSystemItem
with the given id exists for the given principal.
-
getFileSystemItemById
FileSystemItem getFileSystemItemById(String id, NuxeoPrincipal principal)
Gets theFileSystemItem
with the given id for the given principal.- Returns:
- the
FileSystemItem
or null if none matches the given id - See Also:
FileSystemItemFactory.getFileSystemItemById(String, NuxeoPrincipal)
-
getFileSystemItemById
FileSystemItem getFileSystemItemById(String id, String parentId, NuxeoPrincipal principal)
Gets theFileSystemItem
with the given id and parent id for the given principal.- Returns:
- the
FileSystemItem
or 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 theFileSystemItem
with 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 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.
- Since:
- 8.3
- See Also:
FolderItem.scrollDescendants(String, int, long)
-
canMove
boolean 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.- 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 theFileSystemItem
with 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 theFileSystemItem
with 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 theFileSystemItem
with 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 theFileSystemItem
with 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 theFileSystemItem
with 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 theFileSystemItem
with 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 theFileSystemItem
with the given id for the given principal.- See Also:
FileSystemItem.delete()
-
delete
void delete(String id, String parentId, NuxeoPrincipal principal)
Deletes theFileSystemItem
with 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 theFileSystemItem
with 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 theFileSystemItem
with the given source id to theFileSystemItem
with the given destination id for the given principal.- See Also:
FileSystemItem.move(FolderItem)
-
-