/hg/icedtea-web: PathsAndFiles definitions made aware of deploym...
jvanek at icedtea.classpath.org
jvanek at icedtea.classpath.org
Wed Apr 1 16:43:24 UTC 2015
changeset cbc450f7203f in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=cbc450f7203f
author: Jiri Vanek <jvanek at redhat.com>
date: Wed Apr 01 18:39:20 2015 +0200
PathsAndFiles definitions made aware of deployment.properties which can change them
diffstat:
ChangeLog | 19 +
netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java | 2 +-
netx/net/sourceforge/jnlp/config/Defaults.java | 35 +-
netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java | 37 +-
netx/net/sourceforge/jnlp/config/PathsAndFiles.java | 180 ++++++++-
netx/net/sourceforge/jnlp/controlpanel/CachePane.java | 2 +-
netx/net/sourceforge/jnlp/resources/Messages.properties | 2 +
netx/net/sourceforge/jnlp/util/docprovider/TextsProvider.java | 12 +-
tests/reproducers/signed/CacheReproducer/testcases/CacheReproducerTest.java | 2 +-
9 files changed, 225 insertions(+), 66 deletions(-)
diffs (truncated from 613 to 500 lines):
diff -r 8661e15b9f1b -r cbc450f7203f ChangeLog
--- a/ChangeLog Wed Apr 01 18:09:27 2015 +0200
+++ b/ChangeLog Wed Apr 01 18:39:20 2015 +0200
@@ -1,3 +1,22 @@
+2015-04-01 Jiri Vanek <jvanek at redhat.com>
+
+ PathsAndFiles definitions made aware of deployment.properties which can change them
+ * netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java: (CacheLRUWrapper) used
+ gette rinstead of field for RECENTLY_USED_FILE
+ * netx/net/sourceforge/jnlp/config/Defaults.java: all getFullPath replaced
+ by getDefaultFullPath.
+ * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: removed read
+ from properties and repalced by getters from PathsAndFiles.
+ * netx/net/sourceforge/jnlp/controlpanel/CachePane.java: same
+ * tests/reproducers/signed/CacheReproducer/testcases/CacheReproducerTest.java: same
+ * netx/net/sourceforge/jnlp/config/PathsAndFiles.java: Or setup-able InfrastructureFileDescriptor
+ now can return their non-default value by overriden getFullPath and reading
+ from properties.
+ * netx/net/sourceforge/jnlp/resources/Messages.properties: added BUTControlledBy
+ of Controlled by and BUTmodified of modified
+ * netx/net/sourceforge/jnlp/util/docprovider/TextsProvider.java: now uses new
+ Messages.properties keys
+
2015-03-31 Jiri Vanek <jvanek at redhat.com>
PolicyEditor now honor verbose switch
diff -r 8661e15b9f1b -r cbc450f7203f netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java
--- a/netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java Wed Apr 01 18:09:27 2015 +0200
+++ b/netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java Wed Apr 01 18:39:20 2015 +0200
@@ -71,7 +71,7 @@
private final File cacheDir;
public CacheLRUWrapper() {
- this(PathsAndFiles.RECENTLY_USED_FILE.getFile(), PathsAndFiles.CACHE_DIR.getFile());
+ this(PathsAndFiles.getRecentlyUsedFile().getFile(), PathsAndFiles.CACHE_DIR.getFile());
}
diff -r 8661e15b9f1b -r cbc450f7203f netx/net/sourceforge/jnlp/config/Defaults.java
--- a/netx/net/sourceforge/jnlp/config/Defaults.java Wed Apr 01 18:09:27 2015 +0200
+++ b/netx/net/sourceforge/jnlp/config/Defaults.java Wed Apr 01 18:39:20 2015 +0200
@@ -59,6 +59,7 @@
public static Map<String, Setting<String>> getDefaults() {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
+ sm.checkRead(USER_DEPLOYMENT_FILE.getDefaultFullPath());
sm.checkRead(USER_DEPLOYMENT_FILE.getFullPath());
}
@@ -79,12 +80,12 @@
{
DeploymentConfiguration.KEY_USER_CACHE_DIR,
BasicValueValidators.getFilePathValidator(),
- CACHE_DIR.getFullPath()
+ CACHE_DIR.getDefaultFullPath()
},
{
DeploymentConfiguration.KEY_USER_PERSISTENCE_CACHE_DIR,
BasicValueValidators.getFilePathValidator(),
- PCACHE_DIR.getFullPath()
+ PCACHE_DIR.getDefaultFullPath()
},
{
DeploymentConfiguration.KEY_SYSTEM_CACHE_DIR,
@@ -94,53 +95,53 @@
{
DeploymentConfiguration.KEY_USER_LOG_DIR,
BasicValueValidators.getFilePathValidator(),
- LOG_DIR.getFullPath()
+ LOG_DIR.getDefaultFullPath()
},
{
DeploymentConfiguration.KEY_USER_TMP_DIR,
BasicValueValidators.getFilePathValidator(),
- TMP_DIR.getFullPath()
+ TMP_DIR.getDefaultFullPath()
},
{
DeploymentConfiguration.KEY_USER_LOCKS_DIR,
BasicValueValidators.getFilePathValidator(),
- LOCKS_DIR.getFullPath()
+ LOCKS_DIR.getDefaultFullPath()
},
{
DeploymentConfiguration.KEY_USER_NETX_RUNNING_FILE,
BasicValueValidators.getFilePathValidator(),
- MAIN_LOCK.getFullPath()
+ MAIN_LOCK.getDefaultFullPath()
},
/* certificates and policy files */
{
DeploymentConfiguration.KEY_USER_SECURITY_POLICY,
BasicValueValidators.getUrlValidator(),
- "file://" + JAVA_POLICY.getFullPath()
+ "file://" + JAVA_POLICY.getDefaultFullPath()
},
{
DeploymentConfiguration.KEY_USER_TRUSTED_CA_CERTS,
BasicValueValidators.getFilePathValidator(),
- USER_CACERTS.getFullPath()
+ USER_CACERTS.getDefaultFullPath()
},
{
DeploymentConfiguration.KEY_USER_TRUSTED_JSSE_CA_CERTS,
BasicValueValidators.getFilePathValidator(),
- USER_JSSECAC.getFullPath()
+ USER_JSSECAC.getDefaultFullPath()
},
{
DeploymentConfiguration.KEY_USER_TRUSTED_CERTS,
BasicValueValidators.getFilePathValidator(),
- USER_CERTS.getFullPath()
+ USER_CERTS.getDefaultFullPath()
},
{
DeploymentConfiguration.KEY_USER_TRUSTED_JSSE_CERTS,
BasicValueValidators.getFilePathValidator(),
- USER_JSSECER.getFullPath()
+ USER_JSSECER.getDefaultFullPath()
},
{
DeploymentConfiguration.KEY_USER_TRUSTED_CLIENT_CERTS,
BasicValueValidators.getFilePathValidator(),
- USER_CLIENTCERT.getFullPath()
+ USER_CLIENTCERT.getDefaultFullPath()
},
{
DeploymentConfiguration.KEY_SYSTEM_SECURITY_POLICY,
@@ -150,27 +151,27 @@
{
DeploymentConfiguration.KEY_SYSTEM_TRUSTED_CA_CERTS,
BasicValueValidators.getFilePathValidator(),
- SYS_CACERT.getFullPath()
+ SYS_CACERT.getDefaultFullPath()
},
{
DeploymentConfiguration.KEY_SYSTEM_TRUSTED_JSSE_CA_CERTS,
BasicValueValidators.getFilePathValidator(),
- SYS_JSSECAC.getFullPath()
+ SYS_JSSECAC.getDefaultFullPath()
},
{
DeploymentConfiguration.KEY_SYSTEM_TRUSTED_CERTS,
BasicValueValidators.getFilePathValidator(),
- SYS_CERT.getFullPath()
+ SYS_CERT.getDefaultFullPath()
},
{
DeploymentConfiguration.KEY_SYSTEM_TRUSTED_JSSE_CERTS,
BasicValueValidators.getFilePathValidator(),
- SYS_JSSECERT.getFullPath()
+ SYS_JSSECERT.getDefaultFullPath()
},
{
DeploymentConfiguration.KEY_SYSTEM_TRUSTED_CLIENT_CERTS,
BasicValueValidators.getFilePathValidator(),
- SYS_CLIENTCERT.getFullPath()
+ SYS_CLIENTCERT.getDefaultFullPath()
},
/* security access and control */
{
diff -r 8661e15b9f1b -r cbc450f7203f netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java
--- a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java Wed Apr 01 18:09:27 2015 +0200
+++ b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java Wed Apr 01 18:39:20 2015 +0200
@@ -16,11 +16,6 @@
package net.sourceforge.jnlp.config;
-import static net.sourceforge.jnlp.config.PathsAndFiles.JAVA_DEPLOYMENT_PROP_FILE;
-import static net.sourceforge.jnlp.config.PathsAndFiles.USER_CACHE_HOME;
-import static net.sourceforge.jnlp.config.PathsAndFiles.USER_CONFIG_HOME;
-import static net.sourceforge.jnlp.config.PathsAndFiles.USER_DEPLOYMENT_FILE;
-import static net.sourceforge.jnlp.config.PathsAndFiles.USER_SECURITY;
import static net.sourceforge.jnlp.runtime.Translator.R;
import java.io.BufferedOutputStream;
@@ -287,12 +282,12 @@
public void load(boolean fixIssues) throws ConfigurationException {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
- sm.checkRead(USER_DEPLOYMENT_FILE.getFullPath());
+ sm.checkRead(PathsAndFiles.USER_DEPLOYMENT_FILE.getFullPath());
}
File systemConfigFile = findSystemConfigFile();
- load(systemConfigFile, USER_DEPLOYMENT_FILE.getFile(), fixIssues);
+ load(systemConfigFile, PathsAndFiles.USER_DEPLOYMENT_FILE.getFile(), fixIssues);
}
void load(File systemConfigFile, File userFile, boolean fixIssues) throws ConfigurationException {
@@ -475,7 +470,7 @@
String jrePath = null;
try {
- Map<String, Setting<String>> tmpProperties = parsePropertiesFile(USER_DEPLOYMENT_FILE.getFile());
+ Map<String, Setting<String>> tmpProperties = parsePropertiesFile(PathsAndFiles.USER_DEPLOYMENT_FILE.getFile());
Setting<String> jreSetting = tmpProperties.get(KEY_JRE_DIR);
if (jreSetting != null) {
jrePath = jreSetting.getValue();
@@ -490,7 +485,7 @@
jreFile = new File(jrePath + File.separator + "lib"
+ File.separator + DEPLOYMENT_CONFIG_FILE);
} else {
- jreFile = JAVA_DEPLOYMENT_PROP_FILE.getFile();
+ jreFile = PathsAndFiles.JAVA_DEPLOYMENT_PROP_FILE.getFile();
}
if (jreFile.isFile()) {
return jreFile;
@@ -735,24 +730,24 @@
int errors = 0;
String PRE_15_DEPLOYMENT_DIR = ".icedtea";
String LEGACY_USER_HOME = System.getProperty("user.home") + File.separator + PRE_15_DEPLOYMENT_DIR;
- File configDir = new File(USER_CONFIG_HOME);
- File cacheDir = new File(USER_CACHE_HOME);
+ File configDir = new File(PathsAndFiles.USER_CONFIG_HOME);
+ File cacheDir = new File(PathsAndFiles.USER_CACHE_HOME);
File legacyUserDir = new File(LEGACY_USER_HOME);
if (legacyUserDir.exists()) {
OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "Legacy configuration and cache found. Those will be now transported to new locations");
- OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, USER_CONFIG_HOME + " and " + USER_CACHE_HOME);
+ OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, PathsAndFiles.USER_CONFIG_HOME + " and " + PathsAndFiles.USER_CACHE_HOME);
OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "You should not see this message next time you run icedtea-web!");
OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "Your custom dirs will not be touched and will work");
OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "-----------------------------------------------");
OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "Preparing new directories:");
- OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, " " + USER_CONFIG_HOME);
+ OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, " " + PathsAndFiles.USER_CONFIG_HOME);
errors += resultToStd(configDir.mkdirs());
- OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, " " + USER_CACHE_HOME);
+ OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, " " + PathsAndFiles.USER_CACHE_HOME);
errors += resultToStd(cacheDir.mkdirs());
String legacySecurity = LEGACY_USER_HOME + File.separator + "security";
- String currentSecurity = USER_SECURITY;
+ String currentSecurity = PathsAndFiles.USER_SECURITY;
errors += moveLegacyToCurrent(legacySecurity, currentSecurity);
String legacyCache = LEGACY_USER_HOME + File.separator + "cache";
@@ -761,7 +756,7 @@
OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "Adapting " + PathsAndFiles.CACHE_INDEX_FILE_NAME + " to new destination");
//replace all legacyCache by currentCache in new recently_used
try {
- File f = PathsAndFiles.RECENTLY_USED_FILE.getFile();
+ File f = PathsAndFiles.getRecentlyUsedFile().getFile();
String s = FileUtils.loadFileAsString(f);
s = s.replace(legacyCache, currentCache);
FileUtils.saveFile(s, f);
@@ -779,11 +774,11 @@
errors += moveLegacyToCurrent(legacyLogDir, currentLogDir);
String legacyProperties = LEGACY_USER_HOME + File.separator + DEPLOYMENT_PROPERTIES;
- String currentProperties = USER_CONFIG_HOME + File.separator + DEPLOYMENT_PROPERTIES;
+ String currentProperties = PathsAndFiles.USER_CONFIG_HOME + File.separator + DEPLOYMENT_PROPERTIES;
errors += moveLegacyToCurrent(legacyProperties, currentProperties);
String legacyPropertiesOld = LEGACY_USER_HOME + File.separator + DEPLOYMENT_PROPERTIES + ".old";
- String currentPropertiesOld = USER_CONFIG_HOME + File.separator + DEPLOYMENT_PROPERTIES + ".old";
+ String currentPropertiesOld = PathsAndFiles.USER_CONFIG_HOME + File.separator + DEPLOYMENT_PROPERTIES + ".old";
errors += moveLegacyToCurrent(legacyPropertiesOld, currentPropertiesOld);
@@ -801,19 +796,19 @@
if (errors != 0) {
OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "There occureed " + errors + " errors");
OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "Please double check content of old data in " + LEGACY_USER_HOME + " with ");
- OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "new " + USER_CONFIG_HOME + " and " + USER_CACHE_HOME);
+ OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "new " + PathsAndFiles.USER_CONFIG_HOME + " and " + PathsAndFiles.USER_CACHE_HOME);
OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "To disable this check again, please remove " + LEGACY_USER_HOME);
}
} else {
OutputController.getLogger().log("System is already following XDG .cache and .config specifications");
try {
- OutputController.getLogger().log("config: " + USER_CONFIG_HOME + " file exists: " + configDir.exists());
+ OutputController.getLogger().log("config: " + PathsAndFiles.USER_CONFIG_HOME + " file exists: " + configDir.exists());
} catch (Exception ex) {
OutputController.getLogger().log(ex);
}
try {
- OutputController.getLogger().log("cache: " + USER_CACHE_HOME + " file exists:" + cacheDir.exists());
+ OutputController.getLogger().log("cache: " + PathsAndFiles.USER_CACHE_HOME + " file exists:" + cacheDir.exists());
} catch (Exception ex) {
OutputController.getLogger().log(ex);
}
diff -r 8661e15b9f1b -r cbc450f7203f netx/net/sourceforge/jnlp/config/PathsAndFiles.java
--- a/netx/net/sourceforge/jnlp/config/PathsAndFiles.java Wed Apr 01 18:09:27 2015 +0200
+++ b/netx/net/sourceforge/jnlp/config/PathsAndFiles.java Wed Apr 01 18:39:20 2015 +0200
@@ -115,10 +115,41 @@
public static final InfrastructureFileDescriptor OPERA_64 = new InfrastructureFileDescriptor(ICEDTEA_SO, "/usr/lib64/opera/plugins/", "", "FILEopera64", Target.PLUGIN);
public static final InfrastructureFileDescriptor OPERA_32 = new InfrastructureFileDescriptor(ICEDTEA_SO, "/usr/lib/opera/plugins/", "", "FILEopera32", Target.PLUGIN);
- public static final InfrastructureFileDescriptor CACHE_DIR = new ItwCacheFileDescriptor("cache", "FILEcache", Target.JAVAWS, Target.ITWEB_SETTINGS);
- public static final InfrastructureFileDescriptor RECENTLY_USED_FILE = new ItwCacheFileDescriptor(CACHE_INDEX_FILE_NAME, CACHE_DIR.getFile().getName(), "FILErecentlyUsed", Target.JAVAWS, Target.ITWEB_SETTINGS);
- public static final InfrastructureFileDescriptor PCACHE_DIR = new ItwCacheFileDescriptor("pcache", "FILEappdata", Target.JAVAWS, Target.ITWEB_SETTINGS);
- public static final InfrastructureFileDescriptor LOG_DIR = new ItwConfigFileDescriptor("log", "FILElogs", Target.JAVAWS, Target.ITWEB_SETTINGS);
+ public static final InfrastructureFileDescriptor CACHE_DIR = new ItwCacheFileDescriptor("cache", "FILEcache", Target.JAVAWS, Target.ITWEB_SETTINGS) {
+
+ @Override
+ public String getFullPath() {
+ return gcpd(DeploymentConfiguration.KEY_USER_CACHE_DIR);
+ }
+
+ };
+
+
+ // this one is depnding on CACHE_DIR, so initialize it lazily
+ public static InfrastructureFileDescriptor getRecentlyUsedFile() {
+ return RECENTLY_USED_FILE_HOLDER.RECENTLY_USED_FILE;
+ }
+
+ private static class RECENTLY_USED_FILE_HOLDER {
+ static final InfrastructureFileDescriptor RECENTLY_USED_FILE = new ItwCacheFileDescriptor(CACHE_INDEX_FILE_NAME, CACHE_DIR.getFile().getName(), "FILErecentlyUsed", Target.JAVAWS, Target.ITWEB_SETTINGS);
+ }
+
+ public static final InfrastructureFileDescriptor PCACHE_DIR = new ItwCacheFileDescriptor("pcache", "FILEappdata", Target.JAVAWS, Target.ITWEB_SETTINGS){
+
+ @Override
+ public String getFullPath() {
+ return gcpd(DeploymentConfiguration.KEY_USER_PERSISTENCE_CACHE_DIR);
+ }
+ };
+ public static final InfrastructureFileDescriptor LOG_DIR = new ItwConfigFileDescriptor("log", "FILElogs", Target.JAVAWS, Target.ITWEB_SETTINGS){
+
+ @Override
+ public String getFullPath() {
+ return gcpd(DeploymentConfiguration.KEY_USER_LOG_DIR);
+ }
+
+
+ };
//javaws is saving here, itweb-settings may modify them
public static final InfrastructureFileDescriptor ICONS_DIR = new ItwConfigFileDescriptor("icons", "FILEicons", Target.JAVAWS, Target.ITWEB_SETTINGS);
public static final InfrastructureFileDescriptor GEN_JNLPS_DIR = new ItwConfigFileDescriptor("generated_jnlps", "FILEjnlps", Target.PLUGIN, Target.ITWEB_SETTINGS);
@@ -127,25 +158,88 @@
public static final InfrastructureFileDescriptor APPLET_TRUST_SETTINGS_USER = new ItwConfigFileDescriptor(APPLET_TRUST_SETTINGS, "FILEextasuser", Target.JAVAWS, Target.ITWEB_SETTINGS);
public static final InfrastructureFileDescriptor APPLET_TRUST_SETTINGS_SYS = new SystemDeploymentCofigFileDescriptor(APPLET_TRUST_SETTINGS, "FILEextasadmin", Target.JAVAWS, Target.ITWEB_SETTINGS);
public static final InfrastructureFileDescriptor ETC_DEPLOYMENT_CFG = new SystemDeploymentCofigFileDescriptor(DEPLOYMENT_CONFIG_FILE, "FILEglobaldp", Target.JAVAWS, Target.ITWEB_SETTINGS);
- public static final InfrastructureFileDescriptor TMP_DIR = new ItwCacheFileDescriptor("tmp", "FILEtmpappdata", Target.JAVAWS, Target.ITWEB_SETTINGS);
+ public static final InfrastructureFileDescriptor TMP_DIR = new ItwCacheFileDescriptor("tmp", "FILEtmpappdata", Target.JAVAWS, Target.ITWEB_SETTINGS){
+
+ @Override
+ public String getFullPath() {
+ return gcpd(DeploymentConfiguration.KEY_USER_TMP_DIR);
+ }
+
+ };
+ public static final InfrastructureFileDescriptor LOCKS_DIR = new TmpUsrFileDescriptor("locks", "netx", "FILElocksdir", Target.JAVAWS) {
- public static final InfrastructureFileDescriptor LOCKS_DIR = new TmpUsrFileDescriptor("locks", "netx", "FILElocksdir", Target.JAVAWS);
- public static final InfrastructureFileDescriptor MAIN_LOCK = new TmpUsrFileDescriptor("netx_running", "netx" + File.separator + "locks", "FILEmainlock", Target.JAVAWS);
+ @Override
+ public String getFullPath() {
+ return gcpd(DeploymentConfiguration.KEY_USER_LOCKS_DIR);
+ }
+
+ };
+ public static final InfrastructureFileDescriptor MAIN_LOCK = new TmpUsrFileDescriptor("netx_running", "netx" + File.separator + "locks", "FILEmainlock", Target.JAVAWS) {
- public static final InfrastructureFileDescriptor JAVA_POLICY = new UserSecurityConfigFileDescriptor("java.policy", "FILEpolicy", Target.JAVAWS, Target.POLICY_EDITOR);
+ @Override
+ public String getFullPath() {
+ return gcpd(DeploymentConfiguration.KEY_USER_NETX_RUNNING_FILE);
+ }
+
+ };
+ public static final InfrastructureFileDescriptor JAVA_POLICY = new UserSecurityConfigFileDescriptor("java.policy", "FILEpolicy", Target.JAVAWS, Target.POLICY_EDITOR){
+
+ @Override
+ public String getFullPath() {
+ return gcpd(DeploymentConfiguration.KEY_USER_SECURITY_POLICY);
+ }
+
+ @Override
+ public File getFile() {
+ throw new IllegalStateException("Only getFullPath should be used. This is returning URL String.");
+ }
+
+ @Override
+ public File getDefaultFile() {
+ throw new IllegalStateException("Only getDefaultFullPath should be used. This is returning URL String.");
+ }
+
+ };
public static final InfrastructureFileDescriptor USER_CACERTS = new UserCacertsFileDescriptor("trusted.cacerts");
public static final InfrastructureFileDescriptor USER_JSSECAC = new UserCacertsFileDescriptor("trusted.jssecacerts");
public static final InfrastructureFileDescriptor USER_CERTS = new UserCacertsFileDescriptor("trusted.certs");
public static final InfrastructureFileDescriptor USER_JSSECER = new UserCacertsFileDescriptor("trusted.jssecerts");
public static final InfrastructureFileDescriptor USER_CLIENTCERT = new UserCacertsFileDescriptor("trusted.clientcerts");
- public static final InfrastructureFileDescriptor SYS_CACERT = new SystemJavaSecurityFileDescriptor("cacerts");
- public static final InfrastructureFileDescriptor SYS_JSSECAC = new SystemJavaSecurityFileDescriptor("jssecacerts");
+ public static final InfrastructureFileDescriptor SYS_CACERT = new SystemJavaSecurityFileDescriptor("cacerts") {
+
+ @Override
+ public String getFullPath() {
+ return gcpd(DeploymentConfiguration.KEY_SYSTEM_TRUSTED_CA_CERTS);
+ }
+
+ };
+ public static final InfrastructureFileDescriptor SYS_JSSECAC = new SystemJavaSecurityFileDescriptor("jssecacerts") {
+
+ @Override
+ public String getFullPath() {
+ return gcpd(DeploymentConfiguration.KEY_SYSTEM_TRUSTED_JSSE_CA_CERTS);
+ }
+
+ };
public static final InfrastructureFileDescriptor SYS_CERT = new SystemJavaSecurityFileDescriptor("trusted.certs");
- public static final InfrastructureFileDescriptor SYS_JSSECERT = new SystemJavaSecurityFileDescriptor("trusted.jssecerts");
- public static final InfrastructureFileDescriptor SYS_CLIENTCERT = new SystemJavaSecurityFileDescriptor("trusted.clientcerts");
+ public static final InfrastructureFileDescriptor SYS_JSSECERT = new SystemJavaSecurityFileDescriptor("trusted.jssecerts") {
- public static final InfrastructureFileDescriptor JAVA_DEPLOYMENT_PROP_FILE = new SystemJavaLibFileDescriptor(DEPLOYMENT_CONFIG_FILE, "FILEjavadp", Target.JAVAWS, Target.ITWEB_SETTINGS){
+ @Override
+ public String getFullPath() {
+ return gcpd(DeploymentConfiguration.KEY_SYSTEM_TRUSTED_JSSE_CERTS);
+ }
+
+ };
+ public static final InfrastructureFileDescriptor SYS_CLIENTCERT = new SystemJavaSecurityFileDescriptor("trusted.clientcerts") {
+
+ @Override
+ public String getFullPath() {
+ return gcpd(DeploymentConfiguration.KEY_SYSTEM_TRUSTED_CLIENT_CERTS);
+ }
+
+ };
+ public static final InfrastructureFileDescriptor JAVA_DEPLOYMENT_PROP_FILE = new SystemJavaLibFileDescriptor(DEPLOYMENT_CONFIG_FILE, "FILEjavadp", Target.JAVAWS, Target.ITWEB_SETTINGS) {
@Override
public String getDescription() {
@@ -183,7 +277,7 @@
}
}
-
+ r.add(getRecentlyUsedFile());
return r;
}
@@ -218,36 +312,74 @@
this.descriptionKey = descriptionKey;
this.target = target;
}
-
public File getFile() {
- return new File(getFullPath());
- }
-
- public String getStub() {
- return clean(pathStub + File.separator + fileName);
+ return new File(getFullPath());
}
public String getDir() {
+ return getFile().getParent();
+ }
+
+ //setupable files may override this (and maybe also getDir if needed)
+ public String getFullPath() {
+ return getDefaultFullPath();
+ }
+ //its not recommended to override default locations methods
+
+ public File getDefaultFile() {
+ return new File(getDefaultFullPath());
+ }
+
+ public String getDefaultDir() {
return clean(systemPathStub + File.separator + pathStub);
}
- public String getFullPath() {
+ public String getDefaultFullPath() {
return clean(systemPathStub + File.separator + pathStub + File.separator + fileName);
}
- public String getSystemPathStubAcronym() {
+ //returns path acronym for default location
+ protected String getSystemPathStubAcronym() {
return systemPathStub;
}
+ /**
+ * This remaining part of file declaration, when acronym is removed.
+ * See getDirViaAcronym.
+ *
+ * @return
+ */
+ private String getStub() {
+ return clean(pathStub + File.separator + fileName);
+ }
+
@Override
public String toString() {
return clean(getSystemPathStubAcronym() + File.separator + getStub());
}
More information about the distro-pkg-dev
mailing list