Search in sources :

Example 11 with NuxeoException

use of org.nuxeo.ecm.core.api.NuxeoException in project nuxeo-drive-server by nuxeo.

the class DefaultFileSystemItemFactoryFixture method testFolderItem.

@Test
public void testFolderItem() throws Exception {
    // ------------------------------------------------------
    // FolderItem#canCreateChild
    // ------------------------------------------------------
    // As Administrator
    FolderItem folderItem = (FolderItem) defaultFileSystemItemFactory.getFileSystemItem(folder);
    assertTrue(folderItem.getCanCreateChild());
    // As a user with READ permission
    DocumentModel rootDoc = session.getRootDocument();
    setPermission(rootDoc, "joe", SecurityConstants.READ, true);
    // Under Oracle, the READ ACL optims are not visible from the joe
    // session while the transaction has not been committed.
    TransactionHelper.commitOrRollbackTransaction();
    TransactionHelper.startTransaction();
    try (CloseableCoreSession joeSession = coreFeature.openCoreSession("joe")) {
        folder = joeSession.getDocument(folder.getRef());
        // should not be mappable as an fs item.
        try {
            defaultFileSystemItemFactory.getFileSystemItem(folder);
            fail("Should have raised RootlessItemException as ");
        } catch (RootlessItemException e) {
        // expected
        }
        // Register the sync root for Joe's account
        nuxeoDriveManager.registerSynchronizationRoot(joeSession.getPrincipal(), syncRootFolder, session);
        folderItem = (FolderItem) defaultFileSystemItemFactory.getFileSystemItem(folder);
        assertFalse(folderItem.getCanCreateChild());
        // As a user with WRITE permission
        setPermission(rootDoc, "joe", SecurityConstants.WRITE, true);
        folderItem = (FolderItem) defaultFileSystemItemFactory.getFileSystemItem(folder);
        assertTrue(folderItem.getCanCreateChild());
    }
    resetPermissions(rootDoc, "joe");
    // ------------------------------------------------------
    // FolderItem#createFile and FolderItem#createFolder
    // ------------------------------------------------------
    folder = session.getDocument(folder.getRef());
    folderItem = (FolderItem) defaultFileSystemItemFactory.getFileSystemItem(folder);
    // Note
    Blob childBlob = new StringBlob("This is the Note child.");
    childBlob.setFilename("Note child.txt");
    folderItem.createFile(childBlob);
    // File
    childBlob = new StringBlob("This is the File child.");
    childBlob.setFilename("File child.odt");
    childBlob.setMimeType("application/vnd.oasis.opendocument.text");
    folderItem.createFile(childBlob);
    // Folder
    folderItem.createFolder("Sub-folder");
    DocumentModelList children = session.query(String.format("select * from Document where ecm:parentId = '%s' order by ecm:primaryType asc", folder.getId()));
    assertEquals(3, children.size());
    // Check File
    DocumentModel file = children.get(0);
    assertEquals("File", file.getType());
    assertEquals("File child.odt", file.getTitle());
    childBlob = (Blob) file.getPropertyValue("file:content");
    assertEquals("File child.odt", childBlob.getFilename());
    assertEquals("This is the File child.", childBlob.getString());
    // Check Folder
    DocumentModel subFolder = children.get(1);
    assertEquals("Folder", subFolder.getType());
    assertEquals("Sub-folder", subFolder.getTitle());
    // Check Note
    DocumentModel note = children.get(2);
    assertEquals("Note", note.getType());
    assertEquals("Note child.txt", note.getTitle());
    childBlob = note.getAdapter(BlobHolder.class).getBlob();
    assertEquals("Note child.txt", childBlob.getFilename());
    assertEquals("This is the Note child.", childBlob.getString());
    // --------------------------------------------------------------------------------------------
    // FolderItem#getChildren, FolderItem#getCanScrollDescendants and
    // FolderItem#scrollDescendants
    // --------------------------------------------------------------------------------------------
    // Create another child adaptable as a FileSystemItem => should be
    // retrieved
    DocumentModel adaptableChild = session.createDocumentModel("/syncRoot/aFolder", "adaptableChild", "File");
    Blob adaptableChildBlob = new StringBlob("Content of another file.");
    adaptableChildBlob.setFilename("Another file.odt");
    adaptableChild.setPropertyValue("file:content", (Serializable) adaptableChildBlob);
    adaptableChild = session.createDocument(adaptableChild);
    // Create another child not adaptable as a FileSystemItem => should
    // not be retrieved
    session.createDocument(session.createDocumentModel("/syncRoot/aFolder", "notAdaptableChild", "NotSynchronizable"));
    session.save();
    // Check getChildren
    List<FileSystemItem> folderChildren = folderItem.getChildren();
    assertEquals(4, folderChildren.size());
    // Ordered
    checkChildren(folderChildren, folder.getId(), note.getId(), file.getId(), subFolder.getId(), adaptableChild.getId(), true);
    // Check scrollDescendants
    assertTrue(folderItem.getCanScrollDescendants());
    // Scroll through all descendants in one breath
    ScrollFileSystemItemList folderDescendants = folderItem.scrollDescendants(null, 10, 1000);
    String scrollId = folderDescendants.getScrollId();
    assertNotNull(scrollId);
    assertEquals(4, folderDescendants.size());
    // Order is not determined
    checkChildren(folderDescendants, folder.getId(), note.getId(), file.getId(), subFolder.getId(), adaptableChild.getId(), false);
    // Check that next call to scrollDescendants returns an empty list
    assertTrue(folderItem.scrollDescendants(scrollId, 10, 1000).isEmpty());
    // Scroll through descendants in several steps
    folderDescendants.clear();
    ScrollFileSystemItemList descendantsBatch;
    int batchSize = 2;
    scrollId = null;
    while (!(descendantsBatch = folderItem.scrollDescendants(scrollId, batchSize, 1000)).isEmpty()) {
        assertTrue(descendantsBatch.size() > 0);
        scrollId = descendantsBatch.getScrollId();
        folderDescendants.addAll(descendantsBatch);
    }
    assertEquals(4, folderDescendants.size());
    // Order is not determined
    checkChildren(folderDescendants, folder.getId(), note.getId(), file.getId(), subFolder.getId(), adaptableChild.getId(), false);
    // Check batch size limit
    try {
        folderItem.scrollDescendants(null, 10000, 1000);
        fail("Should not be able to scroll through more descendants than the maximum batch size allowed.");
    } catch (NuxeoException e) {
        log.trace(e);
    }
}
Also used : ScrollFileSystemItemList(org.nuxeo.drive.adapter.ScrollFileSystemItemList) StringBlob(org.nuxeo.ecm.core.api.impl.blob.StringBlob) Blob(org.nuxeo.ecm.core.api.Blob) StringBlob(org.nuxeo.ecm.core.api.impl.blob.StringBlob) CloseableCoreSession(org.nuxeo.ecm.core.api.CloseableCoreSession) RootlessItemException(org.nuxeo.drive.adapter.RootlessItemException) DocumentModel(org.nuxeo.ecm.core.api.DocumentModel) FolderItem(org.nuxeo.drive.adapter.FolderItem) FileSystemItem(org.nuxeo.drive.adapter.FileSystemItem) DocumentModelList(org.nuxeo.ecm.core.api.DocumentModelList) NuxeoException(org.nuxeo.ecm.core.api.NuxeoException) Test(org.junit.Test)

