diff -Nru thredds-4.6.2/cdm/src/main/java/thredds/inventory/CollectionList.java thredds-4.6.2.system-environment-variables/cdm/src/main/java/thredds/inventory/CollectionList.java
--- thredds-4.6.2/cdm/src/main/java/thredds/inventory/CollectionList.java 2015-06-10 00:05:23.000000000 +0200
+++ thredds-4.6.2.system-environment-variables/cdm/src/main/java/thredds/inventory/CollectionList.java 2015-07-18 07:22:52.206501754 +0200
@@ -73,7 +73,7 @@
Collections.sort(mfiles);
this.lastModified = lastModified;
- this.root = System.getProperty("user.dir");
+ this.root = System.getProperty("user.home");
}
public CollectionList(String collectionName, String root, List<MFile> mfiles, Logger logger) {
diff -Nru thredds-4.6.2/cdm/src/main/java/thredds/inventory/CollectionManagerCatalog.java thredds-4.6.2.system-environment-variables/cdm/src/main/java/thredds/inventory/CollectionManagerCatalog.java
--- thredds-4.6.2/cdm/src/main/java/thredds/inventory/CollectionManagerCatalog.java 2015-06-10 00:05:23.000000000 +0200
+++ thredds-4.6.2.system-environment-variables/cdm/src/main/java/thredds/inventory/CollectionManagerCatalog.java 2015-07-18 07:22:52.220501073 +0200
@@ -75,7 +75,7 @@
}
this.catalogUrl = collectionSpec;
- this.root = System.getProperty("user.dir");
+ this.root = System.getProperty("user.home");
}
@Override
diff -Nru thredds-4.6.2/cdm/src/main/java/thredds/inventory/CollectionSingleFile.java thredds-4.6.2.system-environment-variables/cdm/src/main/java/thredds/inventory/CollectionSingleFile.java
--- thredds-4.6.2/cdm/src/main/java/thredds/inventory/CollectionSingleFile.java 2015-06-10 00:05:23.000000000 +0200
+++ thredds-4.6.2.system-environment-variables/cdm/src/main/java/thredds/inventory/CollectionSingleFile.java 2015-07-18 07:22:52.220501073 +0200
@@ -51,7 +51,7 @@
if (p.getParent() != null)
this.root = p.getParent().toString();
else
- this.root = System.getProperty("user.dir");
+ this.root = System.getProperty("user.home");
this.lastModified = file.getLastModified();
}
diff -Nru thredds-4.6.2/cdm/src/main/java/thredds/inventory/CollectionSpecParser.java thredds-4.6.2.system-environment-variables/cdm/src/main/java/thredds/inventory/CollectionSpecParser.java
--- thredds-4.6.2/cdm/src/main/java/thredds/inventory/CollectionSpecParser.java 2015-06-10 00:05:23.000000000 +0200
+++ thredds-4.6.2.system-environment-variables/cdm/src/main/java/thredds/inventory/CollectionSpecParser.java 2015-07-18 07:22:52.220501073 +0200
@@ -97,7 +97,7 @@
if (posFilter > 0)
rootDir = collectionSpec.substring(0, posFilter);
else
- rootDir = System.getProperty("user.dir"); // working directory
+ rootDir = System.getProperty("user.home"); // working directory
}
File locFile = new File(rootDir);
diff -Nru thredds-4.6.2/cdm/src/main/java/ucar/nc2/util/DiskCache2.java thredds-4.6.2.system-environment-variables/cdm/src/main/java/ucar/nc2/util/DiskCache2.java
--- thredds-4.6.2/cdm/src/main/java/ucar/nc2/util/DiskCache2.java 2015-06-10 00:05:23.000000000 +0200
+++ thredds-4.6.2.system-environment-variables/cdm/src/main/java/ucar/nc2/util/DiskCache2.java 2015-07-18 07:22:52.221501024 +0200
@@ -84,10 +84,10 @@
String root = System.getProperty("nj22.cache");
if (root == null) {
- String home = System.getProperty("user.home");
+ String home = System.getenv("user.home");
if (home == null)
- home = System.getProperty("user.dir");
+ home = System.getProperty("user.home");
if (home == null)
home = ".";
@@ -124,10 +124,10 @@
String home = System.getProperty("nj22.cachePersistRoot");
if (home == null)
- home = System.getProperty("user.home");
+ home = System.getenv("user.home");
if (home == null)
- home = System.getProperty("user.dir");
+ home = System.getProperty("user.home");
if (home == null)
home = ".";
diff -Nru thredds-4.6.2/cdm/src/main/java/ucar/nc2/util/DiskCache.java thredds-4.6.2.system-environment-variables/cdm/src/main/java/ucar/nc2/util/DiskCache.java
--- thredds-4.6.2/cdm/src/main/java/ucar/nc2/util/DiskCache.java 2015-06-10 00:05:23.000000000 +0200
+++ thredds-4.6.2.system-environment-variables/cdm/src/main/java/ucar/nc2/util/DiskCache.java 2015-07-18 07:22:52.221501024 +0200
@@ -102,10 +102,10 @@
root = System.getProperty("nj22.cache");
if (root == null) {
- String home = System.getProperty("user.home");
+ String home = System.getenv("user.home");
if (home == null)
- home = System.getProperty("user.dir");
+ home = System.getProperty("user.home");
if (home == null)
home = ".";
diff -Nru thredds-4.6.2/cdm/src/main/java/ucar/nc2/util/Misc.java thredds-4.6.2.system-environment-variables/cdm/src/main/java/ucar/nc2/util/Misc.java
--- thredds-4.6.2/cdm/src/main/java/ucar/nc2/util/Misc.java 2015-06-10 00:05:23.000000000 +0200
+++ thredds-4.6.2.system-environment-variables/cdm/src/main/java/ucar/nc2/util/Misc.java 2015-07-18 07:22:52.222500976 +0200
@@ -231,7 +231,7 @@
testdataDirPath = System.getProperty(testdataDirPropName); // Check for system property
if(testdataDirPath == null) {
- File userHomeDirFile = new File(System.getProperty("user.home"));
+ File userHomeDirFile = new File(System.getenv("user.home"));
File userThreddsPropsFile = new File(userHomeDirFile, threddsPropFileName);
if(userThreddsPropsFile.exists() && userThreddsPropsFile.canRead()) {
Properties userThreddsProps = new Properties();
diff -Nru thredds-4.6.2/cdm/src/main/java/ucar/nc2/util/rc/RC.java thredds-4.6.2.system-environment-variables/cdm/src/main/java/ucar/nc2/util/rc/RC.java
--- thredds-4.6.2/cdm/src/main/java/ucar/nc2/util/rc/RC.java 2015-06-10 00:05:23.000000000 +0200
+++ thredds-4.6.2.system-environment-variables/cdm/src/main/java/ucar/nc2/util/rc/RC.java 2015-07-18 07:22:52.222500976 +0200
@@ -277,8 +277,8 @@
loadDefaults() {
RC rc0 = new RC();
String[] locations = new String[]{
+ System.getenv("user.home"),
System.getProperty("user.home"),
- System.getProperty("user.dir"),
};
boolean found1 = false;