mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: fix to close FileReader on RecordingManager
parent
c8b648fef8
commit
fb41e6c193
|
@ -358,10 +358,18 @@ public class RecordingManager {
|
|||
public Recording getRecordingFromEntityFile(File file) {
|
||||
if (file.isFile() && file.getName().startsWith(RecordingManager.RECORDING_ENTITY_FILE)) {
|
||||
JsonObject json = null;
|
||||
FileReader fr = null;
|
||||
try {
|
||||
json = new JsonParser().parse(new FileReader(file)).getAsJsonObject();
|
||||
fr = new FileReader(file);
|
||||
json = new JsonParser().parse(fr).getAsJsonObject();
|
||||
} catch (IOException e) {
|
||||
return null;
|
||||
} finally {
|
||||
try {
|
||||
fr.close();
|
||||
} catch (Exception e) {
|
||||
log.error("Exception while closing FileReader: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
return new Recording(json);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue