Package com.blueconic.browscap
Class UserAgentService
java.lang.Object
com.blueconic.browscap.UserAgentService
Service that manages the creation of user agent parsers. In the feature, this might be expanded so it also supports
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUserAgentService(InputStream zipFileStream) Creates a user agent service based on the Browscap CSV file in the given ZIP InputStreamUserAgentService(String zipFilePath) Creates a user agent service based on the Browscap CSV file in the given ZIP file -
Method Summary
Modifier and TypeMethodDescriptionstatic StringReturns the bundled ZIP file nameReturns a parser based on the bundled BrowsCap versionloadParser(Collection<BrowsCapField> fields) Returns a parser based on the bundled BrowsCap version
-
Field Details
-
BUNDLED_BROWSCAP_VERSION
public static final int BUNDLED_BROWSCAP_VERSION- See Also:
-
-
Constructor Details
-
UserAgentService
public UserAgentService() -
UserAgentService
Creates a user agent service based on the Browscap CSV file in the given ZIP file- Parameters:
zipFilePath- the zip file should contain the csv file. It will load the given zip file instead of the bundled one
-
UserAgentService
Creates a user agent service based on the Browscap CSV file in the given ZIP InputStream- Parameters:
zipFileStream- the zip InputStream should contain the csv file. It will load the given zip InputStream instead of the bundled zip file
-
-
Method Details
-
loadParser
Returns a parser based on the bundled BrowsCap version- Returns:
- the user agent parser
- Throws:
IOExceptionParseException
-
loadParser
public UserAgentParser loadParser(Collection<BrowsCapField> fields) throws IOException, ParseException Returns a parser based on the bundled BrowsCap version- Parameters:
fields- list- Returns:
- the user agent parser
- Throws:
IOExceptionParseException
-
getBundledCsvFileName
Returns the bundled ZIP file name- Returns:
- CSV file name
-