Example #1
0
  public void testInstallDir() {
    File installDir = new File(StaticUtils.installDir());

    assertTrue(installDir.isDirectory());

    for (String dir : new String[] {"src", "docs", "lib"}) {
      assertTrue(new File(installDir, dir).isDirectory());
    }
  }
Example #2
0
 /**
  * Gets the prefs file to use. Looks in these places in this order:
  *
  * <ol>
  *   <li>omegat.prefs in config dir
  *   <li>omegat.prefs in install dir (defaults supplied with local install)
  * </ol>
  */
 private static File getPreferencesFile() {
   File prefsFile = new File(StaticUtils.getConfigDir(), FILE_PREFERENCES);
   if (prefsFile.exists()) {
     return prefsFile;
   }
   // If user prefs don't exist, fall back to defaults (possibly) bundled with OmegaT.
   prefsFile = new File(StaticUtils.installDir(), FILE_PREFERENCES);
   if (prefsFile.exists()) {
     return prefsFile;
   }
   return null;
 }