File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
main/java/com/aliyun/oss/internal
test/java/com/aliyun/oss/integrationtests Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,8 @@ public void loadMimetypes(InputStream is) throws IOException {
9090 }
9191 }
9292 }
93+
94+ extensionToMimetypeMap .put ("csv" , "text/csv" );
9395 }
9496
9597 public String getMimetype (String fileName ) {
Original file line number Diff line number Diff line change @@ -494,5 +494,25 @@ public void testIncorrentSignature() throws Exception {
494494 }
495495 }
496496 }
497-
497+
498+ @ Test
499+ public void testPutCSVTypeFile () throws Exception {
500+ final String key = "1.csv" ;
501+ final int instreamLength = 128 * 1024 ;
502+
503+ InputStream instream = null ;
504+ try {
505+ instream = genFixedLengthInputStream (instreamLength );
506+ ossClient .putObject (bucketName , key , instream );
507+
508+ OSSObject o = ossClient .getObject (bucketName , key );
509+ Assert .assertEquals (o .getObjectMetadata ().getContentType (), "text/csv" );
510+ } catch (Exception e ) {
511+ Assert .fail (e .getMessage ());
512+
513+ if (instream != null ) {
514+ instream .close ();
515+ }
516+ }
517+ }
498518}
You can’t perform that action at this time.
0 commit comments