public class FileSystemItemManagerImpl extends Object implements FileSystemItemManager
FileSystemItemManager
.Modifier and Type | Class and Description |
---|---|
protected class |
FileSystemItemManagerImpl.SessionCloser
Closer for a
CoreSession object held by openedSessions . |
Modifier and Type | Field and Description |
---|---|
protected ThreadLocal<Map<String,CoreSession>> |
openedSessions |
Constructor and Description |
---|
FileSystemItemManagerImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
canMove(String srcId,
String destId,
Principal principal)
Return true if the
FileSystemItem with the given source id can be moved to the FileSystemItem
with the given destination id for the given principal. |
FileItem |
createFile(String parentId,
Blob blob,
Principal principal,
boolean overwrite)
Creates a file with the given blob in the
FileSystemItem with the given id for the given principal. |
FolderItem |
createFolder(String parentId,
String name,
Principal principal,
boolean overwrite)
Creates a folder with the given name in the
FileSystemItem with the given id for the given principal. |
protected void |
delete(FileSystemItem fsItem) |
void |
delete(String id,
Principal principal)
Deletes the
FileSystemItem with the given id for the given principal. |
void |
delete(String id,
String parentId,
Principal principal)
Deletes the
FileSystemItem with the given id and parent id for the given principal. |
boolean |
exists(String id,
Principal principal)
Returns true if a
FileSystemItem with the given id exists for the given principal. |
List<FileSystemItem> |
getChildren(String id,
Principal principal)
Gets the children of the
FileSystemItem with the given id for the given principal. |
protected FileSystemItemAdapterService |
getFileSystemItemAdapterService() |
FileSystemItem |
getFileSystemItemById(String id,
Principal principal)
Gets the
FileSystemItem with the given id for the given principal. |
FileSystemItem |
getFileSystemItemById(String id,
String parentId,
Principal principal)
Gets the
FileSystemItem with the given id and parent id for the given principal. |
CoreSession |
getSession(String repositoryName,
Principal principal)
Deprecated.
|
List<FileSystemItem> |
getTopLevelChildren(Principal principal)
Gets the children of the top level
FolderItem for the given principal. |
FolderItem |
getTopLevelFolder(Principal principal)
Gets the top level
FolderItem for the given principal. |
FileSystemItem |
move(String srcId,
String destId,
Principal principal)
Moves the
FileSystemItem with the given source id to the FileSystemItem with the given
destination id for the given principal. |
FileSystemItem |
rename(String id,
String name,
Principal principal)
Renames the
FileSystemItem with the given id with the given name for the given principal. |
ScrollFileSystemItemList |
scrollDescendants(String id,
Principal principal,
String scrollId,
int batchSize,
long keepAlive)
Retrieves at most
batchSize descendants of the FolderItem with the given id for the given
principal and the given scrollId . |
protected FileItem |
updateFile(FileSystemItem fsItem,
Blob blob) |
FileItem |
updateFile(String id,
Blob blob,
Principal principal)
Updates the
FileSystemItem with the given id with the given blob for the given principal. |
FileItem |
updateFile(String id,
String parentId,
Blob blob,
Principal principal)
Updates the
FileSystemItem with the given id and parent id with the given blob for the given principal. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createFile, createFolder
protected final ThreadLocal<Map<String,CoreSession>> openedSessions
public FileSystemItemManagerImpl()
@Deprecated public CoreSession getSession(String repositoryName, Principal principal)
FileSystemItemManager
getSession
in interface FileSystemItemManager
public List<FileSystemItem> getTopLevelChildren(Principal principal)
FileSystemItemManager
FolderItem
for the given principal.getTopLevelChildren
in interface FileSystemItemManager
public FolderItem getTopLevelFolder(Principal principal)
FileSystemItemManager
FolderItem
for the given principal.getTopLevelFolder
in interface FileSystemItemManager
public boolean exists(String id, Principal principal)
FileSystemItemManager
FileSystemItem
with the given id exists for the given principal.exists
in interface FileSystemItemManager
FileSystemItemFactory.exists(String, Principal)
public FileSystemItem getFileSystemItemById(String id, Principal principal)
FileSystemItemManager
FileSystemItem
with the given id for the given principal.getFileSystemItemById
in interface FileSystemItemManager
FileSystemItem
or null if none matches the given idFileSystemItemFactory.getFileSystemItemById(String, Principal)
public FileSystemItem getFileSystemItemById(String id, String parentId, Principal principal)
FileSystemItemManager
FileSystemItem
with the given id and parent id for the given principal.getFileSystemItemById
in interface FileSystemItemManager
FileSystemItem
or null if none matches the given id and parent idFileSystemItemManager.getFileSystemItemById(String, Principal)
public List<FileSystemItem> getChildren(String id, Principal principal)
FileSystemItemManager
FileSystemItem
with the given id for the given principal.getChildren
in interface FileSystemItemManager
FolderItem.getChildren()
public ScrollFileSystemItemList scrollDescendants(String id, Principal principal, String scrollId, int batchSize, long keepAlive)
FileSystemItemManager
batchSize
descendants of the FolderItem
with the given id
for the given
principal
and the given scrollId
.
When passing a null scrollId
the initial search request is executed and the first batch of results is
returned along with a scrollId
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 if keepAlive
is positive.
Results are not necessarily sorted.
scrollDescendants
in interface FileSystemItemManager
FolderItem.scrollDescendants(String, int, long)
public boolean canMove(String srcId, String destId, Principal principal)
FileSystemItemManager
FileSystemItem
with the given source id can be moved to the FileSystemItem
with the given destination id for the given principal.canMove
in interface FileSystemItemManager
FileSystemItem#getCanMove(String)
public FolderItem createFolder(String parentId, String name, Principal principal, boolean overwrite)
FileSystemItemManager
FileSystemItem
with the given id for the given principal.createFolder
in interface FileSystemItemManager
overwrite
- allows to overwrite an existing folder with the same titleFolderItem.createFolder(String, boolean)
public FileItem createFile(String parentId, Blob blob, Principal principal, boolean overwrite)
FileSystemItemManager
FileSystemItem
with the given id for the given principal.createFile
in interface FileSystemItemManager
overwrite
- allows to overwrite an existing folder with the same titleFolderItem.createFile(Blob, boolean)
public FileItem updateFile(String id, Blob blob, Principal principal)
FileSystemItemManager
FileSystemItem
with the given id with the given blob for the given principal.updateFile
in interface FileSystemItemManager
FileItem.setBlob(Blob)
public FileItem updateFile(String id, String parentId, Blob blob, Principal principal)
FileSystemItemManager
FileSystemItem
with the given id and parent id with the given blob for the given principal.updateFile
in interface FileSystemItemManager
FileSystemItemManager.updateFile(String, Blob, Principal)
public void delete(String id, Principal principal)
FileSystemItemManager
FileSystemItem
with the given id for the given principal.delete
in interface FileSystemItemManager
FileSystemItem.delete()
public void delete(String id, String parentId, Principal principal)
FileSystemItemManager
FileSystemItem
with the given id and parent id for the given principal.delete
in interface FileSystemItemManager
FileSystemItemManager.delete(String, Principal)
public FileSystemItem rename(String id, String name, Principal principal)
FileSystemItemManager
FileSystemItem
with the given id with the given name for the given principal.rename
in interface FileSystemItemManager
FileSystemItem.rename(String)
public FileSystemItem move(String srcId, String destId, Principal principal)
FileSystemItemManager
FileSystemItem
with the given source id to the FileSystemItem
with the given
destination id for the given principal.move
in interface FileSystemItemManager
FileSystemItem#move(String)
protected FileSystemItemAdapterService getFileSystemItemAdapterService()
protected FileItem updateFile(FileSystemItem fsItem, Blob blob)
protected void delete(FileSystemItem fsItem)
Copyright © 2018 Nuxeo. All rights reserved.