Skip to content

Commit d6fb4a3

Browse files
committed
StandardMultipartFile refactor
Signed-off-by: jaehun <[email protected]>
1 parent 8c03d55 commit d6fb4a3

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

spring-web/src/main/java/org/springframework/web/multipart/support/StandardMultipartHttpServletRequest.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public String getContentType() {
242242

243243
@Override
244244
public boolean isEmpty() {
245-
return (this.part.getSize() == 0);
245+
return (getSize() == 0);
246246
}
247247

248248
@Override
@@ -252,7 +252,7 @@ public long getSize() {
252252

253253
@Override
254254
public byte[] getBytes() throws IOException {
255-
return FileCopyUtils.copyToByteArray(this.part.getInputStream());
255+
return FileCopyUtils.copyToByteArray(getInputStream());
256256
}
257257

258258
@Override
@@ -270,14 +270,9 @@ public void transferTo(File dest) throws IOException, IllegalStateException {
270270
// At least we offloaded the file from memory storage; it'll get deleted
271271
// from the temp dir eventually in any case. And for our user's purposes,
272272
// we can manually copy it to the requested location as a fallback.
273-
FileCopyUtils.copy(this.part.getInputStream(), Files.newOutputStream(dest.toPath()));
273+
FileCopyUtils.copy(getInputStream(), Files.newOutputStream(dest.toPath()));
274274
}
275275
}
276-
277-
@Override
278-
public void transferTo(Path dest) throws IOException, IllegalStateException {
279-
FileCopyUtils.copy(this.part.getInputStream(), Files.newOutputStream(dest));
280-
}
281276
}
282277

283278
}

0 commit comments

Comments
 (0)