Search in sources :

Example 6 with RecordingMetadata

use of org.bigbluebutton.api.domain.RecordingMetadata in project bigbluebutton by bigbluebutton.

the class RecordingService method deleteRecording.

public static void deleteRecording(File destDir, String recordingId, File recordingDir) {
    File metadataXml = RecordingMetadataReaderHelper.getMetadataXmlLocation(recordingDir.getPath());
    RecordingMetadata r = RecordingMetadataReaderHelper.getRecordingMetadata(metadataXml);
    if (r != null) {
        if (!destDir.exists())
            destDir.mkdirs();
        try {
            FileUtils.moveDirectory(recordingDir, new File(destDir.getPath() + File.separatorChar + recordingId));
            r.setState(Recording.STATE_DELETED);
            r.setPublished(false);
            File medataXmlFile = RecordingMetadataReaderHelper.getMetadataXmlLocation(destDir.getAbsolutePath() + File.separatorChar + recordingId);
            // Process the changes by saving the recording into metadata.xml
            RecordingMetadataReaderHelper.saveRecordingMetadata(medataXmlFile, r);
        } catch (IOException e) {
            log.error("Failed to delete recording : " + recordingId, e);
        }
    }
}
Also used : RecordingMetadata(org.bigbluebutton.api.domain.RecordingMetadata) IOException(java.io.IOException) File(java.io.File)

Aggregations

RecordingMetadata (org.bigbluebutton.api.domain.RecordingMetadata)6 File (java.io.File)5 IOException (java.io.IOException)3 JacksonXmlModule (com.fasterxml.jackson.dataformat.xml.JacksonXmlModule)1 XmlMapper (com.fasterxml.jackson.dataformat.xml.XmlMapper)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1