MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / getPrefsDir

Method getPrefsDir

ij/src/main/java/ij/Prefs.java:459–490  ·  view source on GitHub ↗

Returns the path to the directory where the preferences file (IJPrefs.txt) is saved.

()

Source from the content-addressed store, hash-verified

457 /** Returns the path to the directory where the
458 preferences file (IJPrefs.txt) is saved. */
459 @AstroImageJ(reason = "rename for AIJ", modified = true)
460 public static String getPrefsDir() {
461 // look in current directory
462 if (prefsDir==null) {
463 String cwd = System.getProperty("user.dir");
464 File f = new File(cwd+File.separator+PREFS_NAME);
465 if (f.exists()) {
466 prefsDir = cwd;
467 preferencesPath = cwd+"/"+PREFS_NAME;
468 }
469 // look in ImageJ directory
470 if (prefsDir==null) {
471 String ijDir = getImageJDir();
472 ijDir = ijDir.substring(0, ijDir.length()-1);
473 f = new File(ijDir+File.separator+PREFS_NAME);
474 if (f.exists()) {
475 prefsDir = ijDir;
476 preferencesPath = ijDir+"/"+PREFS_NAME;
477 }
478 }
479 // use home directory
480 if (prefsDir==null) {
481 String dir = System.getProperty("user.home");
482 if (IJ.isMacOSX())
483 dir += "/Library/Preferences";
484 else
485 dir += File.separator+".astroimagej";
486 prefsDir = dir;
487 }
488 }
489 return prefsDir;
490 }
491
492 /** Sets the path to the ImageJ directory. */
493 static void setHomeDir(String path) {

Callers 12

getDirectoryMethod · 0.95
getPrefsDirectoryMethod · 0.95
loadPreferencesMethod · 0.95
savePreferencesMethod · 0.95
runMethod · 0.95
showMainJPanelMethod · 0.95
AstroConverterClass · 0.95
getObservatoriesMethod · 0.95
editObservatoriesMethod · 0.95
backupAllAIJSettingsMethod · 0.95
restoreAllAIJSettingsMethod · 0.95

Calls 6

getImageJDirMethod · 0.95
isMacOSXMethod · 0.95
substringMethod · 0.80
lengthMethod · 0.65
getPropertyMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected