Resolve relative paths relative to Helma home directory. Fixes bug 639 <http://helma.org/bugs/show_bug.cgi?id=639>
This commit is contained in:
parent
8a5c065901
commit
ac28cd7542
1 changed files with 11 additions and 0 deletions
|
@ -281,6 +281,14 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
return server.getLogger();
|
||||
}
|
||||
|
||||
private String findResource(String path) {
|
||||
File file = new File(path);
|
||||
if (!file.isAbsolute() && !file.exists()) {
|
||||
file = new File(server.getHopHome(), path);
|
||||
}
|
||||
return file.getAbsolutePath();
|
||||
}
|
||||
|
||||
/**
|
||||
* Inner class that describes an application and its start settings.
|
||||
*/
|
||||
|
@ -362,10 +370,13 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
if (repositoryImpl == null) {
|
||||
// implementation not set manually, have to guess it
|
||||
if (repositoryArgs.endsWith(".zip")) {
|
||||
repositoryArgs = findResource(repositoryArgs);
|
||||
repositoryImpl = "helma.framework.repository.ZipRepository";
|
||||
} else if (repositoryArgs.endsWith(".js")) {
|
||||
repositoryArgs = findResource(repositoryArgs);
|
||||
repositoryImpl = "helma.framework.repository.SingleFileRepository";
|
||||
} else {
|
||||
repositoryArgs = findResource(repositoryArgs);
|
||||
repositoryImpl = "helma.framework.repository.FileRepository";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue