Polishing

This commit is contained in:
Sam Brannen 2021-05-12 11:31:15 +02:00
parent 4809632f44
commit e31a4c4c77
3 changed files with 6 additions and 5 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2020 the original author or authors. * Copyright 2002-2021 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -71,7 +71,7 @@ public abstract class DataBufferUtils {
//--------------------------------------------------------------------- //---------------------------------------------------------------------
/** /**
* Obtain a {@link InputStream} from the given supplier, and read it into a * Obtain an {@link InputStream} from the given supplier, and read it into a
* {@code Flux} of {@code DataBuffer}s. Closes the input stream when the * {@code Flux} of {@code DataBuffer}s. Closes the input stream when the
* Flux is terminated. * Flux is terminated.
* @param inputStreamSupplier the supplier for the input stream to read from * @param inputStreamSupplier the supplier for the input stream to read from
@ -125,7 +125,7 @@ public abstract class DataBufferUtils {
} }
/** /**
* Obtain a {@code AsynchronousFileChannel} from the given supplier, and * Obtain an {@code AsynchronousFileChannel} from the given supplier, and
* read it into a {@code Flux} of {@code DataBuffer}s, starting at the given * read it into a {@code Flux} of {@code DataBuffer}s, starting at the given
* position. Closes the channel when the Flux is terminated. * position. Closes the channel when the Flux is terminated.
* @param channelSupplier the supplier for the channel to read from * @param channelSupplier the supplier for the channel to read from

View File

@ -59,8 +59,8 @@ abstract class FileStorage {
} }
/** /**
* Create a new {@code FileStorage} based a on a temporary directory. * Create a new {@code FileStorage} based on a temporary directory.
* @param scheduler scheduler to use for blocking operations * @param scheduler the scheduler to use for blocking operations
*/ */
public static FileStorage tempDirectory(Supplier<Scheduler> scheduler) { public static FileStorage tempDirectory(Supplier<Scheduler> scheduler) {
return new TempFileStorage(scheduler); return new TempFileStorage(scheduler);

View File

@ -470,6 +470,7 @@ public class SynchronossPartHttpMessageReader extends LoggingCodecSupport implem
} }
@Override @Override
@SuppressWarnings("resource")
public Flux<DataBuffer> content() { public Flux<DataBuffer> content() {
return DataBufferUtils.readInputStream( return DataBufferUtils.readInputStream(
getStorage()::getInputStream, DefaultDataBufferFactory.sharedInstance, 4096); getStorage()::getInputStream, DefaultDataBufferFactory.sharedInstance, 4096);