Example 12 with NuxeoException

use of org.nuxeo.ecm.core.api.NuxeoException in project nuxeo-drive-server by nuxeo.

the class ActiveFileSystemItemFactoryRegistry method clone.

@Override
public ActiveFileSystemItemFactoriesDescriptor clone(ActiveFileSystemItemFactoriesDescriptor orig) {
    if (log.isTraceEnabled()) {
        log.trace(String.format("Cloning contribution %s.", orig));
    }
    try {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(bos);
        oos.writeObject(orig);
        ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
        ObjectInputStream ois = new ObjectInputStream(bis);
        return (ActiveFileSystemItemFactoriesDescriptor) ois.readObject();
    } catch (IOException | ClassNotFoundException e) {
        throw new NuxeoException(String.format("Cannot clone contribution %s.", orig), e);
    }
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream) IOException(java.io.IOException) NuxeoException(org.nuxeo.ecm.core.api.NuxeoException) ObjectOutputStream(java.io.ObjectOutputStream) ObjectInputStream(java.io.ObjectInputStream)

Example 13 with NuxeoException

use of org.nuxeo.ecm.core.api.NuxeoException in project nuxeo-drive-server by nuxeo.

the class FileSystemItemFactoryRegistry method clone.

@Override
public FileSystemItemFactoryDescriptor clone(FileSystemItemFactoryDescriptor orig) {
    if (log.isTraceEnabled()) {
        log.trace(String.format("Cloning contribution with id %s", orig.getName()));
    }
    try {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(bos);
        oos.writeObject(orig);
        ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
        ObjectInputStream ois = new ObjectInputStream(bis);
        return (FileSystemItemFactoryDescriptor) ois.readObject();
    } catch (IOException | ClassNotFoundException e) {
        throw new NuxeoException("Cannot clone contribution " + orig, e);
    }
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream) IOException(java.io.IOException) NuxeoException(org.nuxeo.ecm.core.api.NuxeoException) ObjectOutputStream(java.io.ObjectOutputStream) ObjectInputStream(java.io.ObjectInputStream)

