mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: single stream recording updates file permissions on recording stop
parent
a83fef15f1
commit
339eadd8e4
|
@ -58,6 +58,7 @@ import io.openvidu.server.kurento.core.KurentoParticipant;
|
||||||
import io.openvidu.server.kurento.endpoint.PublisherEndpoint;
|
import io.openvidu.server.kurento.endpoint.PublisherEndpoint;
|
||||||
import io.openvidu.server.recording.RecorderEndpointWrapper;
|
import io.openvidu.server.recording.RecorderEndpointWrapper;
|
||||||
import io.openvidu.server.recording.Recording;
|
import io.openvidu.server.recording.Recording;
|
||||||
|
import io.openvidu.server.utils.CommandExecutor;
|
||||||
import io.openvidu.server.utils.CustomFileWriter;
|
import io.openvidu.server.utils.CustomFileWriter;
|
||||||
|
|
||||||
public class SingleStreamRecordingService extends RecordingService {
|
public class SingleStreamRecordingService extends RecordingService {
|
||||||
|
@ -445,11 +446,25 @@ public class SingleStreamRecordingService extends RecordingService {
|
||||||
try {
|
try {
|
||||||
zipOut.close();
|
zipOut.close();
|
||||||
fos.close();
|
fos.close();
|
||||||
|
this.updateFilePermissions(folder);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.error("Error closing FileOutputStream or ZipOutputStream. Error: {}", e.getMessage());
|
log.error("Error closing FileOutputStream or ZipOutputStream. Error: {}", e.getMessage());
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateFilePermissions(String folder) {
|
||||||
|
String command = "chmod -R 777 " + folder;
|
||||||
|
try {
|
||||||
|
String response = CommandExecutor.execCommand("/bin/sh", "-c", command);
|
||||||
|
if ("".equals(response)) {
|
||||||
|
log.info("Individual recording file permissions successfully updated");
|
||||||
|
} else {
|
||||||
|
log.error("Individual recording file permissions failed to update: {}", response);
|
||||||
|
}
|
||||||
|
} catch (IOException | InterruptedException e) {
|
||||||
|
log.error("Individual recording file permissions failed to update. Error: {}", e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue