Package com.teamdev.jxbrowser.net
Interface Network
- All Superinterfaces:
Advisable<NetworkCallback>,Observable<NetworkEvent>,ProfileService
public interface Network
extends ProfileService, Observable<NetworkEvent>, Advisable<NetworkCallback>
A service that provides access to the network-level functionality.
-
Method Summary
Modifier and TypeMethodDescriptionReturns a string that represents the Accept-Language request-header field.voidacceptLanguage(String language) Configures the accept language.Returns an HTTP authorization preferences.Returns a string that represents the default user-agent.Methods inherited from interface com.teamdev.jxbrowser.event.Observable
onMethods inherited from interface com.teamdev.jxbrowser.profile.ProfileService
profile
-
Method Details
-
httpAuthPreferences
HttpAuthPreferences httpAuthPreferences()Returns an HTTP authorization preferences. -
acceptLanguage
String acceptLanguage()Returns a string that represents the Accept-Language request-header field. This field restricts the set of natural languages that are preferred as a response to the request. For example:da, en-gb;q=0.8, en;q=0.7. The default Accept-Language isen-us.- Throws:
ObjectClosedException- when the profile is deleted or its engine is closed
-
acceptLanguage
Configures the accept language. If you do not provide an accept-Language value using this method, then a default accept language will be used. The default Accept-Language isen-us.For example,
fr, en-gb;q=0.8, en;q=0.7would mean: "I prefer French, but will accept British English and other types of English". Note, that all languages which are assigned a quality factor greater than 0 are acceptable.- Parameters:
language- a new string that represents the "Accept-Language" HTTP header value- Throws:
IllegalArgumentException- whenlanguageis empty or blankObjectClosedException- when the profile is deleted or its engine is closed
-
userAgent
String userAgent()Returns a string that represents the default user-agent.The default user-agent string can be configured through the
EngineOptions.Builder.userAgent(String)method. If the default user-agent string has not been specified, then this method returns a string obtained from the Chromium engine.- Throws:
ObjectClosedException- when the profile is deleted or its engine is closed
-