Example 14 with NuxeoException

use of org.nuxeo.ecm.core.api.NuxeoException in project nuxeo-drive-server by nuxeo.

the class TestFileSystemItemManagerService method testWriteOperations.

@Test
public void testWriteOperations() throws Exception {
    // Not allowed to create a folder in a non FolderItem
    try {
        fileSystemItemManagerService.createFolder(DEFAULT_FILE_SYSTEM_ITEM_ID_PREFIX + file.getId(), "A new folder", principal, false);
        fail("Folder creation in a non folder item should fail.");
    } catch (NuxeoException e) {
        assertEquals(String.format("Cannot create a folder in file system item with id %s because it is not a folder but is: " + "DocumentBackedFileItem(id=\"%s\", name=\"Joe.odt\")", DEFAULT_FILE_SYSTEM_ITEM_ID_PREFIX + file.getId(), DEFAULT_FILE_SYSTEM_ITEM_ID_PREFIX + file.getId()), e.getMessage());
    }
    // Folder creation
    FolderItem newFolderItem = fileSystemItemManagerService.createFolder(DEFAULT_FILE_SYSTEM_ITEM_ID_PREFIX + folder.getId(), "A new folder", principal, false);
    assertNotNull(newFolderItem);
    assertEquals(DEFAULT_FILE_SYSTEM_ITEM_ID_PREFIX + folder.getId(), newFolderItem.getParentId());
    assertEquals("A new folder", newFolderItem.getName());
    DocumentModelList folderChildren = session.query(String.format("select * from Document where ecm:parentId = '%s' and ecm:primaryType = 'Folder' order by dc:title asc", folder.getId()));
    DocumentModel newFolder = folderChildren.get(0);
    assertTrue(newFolder.isFolder());
    assertEquals("A new folder", newFolder.getTitle());
    // Parent folder children check
    assertEquals(6, fileSystemItemManagerService.getChildren(DEFAULT_FILE_SYSTEM_ITEM_ID_PREFIX + folder.getId(), principal).size());
    // NXP-21854: Check overwrite parameter
    // Test overwrite=false
    FolderItem differentFolderItem = fileSystemItemManagerService.createFolder(DEFAULT_FILE_SYSTEM_ITEM_ID_PREFIX + folder.getId(), "A new folder", principal, false);
    assertNotNull(differentFolderItem);
    assertNotEquals(newFolderItem.getId(), differentFolderItem.getId());
    assertEquals("A new folder", differentFolderItem.getName());
    // Test overwrite=true
    FolderItem otherFolderItem = fileSystemItemManagerService.createFolder(DEFAULT_FILE_SYSTEM_ITEM_ID_PREFIX + folder.getId(), "Test overwrite", principal, false);
    assertNotNull(otherFolderItem);
    assertEquals("Test overwrite", otherFolderItem.getName());
    FolderItem sameFolderItem = fileSystemItemManagerService.createFolder(DEFAULT_FILE_SYSTEM_ITEM_ID_PREFIX + folder.getId(), "Test overwrite", principal, true);
    assertNotNull(sameFolderItem);
    assertEquals(otherFolderItem.getId(), sameFolderItem.getId());
    assertEquals("Test overwrite", sameFolderItem.getName());
    // ------------------------------------------------------
    // Check #createFile
    // ------------------------------------------------------
    // File creation
    Blob blob = new StringBlob("Content of a new file.");
    blob.setFilename("New file.odt");
    blob.setMimeType("application/vnd.oasis.opendocument.text");
    FileItem fileItem = fileSystemItemManagerService.createFile(newFolderItem.getId(), blob, principal, false);
    assertNotNull(fileItem);
    assertEquals(newFolderItem.getId(), fileItem.getParentId());
    assertEquals("New file.odt", fileItem.getName());
    folderChildren = session.query(String.format("select * from Document where ecm:parentId = '%s'", newFolder.getId()));
    assertEquals(1, folderChildren.size());
    DocumentModel newFile = folderChildren.get(0);
    assertEquals("File", newFile.getType());
    assertEquals("New file.odt", newFile.getTitle());
    assertEquals("/syncRoot1/aFolder/A new folder/New file.odt", newFile.getPathAsString());
    Blob newFileBlob = (Blob) newFile.getPropertyValue("file:content");
    assertEquals("New file.odt", newFileBlob.getFilename());
    assertEquals("Content of a new file.", newFileBlob.getString());
    assertEquals("nxfile/test/" + newFile.getId() + "/blobholder:0/New%20file.odt", fileItem.getDownloadURL());
    assertEquals("MD5", fileItem.getDigestAlgorithm());
    assertEquals(newFileBlob.getDigest(), fileItem.getDigest());
    // NXP-21854: Check overwrite parameter
    // Test overwrite=false
    FileItem differentFileItem = fileSystemItemManagerService.createFile(DEFAULT_FILE_SYSTEM_ITEM_ID_PREFIX + folder.getId(), blob, principal, false);
    assertNotNull(differentFileItem);
    assertNotEquals(fileItem.getId(), differentFileItem.getId());
    assertEquals("New file.odt", differentFileItem.getName());
    // Test overwrite=true
    Blob otherBlob = new StringBlob("Content of a new file.");
    otherBlob.setFilename("Test overwrite.odt");
    otherBlob.setMimeType("application/vnd.oasis.opendocument.text");
    FileItem otherFileItem = fileSystemItemManagerService.createFile(DEFAULT_FILE_SYSTEM_ITEM_ID_PREFIX + folder.getId(), otherBlob, principal, false);
    assertNotNull(otherFileItem);
    assertEquals("Test overwrite.odt", otherFileItem.getName());
    FileItem sameFileItem = fileSystemItemManagerService.createFile(DEFAULT_FILE_SYSTEM_ITEM_ID_PREFIX + folder.getId(), otherBlob, principal, true);
    assertNotNull(sameFileItem);
    assertEquals(otherFileItem.getId(), sameFileItem.getId());
    assertEquals("Test overwrite.odt", sameFileItem.getName());
    // Parent folder children check
    assertEquals(1, fileSystemItemManagerService.getChildren(newFolderItem.getId(), principal).size());
    // ------------------------------------------------------
    // Check #updateFile
    // ------------------------------------------------------
    String fileItemId = fileItem.getId();
    String fileItemParentId = fileItem.getParentId();
    blob = new StringBlob("Modified content of an existing file.");
    fileItem = fileSystemItemManagerService.updateFile(fileItemId, blob, principal);
    assertNotNull(fileItem);
    assertEquals(fileItemId, fileItem.getId());
    assertEquals(fileItemParentId, fileItem.getParentId());
    assertEquals("New file.odt", fileItem.getName());
    folderChildren = session.query(String.format("select * from Document where ecm:parentId = '%s'", newFolder.getId()));
    assertEquals(1, folderChildren.size());
    DocumentModel updatedFile = folderChildren.get(0);
    assertEquals("File", updatedFile.getType());
    assertEquals("New file.odt", updatedFile.getTitle());
    assertEquals("/syncRoot1/aFolder/A new folder/New file.odt", updatedFile.getPathAsString());
    Blob updatedFileBlob = (Blob) updatedFile.getPropertyValue("file:content");
    assertEquals("New file.odt", updatedFileBlob.getFilename());
    assertEquals("Modified content of an existing file.", updatedFileBlob.getString());
    assertEquals("nxfile/test/" + updatedFile.getId() + "/blobholder:0/New%20file.odt", fileItem.getDownloadURL());
    assertEquals("MD5", fileItem.getDigestAlgorithm());
    assertEquals(updatedFileBlob.getDigest(), fileItem.getDigest());
    // ------------------------------------------------------
    // Check #delete
    // ------------------------------------------------------
    // File deletion
    fileSystemItemManagerService.delete(DEFAULT_FILE_SYSTEM_ITEM_ID_PREFIX + updatedFile.getId(), principal);
    updatedFile = session.getDocument(new IdRef(updatedFile.getId()));
    assertTrue(updatedFile.isTrashed());
    // Parent folder children check
    assertTrue(fileSystemItemManagerService.getChildren(newFolderItem.getId(), principal).isEmpty());
    // ------------------------------------------------------
    // Check #rename
    // ------------------------------------------------------
    // Folder rename
    String fsItemId = DEFAULT_FILE_SYSTEM_ITEM_ID_PREFIX + folder.getId();
    FileSystemItem fsItem = fileSystemItemManagerService.rename(fsItemId, "Jack's folder has a new name", principal);
    assertEquals(fsItemId, fsItem.getId());
    String expectedSyncRoot1Id = DEFAULT_SYNC_ROOT_ITEM_ID_PREFIX + syncRoot1.getId();
    assertEquals(expectedSyncRoot1Id, fsItem.getParentId());
    assertEquals("Jack's folder has a new name", fsItem.getName());
    folder = session.getDocument(folder.getRef());
    assertEquals("Jack's folder has a new name", folder.getTitle());
    // File rename with title != filename
    // => should rename filename but not title
    assertEquals("aFile", file.getTitle());
    assertEquals("Joe.odt", ((Blob) file.getPropertyValue("file:content")).getFilename());
    fsItemId = DEFAULT_FILE_SYSTEM_ITEM_ID_PREFIX + file.getId();
    fsItem = fileSystemItemManagerService.rename(fsItemId, "File new name.odt", principal);
    assertEquals(fsItemId, fsItem.getId());
    assertEquals(DEFAULT_FILE_SYSTEM_ITEM_ID_PREFIX + folder.getId(), fsItem.getParentId());
    assertEquals("File new name.odt", fsItem.getName());
    file = session.getDocument(file.getRef());
    assertEquals("aFile", file.getTitle());
    Blob fileBlob = (Blob) file.getPropertyValue("file:content");
    assertEquals("File new name.odt", fileBlob.getFilename());
    fileItem = (FileItem) fsItem;
    assertEquals("nxfile/test/" + file.getId() + "/blobholder:0/File%20new%20name.odt", fileItem.getDownloadURL());
    assertEquals("MD5", fileItem.getDigestAlgorithm());
    assertEquals(fileBlob.getDigest(), fileItem.getDigest());
    // File rename with title == filename
    // => should rename filename and title
    blob = new StringBlob("File for a doc with title == filename.");
    blob.setFilename("Title-filename equality.odt");
    blob.setMimeType("application/vnd.oasis.opendocument.text");
    fileItem = fileSystemItemManagerService.createFile(newFolderItem.getId(), blob, principal, false);
    // Note that the PathSegmentService truncates doc title at 24 characters
    newFile = session.getDocument(new PathRef("/syncRoot1/aFolder/A new folder/Title-filename equality."));
    assertEquals("Title-filename equality.odt", newFile.getTitle());
    assertEquals("Title-filename equality.odt", ((Blob) newFile.getPropertyValue("file:content")).getFilename());
    fileItem = (FileItem) fileSystemItemManagerService.rename(DEFAULT_FILE_SYSTEM_ITEM_ID_PREFIX + newFile.getId(), "Renamed title-filename equality.odt", principal);
    assertEquals("Renamed title-filename equality.odt", fileItem.getName());
    newFile = session.getDocument(newFile.getRef());
    assertEquals("Renamed title-filename equality.odt", newFile.getTitle());
    newFileBlob = (Blob) newFile.getPropertyValue("file:content");
    assertEquals("Renamed title-filename equality.odt", newFileBlob.getFilename());
    assertEquals("nxfile/test/" + newFile.getId() + "/blobholder:0/Renamed%20title-filename%20equality.odt", fileItem.getDownloadURL());
    assertEquals("MD5", fileItem.getDigestAlgorithm());
    assertEquals(newFileBlob.getDigest(), fileItem.getDigest());
    // ------------------------------------------------------
    // Check #move
    // ------------------------------------------------------
    // Not allowed to move a file system item to a non FolderItem
    String srcFsItemId = DEFAULT_FILE_SYSTEM_ITEM_ID_PREFIX + note.getId();
    String destFsItemId = DEFAULT_FILE_SYSTEM_ITEM_ID_PREFIX + file.getId();
    try {
        fileSystemItemManagerService.move(srcFsItemId, destFsItemId, principal);
        fail("Move to a non folder item should fail.");
    } catch (NuxeoException e) {
        assertEquals(String.format("Cannot move a file system item to file system item with id %s because it is not a folder.", DEFAULT_FILE_SYSTEM_ITEM_ID_PREFIX + file.getId()), e.getMessage());
    }
    // Move to a FolderItem
    destFsItemId = DEFAULT_FILE_SYSTEM_ITEM_ID_PREFIX + subFolder.getId();
    FileSystemItem movedFsItem = fileSystemItemManagerService.move(srcFsItemId, destFsItemId, principal);
    assertEquals(srcFsItemId, movedFsItem.getId());
    assertEquals(destFsItemId, movedFsItem.getParentId());
    assertEquals("aNote.txt", movedFsItem.getName());
    note = session.getDocument(note.getRef());
    assertEquals("/syncRoot1/aFolder/aSubFolder/aNote", note.getPathAsString());
    assertEquals("aNote", note.getTitle());
}
Also used : FileItem(org.nuxeo.drive.adapter.FileItem) StringBlob(org.nuxeo.ecm.core.api.impl.blob.StringBlob) Blob(org.nuxeo.ecm.core.api.Blob) DefaultSyncRootFolderItem(org.nuxeo.drive.adapter.impl.DefaultSyncRootFolderItem) FolderItem(org.nuxeo.drive.adapter.FolderItem) FileSystemItem(org.nuxeo.drive.adapter.FileSystemItem) DocumentModelList(org.nuxeo.ecm.core.api.DocumentModelList) PathRef(org.nuxeo.ecm.core.api.PathRef) StringBlob(org.nuxeo.ecm.core.api.impl.blob.StringBlob) NuxeoException(org.nuxeo.ecm.core.api.NuxeoException) IdRef(org.nuxeo.ecm.core.api.IdRef) DocumentModel(org.nuxeo.ecm.core.api.DocumentModel) Test(org.junit.Test)

