File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -1056,4 +1056,41 @@ public Map<String, String> getMetadataValue(final String filename) {
10561056 deleteAllContents (client , bucketName );
10571057 }
10581058 }
1059+
1060+ @ Test
1061+ public void nameWithSpace () throws IOException , SignatureException , XmlProcessingException {
1062+ final String bucketName = "test_space_bucket" ;
1063+
1064+ try {
1065+ final Ds3ClientHelpers helpers = Ds3ClientHelpers .wrap (client );
1066+
1067+ helpers .ensureBucketExists (bucketName );
1068+
1069+ final List <Ds3Object > objs = Lists .newArrayList (new Ds3Object ("space object.txt" , 10 ));
1070+
1071+ final Ds3ClientHelpers .Job job = helpers .startWriteJob (bucketName , objs );
1072+
1073+ job .transfer (new Ds3ClientHelpers .ObjectChannelBuilder () {
1074+ @ Override
1075+ public SeekableByteChannel buildChannel (final String key ) throws IOException {
1076+
1077+ final byte [] randomData = IOUtils .toByteArray (new RandomDataInputStream (124345 , 10 ));
1078+ final ByteBuffer randomBuffer = ByteBuffer .wrap (randomData );
1079+
1080+ final ByteArraySeekableByteChannel channel = new ByteArraySeekableByteChannel (10 );
1081+ channel .write (randomBuffer );
1082+
1083+ return channel ;
1084+ }
1085+ });
1086+
1087+ final Iterable <Contents > contents = helpers .listObjects (bucketName );
1088+
1089+ assertThat (Iterables .size (contents ), is (1 ));
1090+ assertThat (Iterables .get (contents , 0 ).getKey (), is ("space object.txt" ));
1091+
1092+ } finally {
1093+ deleteAllContents (client , bucketName );
1094+ }
1095+ }
10591096}
You can’t perform that action at this time.
0 commit comments