Mercurial > hg > release > icedtea-web-1.8
changeset 1523:77e21cdc1813
PR3645, second part - following windows system paths correctly
* netx/net/sourceforge/jnlp/config/PathsAndFiles.java: following https://docs.oracle.com/javase/7/docs/technotes/guides/jweb/jcp/properties.html (SystemCofigFileDescriptor) now honor WINDIR on windows
author | Jiri Vanek <jvanek@redhat.com> |
---|---|
date | Tue, 27 Nov 2018 16:07:20 +0100 |
parents | f211a6ffffe0 |
children | 2197d8c7c769 |
files | ChangeLog netx/net/sourceforge/jnlp/config/PathsAndFiles.java |
diffstat | 2 files changed, 26 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Tue Nov 27 13:26:48 2018 +0100 +++ b/ChangeLog Tue Nov 27 16:07:20 2018 +0100 @@ -1,3 +1,10 @@ +2018-11-27 Jiri Vanek <jvanek@redhat.com> + + PR3645, second part - following windows system paths correctly + * netx/net/sourceforge/jnlp/config/PathsAndFiles.java: following + https://docs.oracle.com/javase/7/docs/technotes/guides/jweb/jcp/properties.html + (SystemCofigFileDescriptor) now honor WINDIR on windows + 2018-11-27 Jiri Vanek <jvanek@redhat.com> Lars Herschke <lhersch@dssgmbh.de>
--- a/netx/net/sourceforge/jnlp/config/PathsAndFiles.java Tue Nov 27 13:26:48 2018 +0100 +++ b/netx/net/sourceforge/jnlp/config/PathsAndFiles.java Tue Nov 27 16:07:20 2018 +0100 @@ -62,6 +62,7 @@ public static final String XDG_CACHE_HOME_VAR = "XDG_CACHE_HOME"; public static final String XDG_RUNTIME_DIR_VAR = "XDG_RUNTIME_DIR"; private static final String XDG_DATA_HOME = "XDG_DATA_HOME"; + private static final String WINDIR = "WINDIR"; private static final String TMP_PROP = "java.io.tmpdir"; private static final String HOME_PROP = "user.home"; private static final String JAVA_PROP = "java.home"; @@ -362,8 +363,25 @@ private static class SystemCofigFileDescriptor extends InfrastructureFileDescriptor { + private static final String windowsPathSuffix = File.separator + "Sun" + File.separator + "Java"; + private static final String unixPathSuffix = File.separator + "etc" + File.separator + ".java"; + + private static String getSystemConfigDir() { + if (JNLPRuntime.isWindows()) { + return System.getenv(WINDIR) + windowsPathSuffix; + } else { + return unixPathSuffix; + } + } + + @Override + public String getSystemPathStubAcronym() { + //note the hardcoded % instead of VARIABLE (actuall leading to idea, that docs, when generated on windows may not make sense) + return "{" + "%" + WINDIR + windowsPathSuffix + " or " + unixPathSuffix + "}"; + } + private SystemCofigFileDescriptor(String fileName, String pathSub, String description, Target... target) { - super(fileName, pathSub, File.separator + "etc" + File.separator + ".java", description, target); + super(fileName, pathSub, getSystemConfigDir(), description, target); } }