Skip to content

Commit

Permalink
Remove "file:" from home directory if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
mekya committed Apr 25, 2021
1 parent d0f0755 commit 02046d6
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,24 @@ public static URL[] getJars() {
JarFileFilter jarFileFilter = new JarFileFilter();

String home = System.getProperty("red5.root");

if (home == null || ".".equals(home)) {
// if home is still null look it up via this classes loader
String classLocation = ServerClassLoader.class.getProtectionDomain().getCodeSource().getLocation().toString();
// System.out.printf("Classloader location: %s\n",
// classLocation);
// snip off anything beyond the last slash
home = classLocation.substring(0, classLocation.lastIndexOf('/'));

if (home.startsWith("file:")) {
home = home.substring("file:".length());
}
}

//Add jars in the lib directory
String libPath = home + File.separator +"lib";
System.out.println("libpath: " + libPath);
File libDir = new File(libPath);

File[] libFiles = libDir.listFiles(jarFileFilter);
for (File lib : libFiles) {
try {
Expand Down

0 comments on commit 02046d6

Please sign in to comment.