try {
if (home != null){
final File repo_dir = new File(home, "webapp/WEB-INF/expathrepo");
// ensure the dir exists
repo_dir.mkdir();
final FileSystemStorage storage = new FileSystemStorage(repo_dir);
return new ExistRepository(storage);
}else{
final File repo_dir = new File(System.getProperty("java.io.tmpdir") + "/expathrepo");
// ensure the dir exists
repo_dir.mkdir();
final FileSystemStorage storage = new FileSystemStorage(repo_dir);
return new ExistRepository(storage);
}
}
catch ( final PackageException ex ) {
// problem with pkg-repo.jar throwing exception