#### server #### server.port=4444 server.servlet.context-path=/minio #### logging #### logging.level.com.minio.ls=debug #### http #### spring.servlet.multipart.enabled=true spring.servlet.multipart.file-size-threshold=600GB spring.servlet.multipart.max-file-size=600GB spring.servlet.multipart.max-request-size=600GB
#### MinIO ### minio.endpoint=http://127.0.0.1:9000 minio.accessKey=minioadmin minio.secretKey=minioadmin minio.bucketName=demo01 # 是否打开 undertow 日志,默认为 false server.undertow.accesslog.enabled=false # 设置访问日志所在目录 server.undertow.accesslog.dir=logs # 指定工作者线程的 I/0 线程数,默认为 2 或者 CPU 的个数 server.undertow.io-threads= # 指定工作者线程个数,默认为 I/O 线程个数的 8 倍 server.undertow.worker-threads= # 设置 HTTP POST 内容的最大长度,默认不做限制 server.undertow.max-http-post-size=0
public boolean putObject(String bucketName, String objectName, InputStream stream, String contentType, long objectSize) throws IOException, InvalidResponseException, InvalidKeyException, NoSuchAlgorithmException, ServerException, ErrorResponseException, XmlParserException, InsufficientDataException, InternalException { boolean flag = bucketExists(bucketName); if (flag) { minioClient.putObject( PutObjectArgs.builder(). bucket(bucketName). object(objectName). stream(stream, objectSize,//stream.available(), -1 ) .contentType(contentType) .build()); StatObjectResponse statObject = statObject(bucketName, objectName); if (statObject != null && statObject.size() > 0) { return true; } } return false; }