Package com.tagtraum.core
Interface OperatingSystemSPI
-
- All Known Implementing Classes:
OperatingSystemOSX
public interface OperatingSystemSPI
OperatingSystemSPI.- Author:
- Hendrik Schreiber
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Path
getDesktopDirectory()
User's desktop directory.OperatingSystem.ExternalApplication[]
getExternalApplications(URL url)
Lists the available applications for the given URL.String
getJavaRuntimeSupportVersion()
Version string for the JavaRuntimeSupportVersion.framework, available only on macOS.Path
getLocalApplicationSupportDirectory()
Local app data folder.String
getSystemAppearance()
Return the name of the system appearance.Path
getUsersMusicDirectory()
User's music folder.void
openWithExternalApplication(URL url, OperatingSystem.ExternalApplication externalApplication)
Opens the given URL with the given application.void
setThreadPriority(int priority)
Tries to force-set the given thread priority using native APIs.default void
showInFileBrowser(Path file)
Fallback implementation.
-
-
-
Method Detail
-
getJavaRuntimeSupportVersion
String getJavaRuntimeSupportVersion()
Version string for the JavaRuntimeSupportVersion.framework, available only on macOS.- Returns:
- version or "unknown", if not known.
-
getLocalApplicationSupportDirectory
Path getLocalApplicationSupportDirectory()
Local app data folder.~/Library/Application Support
on macOS,~\AppData\Local
on Vista,~\Local Settings\Application Data
on Windows XP.- Returns:
- local app data folder
-
getUsersMusicDirectory
Path getUsersMusicDirectory()
User's music folder.~/Music
on macOS,~\Music
on Vista/Win7,~\My Documents\My Music
on Windows XP.- Returns:
- user's music folder
-
getDesktopDirectory
Path getDesktopDirectory()
User's desktop directory.- Returns:
- desktop directory
-
openWithExternalApplication
void openWithExternalApplication(URL url, OperatingSystem.ExternalApplication externalApplication) throws IOException
Opens the given URL with the given application.- Parameters:
url
- urlexternalApplication
- application- Throws:
IOException
- if something goes wrong- See Also:
getExternalApplications(java.net.URL)
-
getExternalApplications
OperatingSystem.ExternalApplication[] getExternalApplications(URL url)
Lists the available applications for the given URL.- Parameters:
url
- url- Returns:
- list of applications - the first one should be the default application
-
setThreadPriority
void setThreadPriority(int priority)
Tries to force-set the given thread priority using native APIs.- Parameters:
priority
- priority
-
getSystemAppearance
String getSystemAppearance()
Return the name of the system appearance.- Returns:
- appearance name
-
showInFileBrowser
default void showInFileBrowser(Path file) throws IOException
Fallback implementation.- Parameters:
file
- file- Throws:
IOException
- exception
-
-