public class PlatformHookWindows extends PlatformHookUnixoid implements PlatformHook
PlatformHook
implementation for Microsoft Windows systems.PlatformHookUnixoid.FontEntry, 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 |
---|---|
void |
afterPrefStartupHook()
The afterPrefStartupHook will be called early, but after
the preferences have been loaded and basic processing of
command line arguments is finished.
|
java.util.Collection<PlatformHookUnixoid.FontEntry> |
getAdditionalFonts()
Get default list of additional fonts to add to the configuration.
|
java.io.File |
getDefaultCacheDirectory()
Returns the platform-dependent default cache directory.
|
java.io.File |
getDefaultPrefDirectory()
Returns the platform-dependent default preferences directory.
|
java.lang.String |
getDefaultStyle()
Returns the default LAF to be used on this platform to look almost as a native application.
|
java.util.Collection<java.lang.String> |
getInstalledFonts()
Get a list of fonts that are installed on the system.
|
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).
|
void |
startupHook()
The startupHook will be called early, but after the GUI
setup has started.
|
askUpdateJava, askUpdateJava, buildOSDescription, canFullscreen, extendFontconfig, getDefaultUserDataDirectory, getJavaPackageDetails, getPackageDetails, getWebStartPackageDetails, isOpenJDK, makeTooltip, preStartupHook
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canFullscreen, getDefaultUserDataDirectory, makeTooltip, preStartupHook
private static final byte[] INSECURE_PUBLIC_KEY
private static final java.lang.String WINDOWS_ROOT
public PlatformHookWindows()
public void startupHook()
PlatformHook
startupHook
in interface PlatformHook
startupHook
in class PlatformHookUnixoid
public void afterPrefStartupHook()
PlatformHook
afterPrefStartupHook
in interface PlatformHook
afterPrefStartupHook
in class PlatformHookUnixoid
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 errorpublic java.io.File getDefaultCacheDirectory()
PlatformHook
getDefaultCacheDirectory
in interface PlatformHook
getDefaultCacheDirectory
in class PlatformHookUnixoid
public java.io.File getDefaultPrefDirectory()
PlatformHook
getDefaultPrefDirectory
in interface PlatformHook
getDefaultPrefDirectory
in class PlatformHookUnixoid
public java.util.Collection<java.lang.String> getInstalledFonts()
PlatformHookUnixoid
PlatformHookUnixoid.extendFontconfig(java.lang.String)
, have to set system
property first, which is then read by sun.awt.FontConfiguration upon initialization.)getInstalledFonts
in class PlatformHookUnixoid
public java.util.Collection<PlatformHookUnixoid.FontEntry> getAdditionalFonts()
PlatformHookUnixoid
getAdditionalFonts
in class PlatformHookUnixoid