AGPaths.java
package com.franz.agbase.examples;
import java.io.File;
import java.io.IOException;
import com.franz.agbase.*;
public class AGPaths {
public static String EXAMPLES_ROOT = System.getProperty("user.dir");
public static String TRIPLE_STORES = EXAMPLES_ROOT + "/ts/";
public static String DATA_SOURCES = EXAMPLES_ROOT + "/data/";
static {
}
public static void main(String[] args) {
showPaths();
}
public static void showPaths() {
System.out.println("AllegroGraph Paths");
System.out.println(" EXAMPLES_ROOT: " + EXAMPLES_ROOT);
System.out.println(" TRIPLE_STORES: " + TRIPLE_STORES);
System.out.println(" DATA_SOURCES : " + DATA_SOURCES);
}
public static String dataSources(String relPath) throws AllegroGraphException {
String fp;
try {
fp = (new File(DATA_SOURCES+relPath)).getCanonicalPath();
} catch (IOException e) {
throw new AllegroGraphException(e.getMessage());
}
return fp;
}
public static boolean checkPaths() {
File root = new File(EXAMPLES_ROOT);
File ts = new File(TRIPLE_STORES);
File data = new File(DATA_SOURCES);
boolean allDirsExist = false;
if (root.isDirectory() && ts.isDirectory() && data.isDirectory()) {
allDirsExist = true;
} else {
System.out.println("Please ensure paths for TRIPLE_STORES and DATA_SOURCES are properly configured in AGPaths.java for your system.");
showPaths();
System.exit(1);
}
return allDirsExist;
}
}
Up |
Next