Package org.nuxeo.drive.adapter.impl
Class AbstractVirtualFolderItem
- java.lang.Object
-
- org.nuxeo.drive.adapter.impl.AbstractFileSystemItem
-
- org.nuxeo.drive.adapter.impl.AbstractVirtualFolderItem
-
- All Implemented Interfaces:
Comparable<FileSystemItem>,FileSystemItem,FolderItem
- Direct Known Subclasses:
DefaultTopLevelFolderItem,PermissionTopLevelFolderItem,SharedSyncRootParentFolderItem,UserWorkspaceSyncRootParentFolderItem
public abstract class AbstractVirtualFolderItem extends AbstractFileSystemItem implements FolderItem
Base implementation of a virtualFolderItem.- Author:
- Antoine Taillefer
-
-
Field Summary
Fields Modifier and Type Field Description protected booleancanCreateChildprotected booleancanScrollDescendants-
Fields inherited from class org.nuxeo.drive.adapter.impl.AbstractFileSystemItem
canDelete, canRename, creationDate, creator, factoryName, FILE_SYSTEM_ITEM_ID_SEPARATOR, FILE_SYSTEM_ITEM_PATH_SEPARATOR, folder, id, lastContributor, lastModificationDate, lockInfo, name, parentId, path, principal, userName
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractVirtualFolderItem()AbstractVirtualFolderItem(String factoryName, NuxeoPrincipal principal, String parentId, String parentPath, String folderName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanMove(FolderItem dest)FileItemcreateFile(Blob blob, boolean overwrite)FolderItemcreateFolder(String name, boolean overwrite)voiddelete()booleanequals(Object obj)booleangetCanCreateChild()booleangetCanScrollDescendants()Returnstrueif theFolderItem.scrollDescendants(String, int, long)API can be used.inthashCode()FileSystemItemmove(FolderItem dest)voidrename(String name)ScrollFileSystemItemListscrollDescendants(String scrollId, int batchSize, long keepAlive)protected voidsetCanCreateChild(boolean canCreateChild)protected voidsetCanScrollDescendants(boolean canScrollDescendants)-
Methods inherited from class org.nuxeo.drive.adapter.impl.AbstractFileSystemItem
compareTo, getCanDelete, getCanRename, getCreationDate, getCreator, getFileSystemItemAdapterService, getId, getLastContributor, getLastModificationDate, getLockInfo, getName, getParentId, getPath, getUserName, isFolder, setCanDelete, setCanRename, setCreationDate, setCreator, setFolder, setId, setLastContributor, setLastModificationDate, setLockInfo, setName, setParentId, setPath, setUserName, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface org.nuxeo.drive.adapter.FileSystemItem
getCanDelete, getCanRename, getCreationDate, getCreator, getId, getLastContributor, getLastModificationDate, getLockInfo, getName, getParentId, getPath, isFolder
-
Methods inherited from interface org.nuxeo.drive.adapter.FolderItem
createFile, createFolder, getChildren
-
-
-
-
Constructor Detail
-
AbstractVirtualFolderItem
public AbstractVirtualFolderItem(String factoryName, NuxeoPrincipal principal, String parentId, String parentPath, String folderName)
-
AbstractVirtualFolderItem
protected AbstractVirtualFolderItem()
-
-
Method Detail
-
rename
public void rename(String name)
- Specified by:
renamein interfaceFileSystemItem
-
delete
public void delete()
- Specified by:
deletein interfaceFileSystemItem
-
canMove
public boolean canMove(FolderItem dest)
- Specified by:
canMovein interfaceFileSystemItem
-
move
public FileSystemItem move(FolderItem dest)
- Specified by:
movein interfaceFileSystemItem
-
getCanScrollDescendants
public boolean getCanScrollDescendants()
Description copied from interface:FolderItemReturnstrueif theFolderItem.scrollDescendants(String, int, long)API can be used.- Specified by:
getCanScrollDescendantsin interfaceFolderItem
-
scrollDescendants
public ScrollFileSystemItemList scrollDescendants(String scrollId, int batchSize, long keepAlive)
Description copied from interface:FolderItemRetrieves at mostbatchSizeFileSystemItemdescendants for 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.
This method is protected by a
Semaphore, made available byFileSystemItemAdapterService.getScrollBatchSemaphore(), to limit the number of concurrent executions and avoid too much memory pressure.- Specified by:
scrollDescendantsin interfaceFolderItem
-
getCanCreateChild
public boolean getCanCreateChild()
- Specified by:
getCanCreateChildin interfaceFolderItem
-
createFolder
public FolderItem createFolder(String name, boolean overwrite)
- Specified by:
createFolderin interfaceFolderItemoverwrite- allows to overwrite an existing folder with the same title
-
createFile
public FileItem createFile(Blob blob, boolean overwrite)
- Specified by:
createFilein interfaceFolderItemoverwrite- allows to overwrite an existing file with the same title
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classAbstractFileSystemItem
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractFileSystemItem
-
setCanCreateChild
protected void setCanCreateChild(boolean canCreateChild)
-
setCanScrollDescendants
protected void setCanScrollDescendants(boolean canScrollDescendants)
-
-