Random User Agent string provider for Java.
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository><dependency>
<groupId>com.github.mdebenito</groupId>
<artifactId>UserAgentProvider</artifactId>
<version>master-SNAPSHOT</version>
</dependency>| Constructor and Description |
|---|
UserAgentStringLoader()Default constructor, initializes the list and loads the strings into it from the configuration file. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String | getRandomUserAgentString()Randomly selects one of the configured User Agent strings and returns it. |
java.util.List<java.lang.String> | getUserAgentStrings()Returns the current list of User Agent strings. |
public UserAgentStringLoader() throws java.io.FileNotFoundException
Default constructor, initializes the list and loads the strings into it from the configuration file.- Throws:
java.io.FileNotFoundException
public java.util.List<java.lang.String> getUserAgentStrings()
Returns the current list of User Agent strings.- Returns:
- a List object that contains all the User Agent Strings configured.
public java.lang.String getRandomUserAgentString()
Randomly selects one of the configured User Agent strings and returns it.- Returns:
- A random User Agent string.