public class PlatformHookWindows extends PlatformHookUnixoid implements PlatformHook
PlatformHook
implementation for Microsoft Windows systems.PlatformHookUnixoid.LinuxReleaseInfo
Modifier and Type | Field and Description |
---|---|
private static byte[] |
INSECURE_PUBLIC_KEY |
private static java.lang.String |
WINDOWS_ROOT |
Constructor and Description |
---|
PlatformHookWindows() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDefaultStyle()
Returns the default LAF to be used on this platform to look almost as a native application.
|
java.lang.String |
getOSDescription()
Returns a detailed OS description (at least family + version).
|
static java.security.KeyStore |
getRootKeystore()
Loads Windows-ROOT keystore.
|
void |
initSystemShortcuts()
The initSystemShortcuts hook will be called by the
Shortcut class after the modifier groups have been read
from the config, but before any shortcuts are read from
it or registered from within the application.
|
void |
openUrl(java.lang.String url)
The openURL hook will be used to open an URL in the
default web browser.
|
static void |
removeInsecureCertificates()
Removes potential insecure certificates installed with previous versions of JOSM on Windows.
|
boolean |
rename(java.io.File from,
java.io.File to)
Renames a file.
|
boolean |
setupHttpsCertificate(java.lang.String entryAlias,
java.security.KeyStore.TrustedCertificateEntry trustedCert)
Setup system keystore to add JOSM HTTPS certificate (for remote control).
|
askUpdateJava, askUpdateJava, buildOSDescription, canFullscreen, getJavaPackageDetails, getPackageDetails, getWebStartPackageDetails, isOpenJDK, makeTooltip, preStartupHook, startupHook
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canFullscreen, makeTooltip, preStartupHook, startupHook
private static final byte[] INSECURE_PUBLIC_KEY
private static final java.lang.String WINDOWS_ROOT
public PlatformHookWindows()
public void openUrl(java.lang.String url) throws java.io.IOException
PlatformHook
openUrl
in interface PlatformHook
openUrl
in class PlatformHookUnixoid
url
- The URL to openjava.io.IOException
- if any I/O error occurspublic void initSystemShortcuts()
PlatformHook
initSystemShortcuts
in interface PlatformHook
initSystemShortcuts
in class PlatformHookUnixoid
public java.lang.String getDefaultStyle()
PlatformHook
getDefaultStyle
in interface PlatformHook
getDefaultStyle
in class PlatformHookUnixoid
public boolean rename(java.io.File from, java.io.File to)
PlatformHook
rename
in interface PlatformHook
rename
in class PlatformHookUnixoid
from
- Source fileto
- Target filetrue
if the file has been renamed, false
otherwisepublic java.lang.String getOSDescription()
PlatformHook
getOSDescription
in interface PlatformHook
getOSDescription
in class PlatformHookUnixoid
public static java.security.KeyStore getRootKeystore() throws java.security.NoSuchAlgorithmException, java.security.cert.CertificateException, java.io.IOException, java.security.KeyStoreException
java.security.NoSuchAlgorithmException
- if the algorithm used to check the integrity of the keystore cannot be foundjava.security.cert.CertificateException
- if any of the certificates in the keystore could not be loadedjava.io.IOException
- if there is an I/O or format problem with the keystore data, if a password is required but not givenjava.security.KeyStoreException
- if no Provider supports a KeyStore implementation for the type "Windows-ROOT"public static void removeInsecureCertificates() throws java.security.NoSuchAlgorithmException, java.security.cert.CertificateException, java.security.KeyStoreException, java.io.IOException
java.security.NoSuchAlgorithmException
- on unsupported signature algorithmsjava.security.cert.CertificateException
- if any of the certificates in the Windows keystore could not be loadedjava.security.KeyStoreException
- if no Provider supports a KeyStoreSpi implementation for the type "Windows-ROOT"java.io.IOException
- if there is an I/O or format problem with the keystore data, if a password is required but not givenpublic boolean setupHttpsCertificate(java.lang.String entryAlias, java.security.KeyStore.TrustedCertificateEntry trustedCert) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.cert.CertificateException, java.io.IOException
PlatformHook
setupHttpsCertificate
in interface PlatformHook
setupHttpsCertificate
in class PlatformHookUnixoid
entryAlias
- The entry alias to usetrustedCert
- the JOSM certificate for localhosttrue
if something has changed as a result of the call (certificate installation, etc.)java.security.KeyStoreException
- in case of errorjava.security.NoSuchAlgorithmException
- in case of errorjava.security.cert.CertificateException
- in case of errorjava.io.IOException
- in case of error