private final String spellDirPath;
private final File spellDir;
+ private final String spellDirPathUser;
+ private final File spellDirUser;
+
private final String qssDirPath;
private final File qssDir;
checkExistingReadableDir(spellDir);
spellDirPath = slashTerminatePath(spellDir.getPath());
+
+ spellDirUser = new File(homeDir, "spell");
+ createDirOrCheckWriteable(spellDirUser);
+ spellDirPathUser = slashTerminatePath(spellDirUser.getPath());
+
xmlDir = new File(programDir, "xml");
checkExistingReadableDir(xmlDir);
}
/**
- * Get a path below the 'db' directory, using native {@link File#separator}.
+ * Get a path below the 'spell' directory, using native {@link File#separator}.
* This will contain backslashes on Windows.
*/
public String getSpellDirPath(String relativePath) {
* Get a file below the 'spell' directory.
*/
public File getSpellDirFile(String relativePath) {
- return new File(dbDir, toPlatformPathSeparator(relativePath));
+ return new File(spellDir, toPlatformPathSeparator(relativePath));
}
/**
}
/**
- * Get a path below the 'spell' directory, using native {@link File#separator}.
- * This will contain backslashes on Windows.
+ * Get a file below the 'spell' directory for user dictionaries.
*/
+ public File getSpellDirFileUser(String relativePath) {
+ return new File(spellDirUser, toPlatformPathSeparator(relativePath));
+ }
+
+ /**
+ * Get the spell directory for the jazzy word list (user dictionary).
+ */
+ public String getSpellDirPathUser() {
+ return spellDirPathUser;
+ }
+
+ /**
+ * Get a path below the 'db' directory, using native {@link File#separator}.
+ * This will contain backslashes on Windows.
+ */
public String getDbDirPath(String relativePath) {
return dbDirPath + toPlatformPathSeparator(relativePath);
}
/**
* @throws InitializationException if non-existent, bad file permissions, or a file instead of a directory
*/
- private static void checkExistingWriteableDir(File dir) throws InitializationException {
+ @SuppressWarnings("unused")
+ private static void checkExistingWriteableDir(File dir) throws InitializationException {
checkExistingReadableDir(dir);
if (!dir.canWrite()) {
throw new InitializationException("Directory '" + dir + "' does not have write permission");