Example 15 with NuxeoException

use of org.nuxeo.ecm.core.api.NuxeoException in project nuxeo-drive-server by nuxeo.

the class UserSyncRootParentFactory method getVirtualFolderItem.

/*------------------- VirtualFolderItemFactory ------------------- */
@Override
public FolderItem getVirtualFolderItem(Principal principal) {
    RepositoryManager repositoryManager = Framework.getService(RepositoryManager.class);
    // TODO: handle multiple repositories
    try (CloseableCoreSession session = CoreInstance.openCoreSession(repositoryManager.getDefaultRepositoryName(), principal)) {
        UserWorkspaceService userWorkspaceService = Framework.getService(UserWorkspaceService.class);
        DocumentModel userWorkspace = userWorkspaceService.getCurrentUserPersonalWorkspace(session);
        if (userWorkspace == null) {
            throw new NuxeoException(String.format("No personal workspace found for user %s.", principal.getName()));
        }
        return (FolderItem) getFileSystemItem(userWorkspace);
    }
}
Also used : FolderItem(org.nuxeo.drive.adapter.FolderItem) UserSyncRootParentFolderItem(org.nuxeo.drive.hierarchy.permission.adapter.UserSyncRootParentFolderItem) UserWorkspaceService(org.nuxeo.ecm.platform.userworkspace.api.UserWorkspaceService) CloseableCoreSession(org.nuxeo.ecm.core.api.CloseableCoreSession) RepositoryManager(org.nuxeo.ecm.core.api.repository.RepositoryManager) NuxeoException(org.nuxeo.ecm.core.api.NuxeoException) DocumentModel(org.nuxeo.ecm.core.api.DocumentModel)

Aggregations

NuxeoException (org.nuxeo.ecm.core.api.NuxeoException)31 FolderItem (org.nuxeo.drive.adapter.FolderItem)14 DocumentModel (org.nuxeo.ecm.core.api.DocumentModel)11 FileSystemItem (org.nuxeo.drive.adapter.FileSystemItem)9 IOException (java.io.IOException)5 Blob (org.nuxeo.ecm.core.api.Blob)5 CloseableCoreSession (org.nuxeo.ecm.core.api.CloseableCoreSession)5 DocumentModelList (org.nuxeo.ecm.core.api.DocumentModelList)4 Principal (java.security.Principal)3 DefaultSyncRootFolderItem (org.nuxeo.drive.adapter.impl.DefaultSyncRootFolderItem)3 BlobHolder (org.nuxeo.ecm.core.api.blobholder.BlobHolder)3 ByteArrayInputStream (java.io.ByteArrayInputStream)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 ObjectInputStream (java.io.ObjectInputStream)2 ObjectOutputStream (java.io.ObjectOutputStream)2 URI (java.net.URI)2 URISyntaxException (java.net.URISyntaxException)2 HashMap (java.util.HashMap)2 Test (org.junit.Test)2 Path (org.nuxeo.common.utils.Path)2