Browse Source

Polishing

pull/26940/head
Sam Brannen 5 years ago
parent
commit
e31a4c4c77
  1. 6
      spring-core/src/main/java/org/springframework/core/io/buffer/DataBufferUtils.java
  2. 4
      spring-web/src/main/java/org/springframework/http/codec/multipart/FileStorage.java
  3. 1
      spring-web/src/main/java/org/springframework/http/codec/multipart/SynchronossPartHttpMessageReader.java

6
spring-core/src/main/java/org/springframework/core/io/buffer/DataBufferUtils.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -71,7 +71,7 @@ public abstract class DataBufferUtils { @@ -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
* Flux is terminated.
* @param inputStreamSupplier the supplier for the input stream to read from
@ -125,7 +125,7 @@ public abstract class DataBufferUtils { @@ -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
* position. Closes the channel when the Flux is terminated.
* @param channelSupplier the supplier for the channel to read from

4
spring-web/src/main/java/org/springframework/http/codec/multipart/FileStorage.java

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

1
spring-web/src/main/java/org/springframework/http/codec/multipart/SynchronossPartHttpMessageReader.java

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

Loading…
Cancel
Save