Search in sources :

Example 6 with S3FileName

use of org.apache.hop.vfs.s3.s3.vfs.S3FileName in project hop by apache.

the class S3FileSystemTest method setUp.

@Before
public void setUp() throws Exception {
    fileName = new S3FileName(S3FileNameTest.SCHEME, "/", "", FileType.FOLDER);
    fileSystem = new S3FileSystem(fileName, new FileSystemOptions());
}
Also used : S3FileName(org.apache.hop.vfs.s3.s3.vfs.S3FileName) S3FileSystem(org.apache.hop.vfs.s3.s3.vfs.S3FileSystem) Before(org.junit.Before)

Example 7 with S3FileName

use of org.apache.hop.vfs.s3.s3.vfs.S3FileName in project hop by apache.

the class S3FileNameParserIT method testParseUri_withKeys.

@Test
public void testParseUri_withKeys() throws Exception {
    FileNameParser parser = S3FileNameParser.getInstance();
    String origUri = "s3:///fooBucket/rcf-emr-staging";
    S3FileName filename = (S3FileName) parser.parseUri(null, null, origUri);
    assertEquals("fooBucket", filename.getBucketId());
    assertEquals(origUri, filename.getURI());
}
Also used : FileNameParser(org.apache.commons.vfs2.provider.FileNameParser) S3FileNameParser(org.apache.hop.vfs.s3.s3.vfs.S3FileNameParser) S3FileName(org.apache.hop.vfs.s3.s3.vfs.S3FileName) Test(org.junit.Test)

Example 8 with S3FileName

use of org.apache.hop.vfs.s3.s3.vfs.S3FileName in project hop by apache.

the class S3FileObjectTest method testGetS3BucketName.

@Test
public void testGetS3BucketName() {
    filename = new S3FileName(SCHEME, BUCKET_NAME, "", FileType.FOLDER);
    when(s3FileObjectBucketSpy.getName()).thenReturn(filename);
    s3FileObjectBucketSpy.getS3BucketName();
}
Also used : S3FileName(org.apache.hop.vfs.s3.s3.vfs.S3FileName) Test(org.junit.Test)

Aggregations

S3FileName (org.apache.hop.vfs.s3.s3.vfs.S3FileName)8 Test (org.junit.Test)6 S3FileObject (org.apache.hop.vfs.s3.s3.vfs.S3FileObject)3 VfsComponentContext (org.apache.commons.vfs2.provider.VfsComponentContext)2 S3FileSystem (org.apache.hop.vfs.s3.s3.vfs.S3FileSystem)2 Before (org.junit.Before)2 AmazonS3 (com.amazonaws.services.s3.AmazonS3)1 ArrayList (java.util.ArrayList)1 FileName (org.apache.commons.vfs2.FileName)1 DefaultFileSystemManager (org.apache.commons.vfs2.impl.DefaultFileSystemManager)1 FileNameParser (org.apache.commons.vfs2.provider.FileNameParser)1 StorageUnitConverter (org.apache.hop.core.util.StorageUnitConverter)1 S3FileNameParser (org.apache.hop.vfs.s3.s3.vfs.S3FileNameParser)1 S3HopProperty (org.apache.hop.vfs.s3.s3common.S3HopProperty)1