use of org.nuxeo.drive.service.FileSystemItemManager in project nuxeo-drive-server by nuxeo.
the class NuxeoDriveGetChildren method run.
@OperationMethod
public Blob run() throws IOException {
FileSystemItemManager fileSystemItemManager = Framework.getService(FileSystemItemManager.class);
List<FileSystemItem> children = fileSystemItemManager.getChildren(id, ctx.getPrincipal());
return Blobs.createJSONBlobFromValue(children);
}
use of org.nuxeo.drive.service.FileSystemItemManager in project nuxeo-drive-server by nuxeo.
the class NuxeoDriveFileSystemItemExists method run.
@OperationMethod
public Blob run() throws IOException {
FileSystemItemManager fileSystemItemManager = Framework.getService(FileSystemItemManager.class);
boolean exists = fileSystemItemManager.exists(id, ctx.getPrincipal());
return Blobs.createJSONBlobFromValue(exists);
}
use of org.nuxeo.drive.service.FileSystemItemManager in project nuxeo-drive-server by nuxeo.
the class UserWorkspaceSyncRootParentFactory method getVirtualFolderItem.
@Override
public FolderItem getVirtualFolderItem(Principal principal) {
FileSystemItemManager fileSystemItemManager = Framework.getService(FileSystemItemManager.class);
FolderItem topLevelFolder = fileSystemItemManager.getTopLevelFolder(principal);
if (topLevelFolder == null) {
throw new NuxeoException("Found no top level folder item. Please check your contribution to the following extension point: <extension target=\"org.nuxeo.drive.service.FileSystemItemAdapterService\" point=\"topLevelFolderItemFactory\">.");
}
return new UserWorkspaceSyncRootParentFolderItem(getName(), principal, topLevelFolder.getId(), topLevelFolder.getPath(), folderName);
}
use of org.nuxeo.drive.service.FileSystemItemManager in project nuxeo-drive-server by nuxeo.
the class NuxeoDriveMove method run.
@OperationMethod
public Blob run() throws InvalidOperationException, IOException {
FileSystemItemManager fileSystemItemManager = Framework.getService(FileSystemItemManager.class);
FileSystemItem fsItem;
try {
fsItem = fileSystemItemManager.move(srcId, destId, ctx.getPrincipal());
} catch (UnsupportedOperationException e) {
throw new InvalidOperationException(e);
}
return Blobs.createJSONBlobFromValue(fsItem);
}
use of org.nuxeo.drive.service.FileSystemItemManager in project nuxeo-drive-server by nuxeo.
the class NuxeoDriveCanMove method run.
@OperationMethod
public Blob run() throws IOException {
boolean canMove = false;
try {
FileSystemItemManager fileSystemItemManager = Framework.getService(FileSystemItemManager.class);
canMove = fileSystemItemManager.canMove(srcId, destId, ctx.getPrincipal());
} catch (RootlessItemException e) {
// active sync root: just return false in that case.
if (log.isDebugEnabled()) {
log.debug(String.format("Cannot move %s to %s: %s", srcId, destId, e.getMessage()), e);
}
}
return Blobs.createJSONBlobFromValue(canMove);
}
Aggregations