mirror of https://github.com/OpenVidu/openvidu.git
Fix extraction error handling in Unzipper and ensure video files are added to the list
parent
3fb1be8073
commit
6cdea22c1d
|
|
@ -54,12 +54,14 @@ public class Unzipper {
|
||||||
String fileExtension = Files.getFileExtension(entry.getName());
|
String fileExtension = Files.getFileExtension(entry.getName());
|
||||||
if (VIDEO_EXTENSIONS.contains(fileExtension)) {
|
if (VIDEO_EXTENSIONS.contains(fileExtension)) {
|
||||||
File outputFile = new File(path, entry.getName());
|
File outputFile = new File(path, entry.getName());
|
||||||
recordingFiles.add(outputFile);
|
|
||||||
new File(outputFile.getParent()).mkdirs();
|
new File(outputFile.getParent()).mkdirs();
|
||||||
|
|
||||||
try (FileOutputStream fos = new FileOutputStream(outputFile);
|
try (FileOutputStream fos = new FileOutputStream(outputFile);
|
||||||
BufferedOutputStream dest = new BufferedOutputStream(fos)) {
|
BufferedOutputStream dest = new BufferedOutputStream(fos)) {
|
||||||
zip.getInputStream(entry).transferTo(dest);
|
zip.getInputStream(entry).transferTo(dest);
|
||||||
|
recordingFiles.add(outputFile);
|
||||||
|
} catch (IOException extractErr) {
|
||||||
|
log.error("Error extracting entry '" + entry.getName() + "': " + extractErr.getMessage());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("Skipping non-video file: " + entry.getName());
|
log.info("Skipping non-video file: " + entry.getName());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue