Created a Java w/ Maven project structure; added a simple directory creation and executes an FFMPEG command to transcode videos

This commit is contained in:
2022-04-30 20:12:32 -04:00
parent fd31df7d56
commit 898d1467c0
7 changed files with 258 additions and 24 deletions

View File

@ -0,0 +1,27 @@
package tech.bitgoblin.io;
import java.io.File;
public class IOUtils {
public static void createDirectory(String path) {
File f = new File(path);
boolean res = f.mkdir();
if (res) {
System.out.println(path + " was created.");
}
}
public static String resolveTilda(String path) {
if (path.startsWith("~" + File.separator)) {
path = System.getProperty("user.home") + path.substring(1);
} else if (path.startsWith("~")) {
// here you can implement reading homedir of other users if you care
throw new UnsupportedOperationException("Home dir expansion not implemented for explicit usernames");
}
return path;
}
}