Class AbstractFileSystemItemFactory
- All Implemented Interfaces:
FileSystemItemFactory
- Direct Known Subclasses:
AbstractSyncRootFolderItemFactory
,DefaultFileSystemItemFactory
,UserSyncRootParentFactory
,UserWorkspaceTopLevelFactory
FileSystemItemFactory
implementers. It is DocumentModel
backed.- Author:
- Antoine Taillefer
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected FileSystemItem
adaptDocument
(DocumentModel doc, boolean forceParentItem, FolderItem parentItem) protected abstract FileSystemItem
adaptDocument
(DocumentModel doc, boolean forceParentItem, FolderItem parentItem, boolean relaxSyncRootConstraint, boolean getLockInfo) Adapts the givenDocumentModel
to aFileSystemItem
.boolean
Returns true if the givenFileSystemItem
id can be handled by this factory.boolean
exists
(String id, NuxeoPrincipal principal) The default factory considers that aFileSystemItem
with the given id exists if the backingDocumentModel
can be fetched andisFileSystemItem(DocumentModel)
returns true.protected DocumentModel
getDocumentById
(String docId, CoreSession session) Gets theFileSystemItem
for the givenDocumentModel
.getFileSystemItem
(DocumentModel doc, boolean includeDeleted) Gets theFileSystemItem
for the givenDocumentModel
.getFileSystemItem
(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint) Gets theFileSystemItem
for the givenDocumentModel
.getFileSystemItem
(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint, boolean getLockInfo) Gets theFileSystemItem
for the givenDocumentModel
.protected FileSystemItem
getFileSystemItem
(DocumentModel doc, boolean forceParentItem, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint, boolean getLockInfo) getFileSystemItem
(DocumentModel doc, FolderItem parentItem) getFileSystemItem
(DocumentModel doc, FolderItem parentItem, boolean includeDeleted) getFileSystemItem
(DocumentModel doc, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint) getFileSystemItem
(DocumentModel doc, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint, boolean getLockInfo) getFileSystemItemById
(String id, String parentId, NuxeoPrincipal principal) Gets theFileSystemItem
with the given id and parent id using a core session fetched with the given principal.getFileSystemItemById
(String id, NuxeoPrincipal principal) Gets theFileSystemItem
with the given id using a core session fetched with the given principal.getName()
Gets the factory unique name.boolean
Returns true if the givenDocumentModel
is adaptable as aFileSystemItem
.boolean
isFileSystemItem
(DocumentModel doc, boolean includeDeleted) Returns true if the givenDocumentModel
is adaptable as aFileSystemItem
.protected String[]
void
Sets the factory unique name.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.nuxeo.drive.service.FileSystemItemFactory
handleParameters, isFileSystemItem
-
Field Details
-
name
-
-
Constructor Details
-
AbstractFileSystemItemFactory
public AbstractFileSystemItemFactory()
-
-
Method Details
-
adaptDocument
protected abstract FileSystemItem adaptDocument(DocumentModel doc, boolean forceParentItem, FolderItem parentItem, boolean relaxSyncRootConstraint, boolean getLockInfo) Adapts the givenDocumentModel
to aFileSystemItem
. -
getName
Description copied from interface:FileSystemItemFactory
Gets the factory unique name.- Specified by:
getName
in interfaceFileSystemItemFactory
-
setName
Description copied from interface:FileSystemItemFactory
Sets the factory unique name.- Specified by:
setName
in interfaceFileSystemItemFactory
-
isFileSystemItem
Description copied from interface:FileSystemItemFactory
Returns true if the givenDocumentModel
is adaptable as aFileSystemItem
.- Specified by:
isFileSystemItem
in interfaceFileSystemItemFactory
- See Also:
-
isFileSystemItem
Description copied from interface:FileSystemItemFactory
Returns true if the givenDocumentModel
is adaptable as aFileSystemItem
. IfincludeDeleted
is true no filter is applied on the "trashed" state, else if the document is in this state it is not considered as adaptable as aFileSystemItem
, thus the method returns false.- Specified by:
isFileSystemItem
in interfaceFileSystemItemFactory
-
getFileSystemItem
Description copied from interface:FileSystemItemFactory
Gets theFileSystemItem
for the givenDocumentModel
.- Specified by:
getFileSystemItem
in interfaceFileSystemItemFactory
- Returns:
- the
FileSystemItem
or null if theDocumentModel
is not adaptable as aFileSystemItem
- See Also:
-
getFileSystemItem
Description copied from interface:FileSystemItemFactory
Gets theFileSystemItem
for the givenDocumentModel
. IfincludeDeleted
is true no filter is applied on the "trashed" state, else if the document is in the trash it is not considered as adaptable as aFileSystemItem
, thus the method returns null.- Specified by:
getFileSystemItem
in interfaceFileSystemItemFactory
- Returns:
- the
FileSystemItem
or null if theDocumentModel
is not adaptable as aFileSystemItem
- See Also:
-
getFileSystemItem
public FileSystemItem getFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint) Description copied from interface:FileSystemItemFactory
Gets theFileSystemItem
for the givenDocumentModel
.If
includeDeleted
is true no filter is applied on the "trashed" state, else if the document is in this state it is not considered as adaptable as aFileSystemItem
, thus the method returns null.If
relaxSyncRootConstraint
is true no filter is applied on the synchronization root aspect for the current user.- Specified by:
getFileSystemItem
in interfaceFileSystemItemFactory
- Returns:
- the
FileSystemItem
or null if theDocumentModel
is not adaptable as aFileSystemItem
- See Also:
-
getFileSystemItem
public FileSystemItem getFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint, boolean getLockInfo) Description copied from interface:FileSystemItemFactory
Gets theFileSystemItem
for the givenDocumentModel
.If
includeDeleted
is true no filter is applied on the "trashed" state, else if the document is in this state it is not considered as adaptable as aFileSystemItem
, thus the method returns null.If
relaxSyncRootConstraint
is true no filter is applied on the synchronization root aspect for the current user.If
getLockInfo
is true theLock
is fetched from theDocumentModel
and set on the returnedFileSystemItem
.- Specified by:
getFileSystemItem
in interfaceFileSystemItemFactory
- Returns:
- the
FileSystemItem
or null if theDocumentModel
is not adaptable as aFileSystemItem
- See Also:
-
getFileSystemItem
Description copied from interface:FileSystemItemFactory
- Specified by:
getFileSystemItem
in interfaceFileSystemItemFactory
- Returns:
- the
FileSystemItem
or null if theDocumentModel
is not adaptable as aFileSystemItem
- See Also:
-
getFileSystemItem
public FileSystemItem getFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted) Description copied from interface:FileSystemItemFactory
Gets theFileSystemItem
for the givenDocumentModel
forcing its parent with the givenparentItem
. IfincludeDeleted
is true no filter is applied on the "trashed" state, else if the document is in the trash it is not considered as adaptable as aFileSystemItem
, thus the method returns null.- Specified by:
getFileSystemItem
in interfaceFileSystemItemFactory
- Returns:
- the
FileSystemItem
or null if theDocumentModel
is not adaptable as aFileSystemItem
-
getFileSystemItem
public FileSystemItem getFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint) Description copied from interface:FileSystemItemFactory
Gets theFileSystemItem
for the givenDocumentModel
forcing its parent with the givenparentItem
.If
includeDeleted
is true no filter is applied on the "trashed" state, else if the document is in this state it is not considered as adaptable as aFileSystemItem
, thus the method returns null.If
relaxSyncRootConstraint
is true no filter is applied on the synchronization root aspect for the current user.- Specified by:
getFileSystemItem
in interfaceFileSystemItemFactory
- Returns:
- the
FileSystemItem
or null if theDocumentModel
is not adaptable as aFileSystemItem
-
getFileSystemItem
public FileSystemItem getFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint, boolean getLockInfo) Description copied from interface:FileSystemItemFactory
Gets theFileSystemItem
for the givenDocumentModel
forcing its parent with the givenparentItem
.If
includeDeleted
is true no filter is applied on the "trashed" state, else if the document is in this state it is not considered as adaptable as aFileSystemItem
, thus the method returns null.If
relaxSyncRootConstraint
is true no filter is applied on the synchronization root aspect for the current user.If
getLockInfo
is true theLock
is fetched from theDocumentModel
and set on the returnedFileSystemItem
.- Specified by:
getFileSystemItem
in interfaceFileSystemItemFactory
- Returns:
- the
FileSystemItem
or null if theDocumentModel
is not adaptable as aFileSystemItem
-
canHandleFileSystemItemId
Description copied from interface:FileSystemItemFactory
Returns true if the givenFileSystemItem
id can be handled by this factory. It is typically the case when the factory has been responsible for generating theFileSystemItem
.- Specified by:
canHandleFileSystemItemId
in interfaceFileSystemItemFactory
-
exists
The default factory considers that aFileSystemItem
with the given id exists if the backingDocumentModel
can be fetched andisFileSystemItem(DocumentModel)
returns true.- Specified by:
exists
in interfaceFileSystemItemFactory
- See Also:
-
getFileSystemItemById
Description copied from interface:FileSystemItemFactory
Gets theFileSystemItem
with the given id using a core session fetched with the given principal.- Specified by:
getFileSystemItemById
in interfaceFileSystemItemFactory
- Returns:
- the
FileSystemItem
or null if none matches the given id
-
getFileSystemItemById
Description copied from interface:FileSystemItemFactory
Gets theFileSystemItem
with the given id and parent id using a core session fetched with the given principal.- Specified by:
getFileSystemItemById
in interfaceFileSystemItemFactory
- Returns:
- the
FileSystemItem
or null if none matches the given id and parent id
-
adaptDocument
protected FileSystemItem adaptDocument(DocumentModel doc, boolean forceParentItem, FolderItem parentItem) -
getFileSystemItem
protected FileSystemItem getFileSystemItem(DocumentModel doc, boolean forceParentItem, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint, boolean getLockInfo) -
parseFileSystemId
-
getDocumentById
-