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 boolean
canCreateChild
protected boolean
canScrollDescendants
-
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 protected
AbstractVirtualFolderItem()
AbstractVirtualFolderItem(String factoryName, NuxeoPrincipal principal, String parentId, String parentPath, String folderName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canMove(FolderItem dest)
FileItem
createFile(Blob blob, boolean overwrite)
FolderItem
createFolder(String name, boolean overwrite)
void
delete()
boolean
equals(Object obj)
boolean
getCanCreateChild()
boolean
getCanScrollDescendants()
Returnstrue
if theFolderItem.scrollDescendants(String, int, long)
API can be used.int
hashCode()
FileSystemItem
move(FolderItem dest)
void
rename(String name)
ScrollFileSystemItemList
scrollDescendants(String scrollId, int batchSize, long keepAlive)
protected void
setCanCreateChild(boolean canCreateChild)
protected void
setCanScrollDescendants(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:
rename
in interfaceFileSystemItem
-
delete
public void delete()
- Specified by:
delete
in interfaceFileSystemItem
-
canMove
public boolean canMove(FolderItem dest)
- Specified by:
canMove
in interfaceFileSystemItem
-
move
public FileSystemItem move(FolderItem dest)
- Specified by:
move
in interfaceFileSystemItem
-
getCanScrollDescendants
public boolean getCanScrollDescendants()
Description copied from interface:FolderItem
Returnstrue
if theFolderItem.scrollDescendants(String, int, long)
API can be used.- Specified by:
getCanScrollDescendants
in interfaceFolderItem
-
scrollDescendants
public ScrollFileSystemItemList scrollDescendants(String scrollId, int batchSize, long keepAlive)
Description copied from interface:FolderItem
Retrieves at mostbatchSize
FileSystemItem
descendants for 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.
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:
scrollDescendants
in interfaceFolderItem
-
getCanCreateChild
public boolean getCanCreateChild()
- Specified by:
getCanCreateChild
in interfaceFolderItem
-
createFolder
public FolderItem createFolder(String name, boolean overwrite)
- Specified by:
createFolder
in interfaceFolderItem
overwrite
- allows to overwrite an existing folder with the same title
-
createFile
public FileItem createFile(Blob blob, boolean overwrite)
- Specified by:
createFile
in interfaceFolderItem
overwrite
- allows to overwrite an existing file with the same title
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classAbstractFileSystemItem
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractFileSystemItem
-
setCanCreateChild
protected void setCanCreateChild(boolean canCreateChild)
-
setCanScrollDescendants
protected void setCanScrollDescendants(boolean canScrollDescendants)
-
-