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