private static String[] getBucketAndPrefix() throws InvalidConfException {
        URI uri = normalizeConfigPath(Config.aws_s3_path, "s3", "Config.aws_s3_path", true);
        String path = uri.getPath();
        if (path.startsWith("/")) {
            // remove leading '/' for backwards compatibility
            path = path.substring(1);
        }
        return new String[] {uri.getAuthority(), path};
    }
@Test
    public void testGetBucketAndPrefix() throws Exception {
        String oldAwsS3Path = Config.aws_s3_path;

        SharedDataStorageVolumeMgr sdsvm = new SharedDataStorageVolumeMgr();
        Config.aws_s3_path = "bucket/dir1/dir2";
        String[] bucketAndPrefix1 = Deencapsulation.invoke(sdsvm, "getBucketAndPrefix");
        Assert.assertEquals(2, bucketAndPrefix1.length);
        Assert.assertEquals("bucket", bucketAndPrefix1[0]);
        Assert.assertEquals("dir1/dir2", bucketAndPrefix1[1]);

        Config.aws_s3_path = "bucket";
        String[] bucketAndPrefix2 = Deencapsulation.invoke(sdsvm, "getBucketAndPrefix");
        Assert.assertEquals(2, bucketAndPrefix2.length);
        Assert.assertEquals("bucket", bucketAndPrefix2[0]);
        Assert.assertEquals("", bucketAndPrefix2[1]);

        Config.aws_s3_path = "bucket/";
        String[] bucketAndPrefix3 = Deencapsulation.invoke(sdsvm, "getBucketAndPrefix");
        Assert.assertEquals(2, bucketAndPrefix3.length);
        Assert.assertEquals("bucket", bucketAndPrefix3[0]);
        Assert.assertEquals("", bucketAndPrefix3[1]);

        // allow leading s3:// in configuration, will be just ignored.
        Config.aws_s3_path = "s3://a-bucket/b";
        {
            String[] bucketAndPrefix = Deencapsulation.invoke(sdsvm, "getBucketAndPrefix");
            Assert.assertEquals(2, bucketAndPrefix.length);
            Assert.assertEquals("a-bucket", bucketAndPrefix[0]);
            Assert.assertEquals("b", bucketAndPrefix[1]);
        }

        Config.aws_s3_path = oldAwsS3Path;
    }