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);
}
}
Aggregations