@Test public void testGetObjectsNamesInEmptyBucket() throws Exception { String[] actual = provider.getS3ObjectsNames( BUCKET3_NAME ); logArray( actual ); assertEquals( 0, actual.length ); }
public String[] getS3ObjectsNames( String bucketName ) throws Exception { S3Bucket bucket = getBucket( bucketName ); if ( bucket == null ) { throw new Exception( Messages.getString( "S3DefaultService.Exception.UnableToFindBucket.Message", bucketName ) ); } return Arrays.stream( getS3Objects( bucket ) ).map( b -> b.getKey() ).toArray( String[]::new ); }
S3ObjectsProvider { public String[] getS3ObjectsNames( String bucketName ) throws Exception { S3Bucket bucket = getBucket( bucketName ); if ( bucket == null ) { throw new Exception( Messages.getString( "S3DefaultService.Exception.UnableToFindBucket.Message", bucketName ) ); } return Arrays.stream( getS3Objects( bucket ) ).map( b -> b.getKey() ).toArray( String[]::new ); } }
S3ObjectsProvider { public String[] getS3ObjectsNames( String bucketName ) throws Exception { S3Bucket bucket = getBucket( bucketName ); if ( bucket == null ) { throw new Exception( Messages.getString( "S3DefaultService.Exception.UnableToFindBucket.Message", bucketName ) ); } return Arrays.stream( getS3Objects( bucket ) ).map( b -> b.getKey() ).toArray( String[]::new ); } S3ObjectsProvider( S3Service service ); }
S3ObjectsProvider { public String[] getS3ObjectsNames( String bucketName ) throws Exception { S3Bucket bucket = getBucket( bucketName ); if ( bucket == null ) { throw new Exception( Messages.getString( "S3DefaultService.Exception.UnableToFindBucket.Message", bucketName ) ); } return Arrays.stream( getS3Objects( bucket ) ).map( b -> b.getKey() ).toArray( String[]::new ); } S3ObjectsProvider( S3Service service ); String[] getBucketsNames(); S3Bucket getBucket( String bucketName ); String[] getS3ObjectsNames( String bucketName ); S3Object getS3Object( S3Bucket bucket, String objectKey, Long byteRangeStart, Long byteRangeEnd ); S3Object getS3Object( S3Bucket bucket, String objectKey ); long getS3ObjectContentLenght( S3Bucket bucket, String objectKey ); }
S3ObjectsProvider { public String[] getS3ObjectsNames( String bucketName ) throws Exception { S3Bucket bucket = getBucket( bucketName ); if ( bucket == null ) { throw new Exception( Messages.getString( "S3DefaultService.Exception.UnableToFindBucket.Message", bucketName ) ); } return Arrays.stream( getS3Objects( bucket ) ).map( b -> b.getKey() ).toArray( String[]::new ); } S3ObjectsProvider( S3Service service ); String[] getBucketsNames(); S3Bucket getBucket( String bucketName ); String[] getS3ObjectsNames( String bucketName ); S3Object getS3Object( S3Bucket bucket, String objectKey, Long byteRangeStart, Long byteRangeEnd ); S3Object getS3Object( S3Bucket bucket, String objectKey ); long getS3ObjectContentLenght( S3Bucket bucket, String objectKey );  }