bug4671 removal of tmp files now via Files.delete

This commit is contained in:
Kai Börnert
2018-07-16 10:12:32 +02:00
parent fc3d8003c3
commit 6569cf6a72
@@ -18,6 +18,7 @@ import java.net.URLConnection;
import java.net.URLEncoder;
import java.nio.channels.Channels;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
@@ -254,7 +255,11 @@ public class MediaServiceImpl extends RemoteServiceServlet implements MediaServi
message = e.getMessage();
} finally {
if (tmp != null) {
tmp.delete();
try {
Files.delete(tmp.toPath());
} catch (IOException e) {
logger.log(Level.SEVERE, "Could not delete tmp mp4 file", e);
}
}
}
return new VideoMetadataDTO(true, duration, spherical, recordStartedTimer, message);