Upplication / Amazon-S3-FileSystem-NIO2

An S3 File System Provider for Java 7
MIT License
122 stars 67 forks source link

content-type not setted in amazon s3 #19

Closed jarnaiz closed 10 years ago

jarnaiz commented 10 years ago

The following test not work as expected:

try (FileSystem linux = MemoryFileSystemBuilder.newLinux().build("linux")){
            Path htmlFile = Files.write(linux.getPath("/index.html"),"<html><body>html file</body></html>".getBytes());

            Path result = fileSystemAmazon.getPath(bucket, UUID.randomUUID().toString() + htmlFile.getFileName().toString());
            Files.copy(htmlFile, result);

            S3Path resultS3 = (S3Path) result;
            ObjectMetadata metadata = resultS3.getFileSystem().getClient().getObjectMetadata(resultS3.getBucket(), resultS3.getKey());
            assertEquals("text/html", metadata.getContentType());
        }