Polishing

This commit is contained in:
Juergen Hoeller
2017-09-08 16:56:22 +02:00
parent aa4ae7a750
commit fd0132c7e6
4 changed files with 15 additions and 9 deletions

View File

@@ -49,20 +49,22 @@ public class MockPart implements Part {
/**
* Constructor for a part with byte[] content only.
* @see #getHeaders()
*/
public MockPart(String name, byte[] content) {
public MockPart(String name, @Nullable byte[] content) {
this(name, null, content);
}
/**
* Constructor for a part with a filename.
* Constructor for a part with a filename and streamed content.
* @see #getHeaders()
*/
public MockPart(String name, @Nullable String filename, InputStream content) throws IOException {
this(name, filename, FileCopyUtils.copyToByteArray(content));
}
/**
* Constructor for a part with byte[] content only.
* Constructor for a part with a filename and byte[] content.
* @see #getHeaders()
*/
private MockPart(String name, @Nullable String filename, @Nullable byte[] content) {