Implemented some small suggested changes
This commit is contained in:
parent
65d5cacb5f
commit
0c2de0f9c3
@ -16,6 +16,21 @@ Imports and parses recording metadata.xml files and stores the data in a Postgre
|
||||
- Run the unit tests using the command "mvn test"
|
||||
- Use the deploy.sh script to compile the program
|
||||
- Run the program with the recording-imex.sh script found in ~/usr/local/bin
|
||||
- Use the --help option to see the usage
|
||||
|
||||
Usage: {-e|-i <persist>} [-s <id>] [PATH]
|
||||
Import/export recording(s) to/from PATH. The default PATH is
|
||||
/var/bigbluebutton/published/presentation
|
||||
-e export recording(s)
|
||||
-i <persist> import recording(s) and indicate if they should be persisted [true|false]
|
||||
-s <id> ID of single recording to be imported/exported
|
||||
|
||||
|
||||
Examples
|
||||
|
||||
~/usr/local/bin/recording-imex.sh -i true -s random-7739095 /var/bigbluebutton/published/presentation/1abbc41a2f2faf1d754dbd130fba9ae072c6e742-1652301432519/metadata.xml
|
||||
|
||||
~/usr/local/bin/recording-imex.sh -i true /var/bigbluebutton/published/presentation/
|
||||
|
||||
|
||||
## Testing the new recording service
|
||||
|
@ -8,4 +8,5 @@ mkdir -p $RUN_DIR
|
||||
mvn package -Dmaven.test.skip
|
||||
cp target/${JAR_NAME} $JAR_DIR
|
||||
echo '#!/bin/bash
|
||||
java -jar '${JAR_DIR}'/'${JAR_NAME} > ${RUN_DIR}/recording-imex.sh
|
||||
java -jar '${JAR_DIR}'/'${JAR_NAME} '"$@"'> ${RUN_DIR}/recording-imex.sh
|
||||
chmod +x ${RUN_DIR}/recording-imex.sh
|
||||
|
@ -1,6 +1,9 @@
|
||||
package org.bigbluebutton;
|
||||
|
||||
import java.io.Console;
|
||||
import java.io.File;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
public class RecordingApp {
|
||||
@ -68,25 +71,43 @@ public class RecordingApp {
|
||||
}
|
||||
}
|
||||
|
||||
if (i == args.length) {
|
||||
System.out.println("Error: Required arguments not specified");
|
||||
printUsage();
|
||||
return;
|
||||
} else
|
||||
if (i < args.length)
|
||||
path = args[i];
|
||||
else {
|
||||
path = createDefaultDirectory();
|
||||
if (path == null)
|
||||
return;
|
||||
}
|
||||
|
||||
executeCommands(export, persist, id, path);
|
||||
}
|
||||
|
||||
private static void printUsage() {
|
||||
System.out.println("Usage: {-e|-i <persist>} [-s <id>] PATH");
|
||||
System.out.println("Import/export recording(s) to/from PATH");
|
||||
System.out.println("Usage: {-e|-i <persist>} [-s <id>] [PATH]");
|
||||
System.out.println("Import/export recording(s) to/from PATH. The default PATH is "
|
||||
+ "\n/var/bigbluebutton/published/presentation");
|
||||
System.out.println("-e export recording(s)");
|
||||
System.out.println(
|
||||
"-i <persist> import recording(s) and indicate if they should be persisted [true|false]");
|
||||
System.out.println("-s <id> ID of single recording to be imported/exported");
|
||||
}
|
||||
|
||||
private static String createDefaultDirectory() {
|
||||
Path root = Paths.get(System.getProperty("user.dir")).getFileSystem().getRootDirectories().iterator().next();
|
||||
String path = root.toAbsolutePath() + "var/bigbluebutton/published/presentation";
|
||||
|
||||
File directory = new File(path);
|
||||
if (!directory.exists()) {
|
||||
boolean created = directory.mkdirs();
|
||||
if (!created) {
|
||||
System.out.println("Error: Failed to create default presentation directory");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
private static void executeCommands(boolean export, boolean persist, String id, String path) {
|
||||
if (!export) {
|
||||
RecordingImportHandler handler = RecordingImportHandler.getInstance();
|
||||
|
Loading…
Reference in New Issue
Block a user