Search in sources :

Example 1 with GetObjectArgs

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

the class AdminStorageAction method downloadObject.

public static void downloadObject(final String objectName, final WrittenStreamOut out) {
    final FessConfig fessConfig = ComponentUtil.getFessConfig();
    final GetObjectArgs args = GetObjectArgs.builder().bucket(fessConfig.getStorageBucket()).object(objectName).build();
    try (InputStream in = createClient(fessConfig).getObject(args)) {
        out.write(in);
    } catch (final Exception e) {
        throw new StorageException("Failed to download " + objectName, e);
    }
}
Also used : InputStream(java.io.InputStream) GetObjectArgs(io.minio.GetObjectArgs) 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

GetObjectArgs (io.minio.GetObjectArgs)1 ErrorResponseException (io.minio.errors.ErrorResponseException)1 InputStream (java.io.InputStream)1 StorageException (org.codelibs.fess.exception.StorageException)1 FessConfig (org.codelibs.fess.mylasta.direction.FessConfig)1