Skip to content

Commit

Permalink
Merge pull request #30694 from geoand/rr-tmp-file
Browse files Browse the repository at this point in the history
Use newer API for creating tmp files in RESTEasy Reactive
  • Loading branch information
gsmet authored Jan 30, 2023
2 parents e356a52 + 95d5904 commit 4646c15
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.io.OutputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.nio.file.Files;

import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
Expand All @@ -32,7 +33,7 @@ public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotati
public File readFrom(Class<File> type, Type genericType,
Annotation[] annotations, MediaType mediaType,
MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException {
File downloadedFile = File.createTempFile(PREFIX, SUFFIX);
File downloadedFile = Files.createTempFile(PREFIX, SUFFIX).toFile();
if (HeaderUtil.isContentLengthZero(httpHeaders)) {
return downloadedFile;
}
Expand Down

0 comments on commit 4646c15

Please sign in to comment.