-
public interface BasicServiceTheBasicServiceinterface provides access to the codebase of the application, if an application is run in offline mode, and simple interaction with the native browser on the given platform.This interface mimics loosely the
AppletContextfunctionality.- Since:
- 1.4.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description URLgetCodeBase()Returns the codebase for the application.booleanisOffline()Determines if the system is offline.booleanisWebBrowserSupported()Checks if a Web browser is supported on the current platform and by the given JNLP Client.booleanshowDocument(URL url)Directs a browser on the client to show the given URL.
-
-
-
Method Detail
-
getCodeBase
URL getCodeBase()
Returns the codebase for the application. The codebase is either specified directly in the JNLP file, or it is the location of the JAR file containing the main class of the application.- Returns:
- a URL with the codebase of the application, or null if the application is running from local file system.
-
isOffline
boolean isOffline()
Determines if the system is offline. The return value represents the JNLP client's "best guess" at the online / offline state of the client system. The return value is does not have to be guaranteed to be reliable, as it is sometimes difficult to ascertain the true online / offline state of a client system.- Returns:
trueif the system is offline, otherwisefalse
-
showDocument
boolean showDocument(URL url)
Directs a browser on the client to show the given URL. This will typically replace the page currently being viewed in a browser with the given URL, or cause a browser to be launched that will show the given URL.- Parameters:
url- an URL giving the location of the document. A relative URL will be relative to the codebase.- Returns:
trueif the request succededfalseif theurlis null or the request failed.
-
isWebBrowserSupported
boolean isWebBrowserSupported()
Checks if a Web browser is supported on the current platform and by the given JNLP Client. If this is not the case, thenwill always returnshowDocument(java.net.URL)false.- Returns:
trueif a Web browser is supported, otherwisefalse
-
-