Search in sources :

Example 1 with RemoveObjectArgs

use of io.minio.RemoveObjectArgs in project fess by codelibs.

the class AdminStorageAction method deleteObject.

public static void deleteObject(final String objectName) {
    try {
        final FessConfig fessConfig = ComponentUtil.getFessConfig();
        final MinioClient minioClient = createClient(fessConfig);
        final RemoveObjectArgs args = RemoveObjectArgs.builder().bucket(fessConfig.getStorageBucket()).object(objectName).build();
        minioClient.removeObject(args);
    } catch (final Exception e) {
        throw new StorageException("Failed to delete " + objectName, e);
    }
}
Also used : MinioClient(io.minio.MinioClient) RemoveObjectArgs(io.minio.RemoveObjectArgs) FessConfig(org.codelibs.fess.mylasta.direction.FessConfig) StorageException(org.codelibs.fess.exception.StorageException) StorageException(org.codelibs.fess.exception.StorageException) ErrorResponseException(io.minio.errors.ErrorResponseException)

Aggregations

MinioClient (io.minio.MinioClient)1 RemoveObjectArgs (io.minio.RemoveObjectArgs)1 ErrorResponseException (io.minio.errors.ErrorResponseException)1 StorageException (org.codelibs.fess.exception.StorageException)1 FessConfig (org.codelibs.fess.mylasta.direction.FessConfig)1