@Test public void testDirectory() throws Exception { final Path home = new DropboxHomeFinderFeature(session).find(); final Path level1 = new DropboxDirectoryFeature(session).mkdir(new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), null, null); assertTrue(new DefaultFindFeature(session).find(level1)); assertTrue(new DropboxFindFeature(session).find(level1)); final Path level2 = new DropboxDirectoryFeature(session).mkdir(new Path(level1, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), null, null); assertTrue(new DefaultFindFeature(session).find(level2)); assertTrue(new DropboxFindFeature(session).find(level2)); new DropboxDeleteFeature(session).delete(Arrays.asList(level1), new DisabledLoginCallback(), new Delete.DisabledCallback()); }
@Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try { final CreateFolderResult result = new DbxUserFilesRequests(session.getClient(folder.getParent())).createFolderV2(containerService.getKey(folder), false); return new Path(folder.getParent(), folder.getName(), folder.getType(), new DropboxAttributesFinderFeature(session).toAttributes(result.getMetadata())); } catch(DbxException e) { throw new DropboxExceptionMappingService().map(e); } }
DropboxDirectoryFeature implements Directory<String> { @Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try { final CreateFolderResult result = new DbxUserFilesRequests(session.getClient(folder.getParent())).createFolderV2(containerService.getKey(folder), false); return new Path(folder.getParent(), folder.getName(), folder.getType(), new DropboxAttributesFinderFeature(session).toAttributes(result.getMetadata())); } catch(DbxException e) { throw new DropboxExceptionMappingService().map(e); } } }
DropboxDirectoryFeature implements Directory<String> { @Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try { final CreateFolderResult result = new DbxUserFilesRequests(session.getClient(folder.getParent())).createFolderV2(containerService.getKey(folder), false); return new Path(folder.getParent(), folder.getName(), folder.getType(), new DropboxAttributesFinderFeature(session).toAttributes(result.getMetadata())); } catch(DbxException e) { throw new DropboxExceptionMappingService().map(e); } } DropboxDirectoryFeature(final DropboxSession session); }
DropboxDirectoryFeature implements Directory<String> { @Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try { final CreateFolderResult result = new DbxUserFilesRequests(session.getClient(folder.getParent())).createFolderV2(containerService.getKey(folder), false); return new Path(folder.getParent(), folder.getName(), folder.getType(), new DropboxAttributesFinderFeature(session).toAttributes(result.getMetadata())); } catch(DbxException e) { throw new DropboxExceptionMappingService().map(e); } } DropboxDirectoryFeature(final DropboxSession session); @Override Path mkdir(final Path folder, final String region, final TransferStatus status); @Override boolean isSupported(final Path workdir, final String name); @Override DropboxDirectoryFeature withWriter(final Write<String> writer); }
DropboxDirectoryFeature implements Directory<String> { @Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try { final CreateFolderResult result = new DbxUserFilesRequests(session.getClient(folder.getParent())).createFolderV2(containerService.getKey(folder), false); return new Path(folder.getParent(), folder.getName(), folder.getType(), new DropboxAttributesFinderFeature(session).toAttributes(result.getMetadata())); } catch(DbxException e) { throw new DropboxExceptionMappingService().map(e); } } DropboxDirectoryFeature(final DropboxSession session); @Override Path mkdir(final Path folder, final String region, final TransferStatus status); @Override boolean isSupported(final Path workdir, final String name); @Override DropboxDirectoryFeature withWriter(final Write<String> writer);  }