startDirFile.delete();
}
private XmlRpcFileManager startXmlRpcFileManager(int port, String catPath) {
XmlRpcFileManager fileMgr = null;
// first make sure to load properties for the file manager
// and make sure to load logging properties as well
// set the log levels
System.setProperty("java.util.logging.config.file", new File(
"./src/main/resources/logging.properties").getAbsolutePath());
// first load the example configuration
try {
System.getProperties().load(
new FileInputStream("./src/main/resources/filemgr.properties"));
} catch (Exception e) {
fail(e.getMessage());
}
// override the catalog to use: we'll use lucene
System.setProperty("filemgr.catalog.factory",
"org.apache.oodt.cas.filemgr.catalog.LuceneCatalogFactory");
System.setProperty(
"org.apache.oodt.cas.filemgr.catalog.lucene.idxPath",
catPath);
// now override the repo mgr policy
try {
System.setProperty(
"org.apache.oodt.cas.filemgr.repositorymgr.dirs",
"file://"
+ new File("./src/testdata/ingest/fmpolicy")
.getCanonicalPath());
} catch (Exception e) {
fail(e.getMessage());
}
// now override the val layer ones
System.setProperty("org.apache.oodt.cas.filemgr.validation.dirs",
"file://"
+ new File("./src/testdata/ingest/fmpolicy")
.getAbsolutePath());
// set up mime repo path
System.setProperty(
"org.apache.oodt.cas.filemgr.mime.type.repository", new File(
"./src/main/resources/mime-types.xml").getAbsolutePath());
try {
fileMgr = new XmlRpcFileManager(port);
} catch (Exception e) {
fail(e.getMessage());
}
return fileMgr;