优化代码
This commit is contained in:
parent
476646d1e0
commit
acb5c077da
|
@ -4,7 +4,6 @@ import io.minio.BucketExistsArgs;
|
|||
import io.minio.MakeBucketArgs;
|
||||
import io.minio.MinioClient;
|
||||
import io.minio.PutObjectArgs;
|
||||
import net.maku.framework.common.constant.Constant;
|
||||
import net.maku.framework.common.exception.ServerException;
|
||||
import net.maku.storage.properties.StorageProperties;
|
||||
import org.springframework.http.MediaType;
|
||||
|
@ -44,7 +43,7 @@ public class MinioStorageService extends StorageService {
|
|||
minioClient.makeBucket(MakeBucketArgs.builder().bucket(properties.getMinio().getBucketName()).build());
|
||||
}
|
||||
|
||||
String contentType = Constant.CONTENTTYPE_OCTET_STREAM;
|
||||
String contentType = MediaType.APPLICATION_OCTET_STREAM_VALUE;
|
||||
Optional<MediaType> mediaType = MediaTypeFactory.getMediaType(path);
|
||||
if (mediaType.isPresent()) {
|
||||
contentType = mediaType.get().toString();
|
||||
|
|
|
@ -45,12 +45,8 @@ public interface Constant {
|
|||
String OK = "OK";
|
||||
|
||||
/**
|
||||
* pgsql的driver
|
||||
*/
|
||||
String PGSQL_DRIVER = "org.postgresql.Driver";
|
||||
/**
|
||||
* Content-Type
|
||||
* pgsql的driver
|
||||
*/
|
||||
String CONTENTTYPE_OCTET_STREAM = "application/octet-stream";
|
||||
String PGSQL_DRIVER = "org.postgresql.Driver";
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user