/** * @return * a list of the {@link S3ObjectsChunk}s that have been generated since the * last progress event was fired. * @throws IllegalStateException * listed objects are only available from EVENT_IN_PROGRESS events. */ public List getChunkList() throws IllegalStateException { if (getEventCode() != EVENT_IN_PROGRESS) { throw new IllegalStateException("Chunk list is only available from EVENT_IN_PROGRESS events"); } return this.chunkList; }
/** * @return * a list of the {@link S3ObjectsChunk}s that have been generated since the * last progress event was fired. * @throws IllegalStateException * listed objects are only available from EVENT_IN_PROGRESS events. */ public List getChunkList() throws IllegalStateException { if (getEventCode() != EVENT_IN_PROGRESS) { throw new IllegalStateException("Chunk list is only available from EVENT_IN_PROGRESS events"); } return this.chunkList; }
@Override public void s3ServiceEventPerformed(ListObjectsEvent event) { if (ListObjectsEvent.EVENT_IN_PROGRESS == event.getEventCode()) { Iterator chunkIter = event.getChunkList().iterator(); while (chunkIter.hasNext()) { StorageObjectsChunk chunk = (StorageObjectsChunk) chunkIter.next(); System.out.println("Listed " + chunk.getObjects().length + " objects for sub-listing with prefix: '" + chunk.getPrefix() + "'"); allObjects.addAll(Arrays.asList(chunk.getObjects())); } } else if (ListObjectsEvent.EVENT_ERROR == event.getEventCode()) { s3ServiceExceptions[0] = new S3ServiceException( "Failed to list all objects in S3 bucket", event.getErrorCause()); } } });
@Override public void s3ServiceEventPerformed(ListObjectsEvent event) { if (ListObjectsEvent.EVENT_IN_PROGRESS == event.getEventCode()) { Iterator chunkIter = event.getChunkList().iterator(); while (chunkIter.hasNext()) { StorageObjectsChunk chunk = (StorageObjectsChunk) chunkIter.next(); System.out.println("Listed " + chunk.getObjects().length + " objects for sub-listing with prefix: '" + chunk.getPrefix() + "'"); allObjects.addAll(Arrays.asList(chunk.getObjects())); } } else if (ListObjectsEvent.EVENT_ERROR == event.getEventCode()) { s3ServiceExceptions[0] = new S3ServiceException( "Failed to list all objects in S3 bucket", event.getErrorCause()); } } });