mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-29 08:56:43 +00:00
bug4671 removal of tmp files now via Files.delete
This commit is contained in:
+6
-1
@@ -18,6 +18,7 @@ import java.net.URLConnection;
|
|||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.nio.channels.Channels;
|
import java.nio.channels.Channels;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.nio.file.Files;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -254,7 +255,11 @@ public class MediaServiceImpl extends RemoteServiceServlet implements MediaServi
|
|||||||
message = e.getMessage();
|
message = e.getMessage();
|
||||||
} finally {
|
} finally {
|
||||||
if (tmp != null) {
|
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);
|
return new VideoMetadataDTO(true, duration, spherical, recordStartedTimer, message);
|
||||||
|
|||||||
Reference in New Issue
Block a user