@Test public void testList() throws Exception { final Path bucket = new Path("test-cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume)); final Path file = new Path(bucket, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file)); final B2StartLargeFileResponse startResponse = session.getClient().startLargeFileUpload( new B2FileidProvider(session).withCache(cache).getFileid(bucket, new DisabledListProgressListener()), file.getName(), null, Collections.emptyMap()); assertTrue(new B2LargeUploadPartService(session, new B2FileidProvider(session).withCache(cache)).list(startResponse.getFileId()).isEmpty()); session.getClient().cancelLargeFileUpload(startResponse.getFileId()); }
public List<B2UploadPartResponse> list(final String fileid) throws BackgroundException { if(log.isInfoEnabled()) { log.info(String.format("List completed parts of file %s", fileid)); } try { final List<B2UploadPartResponse> completed = new ArrayList<B2UploadPartResponse>(); Integer startPartNumber = null; do { final B2ListPartsResponse response = session.getClient().listParts( fileid, startPartNumber, null); completed.addAll(response.getFiles()); startPartNumber = response.getNextPartNumber(); } while(startPartNumber != null); return completed; } catch(B2ApiException e) { throw new B2ExceptionMappingService().map(e); } catch(IOException e) { throw new DefaultIOExceptionMappingService().map(e); } }
B2LargeUploadPartService { public List<B2UploadPartResponse> list(final String fileid) throws BackgroundException { if(log.isInfoEnabled()) { log.info(String.format("List completed parts of file %s", fileid)); } try { final List<B2UploadPartResponse> completed = new ArrayList<B2UploadPartResponse>(); Integer startPartNumber = null; do { final B2ListPartsResponse response = session.getClient().listParts( fileid, startPartNumber, null); completed.addAll(response.getFiles()); startPartNumber = response.getNextPartNumber(); } while(startPartNumber != null); return completed; } catch(B2ApiException e) { throw new B2ExceptionMappingService().map(e); } catch(IOException e) { throw new DefaultIOExceptionMappingService().map(e); } } }
B2LargeUploadPartService { public List<B2UploadPartResponse> list(final String fileid) throws BackgroundException { if(log.isInfoEnabled()) { log.info(String.format("List completed parts of file %s", fileid)); } try { final List<B2UploadPartResponse> completed = new ArrayList<B2UploadPartResponse>(); Integer startPartNumber = null; do { final B2ListPartsResponse response = session.getClient().listParts( fileid, startPartNumber, null); completed.addAll(response.getFiles()); startPartNumber = response.getNextPartNumber(); } while(startPartNumber != null); return completed; } catch(B2ApiException e) { throw new B2ExceptionMappingService().map(e); } catch(IOException e) { throw new DefaultIOExceptionMappingService().map(e); } } B2LargeUploadPartService(final B2Session session, final B2FileidProvider fileid); }
B2LargeUploadPartService { public List<B2UploadPartResponse> list(final String fileid) throws BackgroundException { if(log.isInfoEnabled()) { log.info(String.format("List completed parts of file %s", fileid)); } try { final List<B2UploadPartResponse> completed = new ArrayList<B2UploadPartResponse>(); Integer startPartNumber = null; do { final B2ListPartsResponse response = session.getClient().listParts( fileid, startPartNumber, null); completed.addAll(response.getFiles()); startPartNumber = response.getNextPartNumber(); } while(startPartNumber != null); return completed; } catch(B2ApiException e) { throw new B2ExceptionMappingService().map(e); } catch(IOException e) { throw new DefaultIOExceptionMappingService().map(e); } } B2LargeUploadPartService(final B2Session session, final B2FileidProvider fileid); List<B2FileInfoResponse> find(final Path file); List<B2UploadPartResponse> list(final String fileid); void delete(final String id); }
B2LargeUploadPartService { public List<B2UploadPartResponse> list(final String fileid) throws BackgroundException { if(log.isInfoEnabled()) { log.info(String.format("List completed parts of file %s", fileid)); } try { final List<B2UploadPartResponse> completed = new ArrayList<B2UploadPartResponse>(); Integer startPartNumber = null; do { final B2ListPartsResponse response = session.getClient().listParts( fileid, startPartNumber, null); completed.addAll(response.getFiles()); startPartNumber = response.getNextPartNumber(); } while(startPartNumber != null); return completed; } catch(B2ApiException e) { throw new B2ExceptionMappingService().map(e); } catch(IOException e) { throw new DefaultIOExceptionMappingService().map(e); } } B2LargeUploadPartService(final B2Session session, final B2FileidProvider fileid); List<B2FileInfoResponse> find(final Path file); List<B2UploadPartResponse> list(final String fileid); void delete(final String id);  }