@Test public void testFilenameColon() throws Exception { final Path home = new DropboxHomeFinderFeature(session).find(); final Path file = new DropboxTouchFeature(session).touch(new Path(home, String.format("%s:name", UUID.randomUUID().toString()), EnumSet.of(Path.Type.file)), new TransferStatus()); final Path folder = new DropboxDirectoryFeature(session).mkdir(new Path(home, String.format("%s:name", UUID.randomUUID().toString()), EnumSet.of(Path.Type.directory)), null, new TransferStatus()); final AttributedList<Path> list = new DropboxListService(session).list(home, new DisabledListProgressListener()); assertNotNull(list); assertFalse(list.isEmpty()); assertTrue(list.contains(file)); assertTrue(list.contains(folder)); new DropboxDeleteFeature(session).delete(Arrays.asList(file, folder), new DisabledLoginCallback(), new Delete.DisabledCallback()); }
@Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { final AttributedList<Path> children = new AttributedList<>(); ListFolderResult result; final DbxRawClientV2 client; this.parse(directory, listener, children, result = new DbxUserFilesRequests(session.getClient(directory)).listFolder(containerService.getKey(directory))); while(result.getHasMore()) { this.parse(directory, listener, children, result = new DbxUserFilesRequests(session.getClient(directory)).listFolderContinue(result.getCursor())); } return children; } catch(DbxException e) { throw new DropboxExceptionMappingService().map("Listing directory {0} failed", e, directory); } }
DropboxListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { final AttributedList<Path> children = new AttributedList<>(); ListFolderResult result; final DbxRawClientV2 client; this.parse(directory, listener, children, result = new DbxUserFilesRequests(session.getClient(directory)).listFolder(containerService.getKey(directory))); while(result.getHasMore()) { this.parse(directory, listener, children, result = new DbxUserFilesRequests(session.getClient(directory)).listFolderContinue(result.getCursor())); } return children; } catch(DbxException e) { throw new DropboxExceptionMappingService().map("Listing directory {0} failed", e, directory); } } }
DropboxListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { final AttributedList<Path> children = new AttributedList<>(); ListFolderResult result; final DbxRawClientV2 client; this.parse(directory, listener, children, result = new DbxUserFilesRequests(session.getClient(directory)).listFolder(containerService.getKey(directory))); while(result.getHasMore()) { this.parse(directory, listener, children, result = new DbxUserFilesRequests(session.getClient(directory)).listFolderContinue(result.getCursor())); } return children; } catch(DbxException e) { throw new DropboxExceptionMappingService().map("Listing directory {0} failed", e, directory); } } DropboxListService(final DropboxSession session); }
DropboxListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { final AttributedList<Path> children = new AttributedList<>(); ListFolderResult result; final DbxRawClientV2 client; this.parse(directory, listener, children, result = new DbxUserFilesRequests(session.getClient(directory)).listFolder(containerService.getKey(directory))); while(result.getHasMore()) { this.parse(directory, listener, children, result = new DbxUserFilesRequests(session.getClient(directory)).listFolderContinue(result.getCursor())); } return children; } catch(DbxException e) { throw new DropboxExceptionMappingService().map("Listing directory {0} failed", e, directory); } } DropboxListService(final DropboxSession session); @Override AttributedList<Path> list(final Path directory, final ListProgressListener listener); }
DropboxListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { final AttributedList<Path> children = new AttributedList<>(); ListFolderResult result; final DbxRawClientV2 client; this.parse(directory, listener, children, result = new DbxUserFilesRequests(session.getClient(directory)).listFolder(containerService.getKey(directory))); while(result.getHasMore()) { this.parse(directory, listener, children, result = new DbxUserFilesRequests(session.getClient(directory)).listFolderContinue(result.getCursor())); } return children; } catch(DbxException e) { throw new DropboxExceptionMappingService().map("Listing directory {0} failed", e, directory); } } DropboxListService(final DropboxSession session); @Override AttributedList<Path> list(final Path directory, final ListProgressListener listener);  }