private final File xmlDir;
+ private final String translateDirPath;
+ private final File translateDir;
+
/**
* Check or create the db, log and res directories.
*
xmlDir = new File(programDir, "xml");
checkExistingReadableDir(xmlDir);
+ translateDir = new File(programDir, "translate");
+ checkExistingReadableDir(translateDir);
+ translateDirPath= slashTerminatePath(translateDir.getPath());
+
// Read-write
dbDir = new File(homeDir, "db");
createDirOrCheckWriteable(dbDir);
return new File(xmlDir, toPlatformPathSeparator(relativePath));
}
+ /**
+ * Get a path below the 'translate' directory, using native {@link File#separator}.
+ * This will contain backslashes on Windows.
+ */
+ public String getTranslateFilePath(String relativePath) {
+ return translateDirPath + toPlatformPathSeparator(relativePath);
+ }
+
private static String toPlatformPathSeparator(String relativePath) {
// Sometimes a space in the file name comes across as a %20. This is to put it back as a space.
relativePath = relativePath.replace("%20", " ");