- * Note: Using {@link #setChainedProxyManager(ChainedProxyManager)} will supersede any value set by this method.
+ * Instructs this proxy to route traffic through an upstream proxy.
+ *
+ * Note: Using {@link #setChainedProxyManager(ChainedProxyManager)} will supersede any value set by this method. A chained
+ * proxy must be set before the proxy is started, though it can be changed after the proxy is started.
*
* @param chainedProxyAddress address of the upstream proxy
*/
@Override
public void setChainedProxy(InetSocketAddress chainedProxyAddress) {
+ if (isStarted() && !bootstrappedWithDefaultChainedProxy.get()) {
+ throw new IllegalStateException("Cannot set a chained proxy after the proxy is started if the proxy was started without a chained proxy.");
+ }
+
upstreamProxyAddress = chainedProxyAddress;
}
@@ -904,6 +911,8 @@ public InetSocketAddress getChainedProxy() {
* Allows access to the LittleProxy {@link ChainedProxyManager} for fine-grained control of the chained proxies. To enable a single
* chained proxy, {@link BrowserMobProxy#setChainedProxy(InetSocketAddress)} is generally more convenient.
*
+ * Note: The chained proxy manager must be enabled before calling {@link #start()}.
+ *
* @param chainedProxyManager chained proxy manager to enable
*/
public void setChainedProxyManager(ChainedProxyManager chainedProxyManager) {
@@ -944,7 +953,8 @@ public void addLastHttpFilterFactory(HttpFiltersSource filterFactory) {
*/
@Override
public void addResponseFilter(ResponseFilter filter) {
- addLastHttpFilterFactory(new ResponseFilterAdapter.FilterSource(filter));
+ filterFactories.add(new ResponseFilterAdapter.FilterSource(filter));
+// addLastHttpFilterFactory();
}
/**
diff --git a/app/src/main/java/net/lightbody/bmp/client/ClientUtil.java b/app/src/main/java/net/lightbody/bmp/client/ClientUtil.java
old mode 100644
new mode 100755
index 7c6b1b5..79372fe
--- a/app/src/main/java/net/lightbody/bmp/client/ClientUtil.java
+++ b/app/src/main/java/net/lightbody/bmp/client/ClientUtil.java
@@ -69,27 +69,27 @@ public static AdvancedHostResolver createDnsJavaWithNativeFallbackResolver() {
// public static org.openqa.selenium.Proxy createSeleniumProxy(BrowserMobProxy browserMobProxy) {
// return createSeleniumProxy(browserMobProxy, getConnectableAddress());
// }
-//
-// /**
-// * Creates a Selenium Proxy object from the BrowserMobProxy instance, using the specified connectableAddress as the Selenium Proxy object's
-// * proxy address. Determines the port using {@link net.lightbody.bmp.BrowserMobProxy#getPort()}. The BrowserMobProxy must be started.
-// *
-// * @param browserMobProxy started BrowserMobProxy instance to read the port from
-// * @param connectableAddress the network address the Selenium Proxy will use to reach this BrowserMobProxy instance
-// * @return a Selenium Proxy instance, configured to use the BrowserMobProxy instance as its proxy server
-// * @throws java.lang.IllegalStateException if the proxy has not been started.
-// */
+
+ /**
+ * Creates a Selenium Proxy object from the BrowserMobProxy instance, using the specified connectableAddress as the Selenium Proxy object's
+ * proxy address. Determines the port using {@link net.lightbody.bmp.BrowserMobProxy#getPort()}. The BrowserMobProxy must be started.
+ *
+ * @param browserMobProxy started BrowserMobProxy instance to read the port from
+ * @param connectableAddress the network address the Selenium Proxy will use to reach this BrowserMobProxy instance
+ * @return a Selenium Proxy instance, configured to use the BrowserMobProxy instance as its proxy server
+ * @throws java.lang.IllegalStateException if the proxy has not been started.
+ */
// public static org.openqa.selenium.Proxy createSeleniumProxy(BrowserMobProxy browserMobProxy, InetAddress connectableAddress) {
// return createSeleniumProxy(new InetSocketAddress(connectableAddress, browserMobProxy.getPort()));
// }
-//
-// /**
-// * Creates a Selenium Proxy object using the specified connectableAddressAndPort as the HTTP proxy server.
-// *
-// * @param connectableAddressAndPort the network address (or hostname) and port the Selenium Proxy will use to reach its
-// * proxy server (the InetSocketAddress may be unresolved).
-// * @return a Selenium Proxy instance, configured to use the specified address and port as its proxy server
-// */
+
+ /**
+ * Creates a Selenium Proxy object using the specified connectableAddressAndPort as the HTTP proxy server.
+ *
+ * @param connectableAddressAndPort the network address (or hostname) and port the Selenium Proxy will use to reach its
+ * proxy server (the InetSocketAddress may be unresolved).
+ * @return a Selenium Proxy instance, configured to use the specified address and port as its proxy server
+ */
// public static org.openqa.selenium.Proxy createSeleniumProxy(InetSocketAddress connectableAddressAndPort) {
// Proxy proxy = new Proxy();
// proxy.setProxyType(Proxy.ProxyType.MANUAL);
diff --git a/app/src/main/java/net/lightbody/bmp/core/har/Har.java b/app/src/main/java/net/lightbody/bmp/core/har/Har.java
old mode 100644
new mode 100755
diff --git a/app/src/main/java/net/lightbody/bmp/core/har/HarCache.java b/app/src/main/java/net/lightbody/bmp/core/har/HarCache.java
old mode 100644
new mode 100755
diff --git a/app/src/main/java/net/lightbody/bmp/core/har/HarCacheStatus.java b/app/src/main/java/net/lightbody/bmp/core/har/HarCacheStatus.java
old mode 100644
new mode 100755
index 427641b..36736fa
--- a/app/src/main/java/net/lightbody/bmp/core/har/HarCacheStatus.java
+++ b/app/src/main/java/net/lightbody/bmp/core/har/HarCacheStatus.java
@@ -1,8 +1,10 @@
package net.lightbody.bmp.core.har;
+import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import net.lightbody.bmp.core.json.ISO8601DateFormatter;
+
+import net.lightbody.bmp.core.json.ISO8601WithTDZDateFormatter;
import java.util.Date;
@@ -14,7 +16,7 @@ public class HarCacheStatus {
private volatile int hitCount;
private volatile String comment = "";
- @JsonSerialize(using = ISO8601DateFormatter.class)
+ @JsonSerialize(using = ISO8601WithTDZDateFormatter.class)
public Date getExpires() {
return expires;
}
@@ -23,7 +25,7 @@ public void setExpires(Date expires) {
this.expires = expires;
}
- @JsonSerialize(using = ISO8601DateFormatter.class)
+ @JsonSerialize(using = ISO8601WithTDZDateFormatter.class)
public Date getLastAccess() {
return lastAccess;
}
diff --git a/app/src/main/java/net/lightbody/bmp/core/har/HarContent.java b/app/src/main/java/net/lightbody/bmp/core/har/HarContent.java
old mode 100644
new mode 100755
diff --git a/app/src/main/java/net/lightbody/bmp/core/har/HarCookie.java b/app/src/main/java/net/lightbody/bmp/core/har/HarCookie.java
old mode 100644
new mode 100755
index 643feb1..31bc961
--- a/app/src/main/java/net/lightbody/bmp/core/har/HarCookie.java
+++ b/app/src/main/java/net/lightbody/bmp/core/har/HarCookie.java
@@ -1,12 +1,14 @@
package net.lightbody.bmp.core.har;
-import java.net.URLDecoder;
-import java.util.Date;
-
+import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+
import net.lightbody.bmp.core.json.ISO8601WithTDZDateFormatter;
+import java.net.URLDecoder;
+import java.util.Date;
+
@JsonInclude(JsonInclude.Include.NON_NULL)
public class HarCookie {
private volatile String name;
diff --git a/app/src/main/java/net/lightbody/bmp/core/har/HarEntry.java b/app/src/main/java/net/lightbody/bmp/core/har/HarEntry.java
old mode 100644
new mode 100755
index c091303..39339f2
--- a/app/src/main/java/net/lightbody/bmp/core/har/HarEntry.java
+++ b/app/src/main/java/net/lightbody/bmp/core/har/HarEntry.java
@@ -1,13 +1,13 @@
package net.lightbody.bmp.core.har;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+
import net.lightbody.bmp.core.json.ISO8601WithTDZDateFormatter;
import java.util.Date;
-import java.util.HashSet;
-import java.util.Set;
import java.util.concurrent.TimeUnit;
@JsonInclude(JsonInclude.Include.NON_NULL)
diff --git a/app/src/main/java/net/lightbody/bmp/core/har/HarLog.java b/app/src/main/java/net/lightbody/bmp/core/har/HarLog.java
old mode 100644
new mode 100755
index 2135bcc..dc765ca
--- a/app/src/main/java/net/lightbody/bmp/core/har/HarLog.java
+++ b/app/src/main/java/net/lightbody/bmp/core/har/HarLog.java
@@ -11,17 +11,10 @@
import java.util.Locale;
import java.util.concurrent.CopyOnWriteArrayList;
-/**
- * Modify by xuzhou on 2016/9/2.
- * 添加了删除page的功能
- * 添加了clearAllEntries
- * 1000请求自动分页
- */
-
@JsonInclude(JsonInclude.Include.NON_NULL)
public class HarLog {
private final String version = "1.2";
- private volatile HarNameVersion creator = new HarNameVersion("BrowserMob Proxy", BrowserMobProxyUtil.getVersionString());
+ private volatile HarNameVersion creator = new HarNameVersion("BrowserMob Proxy", BrowserMobProxyUtil.getVersionString());
private volatile HarNameVersion browser;
private List
- * Attention: This is only intended to build one instance at runtime to represent value behind the constant
- * {@link #EMPTY}.
- */
- private DeviceCategory() {
- category = Category.UNKNOWN;
- icon = "";
- infoUrl = "";
- name = "";
- hash = buildHashCode(category, icon, infoUrl, name);
- }
-
- public DeviceCategory(@Nonnull final Category category, @Nonnull final String icon, @Nonnull final String infoUrl,
- @Nonnull final String name) {
- this.category = Check.notNull(category, "category");
- this.icon = Check.notNull(icon, "icon");
- this.infoUrl = Check.notNull(infoUrl, "infoUrl");
- this.name = Check.notEmpty(name, "name");
- hash = buildHashCode(category, icon, infoUrl, name);
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final DeviceCategory other = (DeviceCategory) obj;
- if (!category.equals(other.category)) {
- return false;
- }
- if (!icon.equals(other.icon)) {
- return false;
- }
- if (!infoUrl.equals(other.infoUrl)) {
- return false;
- }
- if (!name.equals(other.name)) {
- return false;
- }
- return true;
- }
-
- @Override
- @Nonnull
- public Category getCategory() {
- return category;
- }
-
- @Override
- @Nonnull
- public String getIcon() {
- return icon;
- }
-
- @Override
- @Nonnull
- public String getInfoUrl() {
- return infoUrl;
- }
-
- @Override
- @Nonnull
- public String getName() {
- return name;
- }
-
- @Override
- public int hashCode() {
- return hash;
- }
-
- @Override
- public String toString() {
- return "DeviceCategory [category=" + category + ", icon=" + icon + ", infoUrl=" + infoUrl + ", name=" + name + "]";
- }
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/OperatingSystem.java b/app/src/main/java/net/sf/uadetector/OperatingSystem.java
deleted file mode 100644
index ece215c..0000000
--- a/app/src/main/java/net/sf/uadetector/OperatingSystem.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright 2012 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector;
-
-import java.io.Serializable;
-
-import javax.annotation.Nonnull;
-
-import net.sf.qualitycheck.Check;
-
-/**
- * {@code OperatingSystem} is an immutable entity that represents the informations about an operating system like Linux,
- * Mac OS X or Windows.
- *
- * @author André Rouél
- */
-public final class OperatingSystem implements ReadableOperatingSystem, Serializable {
-
- public static final OperatingSystem EMPTY = new OperatingSystem(OperatingSystemFamily.UNKNOWN, "unknown", "unknown.png", "unknown", "",
- "", "", VersionNumber.UNKNOWN);
-
- /**
- * Serialization version
- */
- private static final long serialVersionUID = 1L;
-
- @Nonnull
- private final OperatingSystemFamily family;
-
- @Nonnull
- private final String familyName;
-
- @Nonnull
- private final String icon;
-
- @Nonnull
- private final String name;
-
- @Nonnull
- private final String producer;
-
- @Nonnull
- private final String producerUrl;
-
- @Nonnull
- private final String url;
-
- @Nonnull
- private final VersionNumber versionNumber;
-
- public OperatingSystem(@Nonnull final OperatingSystemFamily family, @Nonnull final String familyName, @Nonnull final String icon,
- @Nonnull final String name, @Nonnull final String producer, @Nonnull final String producerUrl, @Nonnull final String url,
- @Nonnull final VersionNumber versionNumber) {
- Check.notNull(family, "family");
- Check.notNull(familyName, "familyName");
- Check.notNull(icon, "icon");
- Check.notNull(name, "name");
- Check.notNull(producer, "producer");
- Check.notNull(producerUrl, "producerUrl");
- Check.notNull(url, "url");
- Check.notNull(versionNumber, "versionNumber");
-
- this.family = family;
- this.familyName = familyName;
- this.icon = icon;
- this.name = name;
- this.producer = producer;
- this.producerUrl = producerUrl;
- this.url = url;
- this.versionNumber = versionNumber;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final OperatingSystem other = (OperatingSystem) obj;
- if (family != other.family) {
- return false;
- }
- if (!familyName.equals(other.familyName)) {
- return false;
- }
- if (!icon.equals(other.icon)) {
- return false;
- }
- if (!name.equals(other.name)) {
- return false;
- }
- if (!producer.equals(other.producer)) {
- return false;
- }
- if (!producerUrl.equals(other.producerUrl)) {
- return false;
- }
- if (!url.equals(other.url)) {
- return false;
- }
- if (!versionNumber.equals(other.versionNumber)) {
- return false;
- }
- return true;
- }
-
- @Override
- public OperatingSystemFamily getFamily() {
- return family;
- }
-
- @Override
- public String getFamilyName() {
- return familyName;
- }
-
- @Override
- public String getIcon() {
- return icon;
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public String getProducer() {
- return producer;
- }
-
- @Override
- public String getProducerUrl() {
- return producerUrl;
- }
-
- @Override
- public String getUrl() {
- return url;
- }
-
- @Override
- public VersionNumber getVersionNumber() {
- return versionNumber;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + family.hashCode();
- result = prime * result + familyName.hashCode();
- result = prime * result + icon.hashCode();
- result = prime * result + name.hashCode();
- result = prime * result + producer.hashCode();
- result = prime * result + producerUrl.hashCode();
- result = prime * result + url.hashCode();
- result = prime * result + versionNumber.hashCode();
- return result;
- }
-
- @Override
- public String toString() {
- final StringBuilder builder = new StringBuilder();
- builder.append("OperatingSystem [family=");
- builder.append(family);
- builder.append(", familyName=");
- builder.append(familyName);
- builder.append(", icon=");
- builder.append(icon);
- builder.append(", name=");
- builder.append(name);
- builder.append(", producer=");
- builder.append(producer);
- builder.append(", producerUrl=");
- builder.append(producerUrl);
- builder.append(", url=");
- builder.append(url);
- builder.append(", versionNumber=");
- builder.append(versionNumber);
- builder.append("]");
- return builder.toString();
- }
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/OperatingSystemFamily.java b/app/src/main/java/net/sf/uadetector/OperatingSystemFamily.java
deleted file mode 100644
index a755390..0000000
--- a/app/src/main/java/net/sf/uadetector/OperatingSystemFamily.java
+++ /dev/null
@@ -1,394 +0,0 @@
-/*******************************************************************************
- * Copyright 2012 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.annotation.Nonnull;
-
-import net.sf.qualitycheck.Check;
-
-/**
- * This enum represents the more commonly used operating system families. It will never be complete, but can assist in
- * identifying the version of an operating system.
- *
- * @author André Rouél
- */
-public enum OperatingSystemFamily {
-
- /**
- * AIX (Advanced Interactive eXecutive) is a Unix operating system from IBM.
- */
- AIX("AIX", Pattern.compile("AIX")),
-
- /**
- * AROS is a free operating system aiming at being compatible with AmigaOS at the API level.
- */
- AROS("AROS", Pattern.compile("AROS")),
-
- /**
- * AmigaOS is the native operating system for the Commodore Amiga, consisting of the components of Workbench,
- * AmigaDOS with the command line interpreter CLI (later renamed to shell) and for many Amiga models in the ROM
- * included kernel kickstart.
- */
- AMIGA_OS("Amiga OS", Pattern.compile("Amiga OS")),
-
- /**
- * Android is both an operating system and a software platform for mobile devices like smart phones, mobile phones,
- * netbooks and tablets, which is developed by the Open Handset Alliance.
- */
- ANDROID("Android", Pattern.compile("Android")),
-
- /**
- * The Berkeley Software Distribution (BSD) is a version of the Unix operating system, which was created at the
- * University of California at Berkeley in 1977.
- */
- BSD("BSD", Pattern.compile("BSD")),
-
- /**
- * Bada is a service-oriented operating system that is developed by Samsung Electronics and is designed for use in
- * smartphones.
- */
- BADA("Bada", Pattern.compile("Bada")),
-
- /**
- * Be Operating System (BeOS) was an operating system of the company Be Incorporated and was called in later
- * versions Be. Due to its multimedia capabilities it is also commonly called "Media OS".
- */
- BEOS("BeOS", Pattern.compile("BeOS")),
-
- /**
- * Chrome OS is an operating system based on the Linux kernel and designed by Google to work with web applications and installed applications.
- */
- CHROME_OS("Chrome OS", Pattern.compile("Chome OS")),
-
- /**
- * Danger OS is a smartphone operating system. It is used on Sidekick devices, which are sold in Germany by
- * T-Mobile.
- */
- DANGEROS("DangerOS", Pattern.compile("DangerOS")),
-
- /**
- * Firefox OS is an open source operating system for smartphones and tablet computers being developed by Mozilla.
- */
- FIREFOX_OS("Firefox OS", Pattern.compile("Firefox OS")),
-
- /**
- * HP-UX (Hewlett Packard UniX) is a commercial Unix operating system from Hewlett-Packard and is based on UNIX
- * System V.
- */
- HPUX("HP-UX", Pattern.compile("HP-UX")),
-
- /**
- * Haiku (formerly OpenBeOS) is an open-source project with the aim, to reprogram and expand that in 2001 abandoned
- * operating system BeOS.
- */
- HAIKU("Haiku OS", Pattern.compile("Haiku OS")),
-
- /**
- * IRIX is a commercial Unix operating system of the company Silicon Graphics (SGI).
- */
- IRIX("IRIX", Pattern.compile("IRIX")),
-
- /**
- * Inferno is a distributed computer operating system that comes from Bell Laboratories.
- */
- INFERNO_OS("Inferno OS", Pattern.compile("Inferno OS")),
-
- /**
- * The Java Virtual Machine (abbreviated Java VM or JVM) is the part of the Java Runtime Environment (JRE) for Java
- * programs, which is responsible for the execution of Java bytecode.
- * A device category is a group that is often determined by considering various aspects such as form factor,
- * functionality and its application. Common to all devices within a group is that they have at least one specific user
- * agent.
- *
- * The implementation of this interface may be mutable or immutable. This interface only gives access to retrieve data,
- * never to change it.
- *
- * @author André Rouél
- */
-public interface ReadableDeviceCategory {
-
- /**
- * Gets the enum value of a category.
- *
- * It provides all known device categories at the time of implementing this and makes it easier and type-safe to
- * query for a specific one rather the comparing the name.
- *
- * @return enum value of a category
- */
- @Nonnull
- Category getCategory();
-
- /**
- * Gets the icon of the category.
- *
- * @return icon of the category
- */
- @Nonnull
- String getIcon();
-
- /**
- * Returns the URL to get more informations behind a category.
- *
- * @return information URL
- */
- @Nonnull
- String getInfoUrl();
-
- /**
- * Gets the category name.
- *
- * @return name of the category
- */
- @Nonnull
- String getName();
-
- /**
- * Contains all at the time of implementation known device categories, so that a caller can easily and type-safe
- * test against them.
- */
- enum Category {
-
- /**
- * A game console is an interactive computer that produces a video display signal which can be used with a
- * display device (a television, monitor, etc.) to display a video game. The term "game console" is used to
- * distinguish a machine designed for people to buy and use primarily for playing video games on a TV in
- * contrast to arcade machines, handheld game consoles, or home computers.
- */
- GAME_CONSOLE("Game console"),
-
- /**
- * A device that doesn't match the other categories
- */
- OTHER("Other"),
-
- /**
- * A personal digital assistant (PDA), also known as a palmtop computer, or personal data assistant, is a mobile
- * device that functions as a personal information manager. PDAs are largely considered obsolete with the
- * widespread adoption of smartphones.
- */
- PDA("PDA"),
-
- /**
- * A personal computer (PC) is a general-purpose computer, whose size, capabilities, and original sale price
- * makes it useful for individuals, and which is intended to be operated directly by an end-user with no
- * intervening computer operator.
- */
- PERSONAL_COMPUTER("Personal computer"),
-
- /**
- * A smart TV, sometimes referred to as connected TV or hybrid TV
- */
- SMART_TV("Smart TV"),
-
- /**
- * A smartphone is a mobile phone built on a mobile operating system, with more advanced computing capability
- * and connectivity than a feature phone
- */
- SMARTPHONE("Smartphone"),
-
- /**
- * A tablet computer, or simply tablet, is a mobile computer with display, circuitry and battery in a single
- * unit. Tablets are often equipped with sensors, including cameras, microphone, accelerometer and touchscreen,
- * with finger or stylus gestures replacing computer mouse and keyboard.
- */
- TABLET("Tablet"),
-
- /**
- * An unknown device category
- */
- UNKNOWN(""),
-
- /**
- * Wearable computers, also known as body-borne computers are miniature electronic devices that are worn by the
- * bearer under, with or on top of clothing.
- */
- WEARABLE_COMPUTER("Wearable computer");
-
- /**
- * Tries to find by the given category name a matching enum value. The category name must match against an
- * device entry in the UAS data.
- *
- * @param categoryName
- * name of an device category
- * @return the matching enum value or {@link #UNKNOWN}
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if the given argument is {@code null}
- */
- public static Category evaluate(@Nonnull final String categoryName) {
- Check.notNull(categoryName, "categoryName");
-
- Category result = UNKNOWN;
- for (final Category value : values()) {
- if (value.getName().equals(categoryName)) {
- result = value;
- break;
- }
- }
- return result;
- }
-
- /**
- * Name of the device category
- */
- @Nonnull
- private final String name;
-
- private Category(@Nonnull final String name) {
- this.name = name;
- }
-
- /**
- * Returns the name of the device category.
- *
- * @return name of the category
- */
- @Nonnull
- public String getName() {
- return name;
- }
-
- }
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/ReadableOperatingSystem.java b/app/src/main/java/net/sf/uadetector/ReadableOperatingSystem.java
deleted file mode 100644
index 038b5b1..0000000
--- a/app/src/main/java/net/sf/uadetector/ReadableOperatingSystem.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright 2012 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector;
-
-import javax.annotation.Nonnull;
-
-/**
- * Defines an operating system.
- * Attention: This is not a known User-Agent family, but only a placeholder.
- */
- UNKNOWN("unknown", Pattern.compile("^$")),
-
- /**
- * 192.comAgent
- */
- _192_COMAGENT("192.comAgent", Pattern.compile("192.comAgent")),
-
- /**
- * 2Bone LinkChecker
- */
- _2BONE_LINKCHECKER("2Bone LinkChecker", Pattern.compile("2Bone LinkChecker")),
-
- /**
- * 50.nu
- */
- _50_NU("50.nu", Pattern.compile("50.nu")),
-
- /**
- * 80legs
- */
- _80LEGS("80legs", Pattern.compile("80legs")),
-
- /**
- * A1 Sitemap Generator
- */
- A1_SITEMAP_GENERATOR("A1 Sitemap Generator", Pattern.compile("A1 Sitemap Generator")),
-
- /**
- * AB (Apache Bench)
- */
- AB_APACHE_BENCH("AB (Apache Bench)", Pattern.compile("AB \\(Apache Bench\\)")),
-
- /**
- * abby
- */
- ABBY("abby", Pattern.compile("abby")),
-
- /**
- * Abilon
- */
- ABILON("Abilon", Pattern.compile("Abilon")),
-
- /**
- * Abolimba
- */
- ABOLIMBA("Abolimba", Pattern.compile("Abolimba")),
-
- /**
- * Aboundexbot
- */
- ABOUNDEXBOT("Aboundexbot", Pattern.compile("Aboundexbot")),
-
- /**
- * AboutUsBot
- */
- ABOUTUSBOT("AboutUsBot", Pattern.compile("AboutUsBot")),
-
- /**
- * Abrave Spider
- */
- ABRAVE_SPIDER("Abrave Spider", Pattern.compile("Abrave Spider")),
-
- /**
- * ABrowse
- */
- ABROWSE("ABrowse", Pattern.compile("ABrowse")),
-
- /**
- * Accelobot
- */
- ACCELOBOT("Accelobot", Pattern.compile("Accelobot")),
-
- /**
- * Accoona-AI-Agent
- */
- ACCOONA_AI_AGENT("Accoona-AI-Agent", Pattern.compile("Accoona-AI-Agent")),
-
- /**
- * Acoo Browser
- */
- ACOO_BROWSER("Acoo Browser", Pattern.compile("Acoo Browser")),
-
- /**
- * AcoonBot
- */
- ACOONBOT("AcoonBot", Pattern.compile("AcoonBot")),
-
- /**
- * Acorn
- */
- ACORN("Acorn", Pattern.compile("Acorn")),
-
- /**
- * ActiveXperts Network Monitor
- */
- ACTIVEXPERTS_NETWORK_MONITOR("ActiveXperts Network Monitor", Pattern.compile("ActiveXperts Network Monitor")),
-
- /**
- * AddThis.com
- */
- ADDTHIS_COM("AddThis.com", Pattern.compile("AddThis.com")),
-
- /**
- * Adobe AIR runtime
- */
- ADOBE_AIR_RUNTIME("Adobe AIR runtime", Pattern.compile("Adobe AIR runtime")),
-
- /**
- * adressendeutschland.de
- */
- ADRESSENDEUTSCHLAND_DE("adressendeutschland.de", Pattern.compile("adressendeutschland.de")),
-
- /**
- * AdsBot-Google
- */
- ADSBOT_GOOGLE("AdsBot-Google", Pattern.compile("AdsBot-Google")),
-
- /**
- * AhrefsBot
- */
- AHREFSBOT("AhrefsBot", Pattern.compile("AhrefsBot")),
-
- /**
- * aiHitBot
- */
- AIHITBOT("aiHitBot", Pattern.compile("aiHitBot")),
-
- /**
- * aippie
- */
- AIPPIE("aippie", Pattern.compile("aippie")),
-
- /**
- * AirMail
- */
- AIRMAIL("AirMail", Pattern.compile("AirMail")),
-
- /**
- * Akregator
- */
- AKREGATOR("Akregator", Pattern.compile("Akregator")),
-
- /**
- * akula
- */
- AKULA("akula", Pattern.compile("akula")),
-
- /**
- * Alienforce
- */
- ALIENFORCE("Alienforce", Pattern.compile("Alienforce")),
-
- /**
- * Almaden
- */
- ALMADEN("Almaden", Pattern.compile("Almaden")),
-
- /**
- * Amagit.COM
- */
- AMAGIT_COM("Amagit.COM", Pattern.compile("Amagit.COM")),
-
- /**
- * Amaya
- */
- AMAYA("Amaya", Pattern.compile("Amaya")),
-
- /**
- * Amazon Silk
- */
- AMAZON_SILK("Amazon Silk", Pattern.compile("(Amazon Silk|Mobile Silk)")),
-
- /**
- * Amfibibot
- */
- AMFIBIBOT("Amfibibot", Pattern.compile("Amfibibot")),
-
- /**
- * amibot
- */
- AMIBOT("amibot", Pattern.compile("amibot")),
-
- /**
- * Amiga Aweb
- */
- AMIGA_AWEB("Amiga Aweb", Pattern.compile("Amiga Aweb")),
-
- /**
- * Amiga Voyager
- */
- AMIGA_VOYAGER("Amiga Voyager", Pattern.compile("Amiga Voyager")),
-
- /**
- * Android Browser
- */
- ANDROID_BROWSER("Android Browser", Pattern.compile("(Android Browser|Android Webkit)", Pattern.CASE_INSENSITIVE)),
-
- /**
- * Anemone
- */
- ANEMONE("Anemone", Pattern.compile("Anemone")),
-
- /**
- * Anonymouse.org
- */
- ANONYMOUSE_ORG("Anonymouse.org", Pattern.compile("Anonymouse.org")),
-
- /**
- * AntBot
- */
- ANTBOT("AntBot", Pattern.compile("AntBot")),
-
- /**
- * anw HTMLChecker
- */
- ANW_HTMLCHECKER("anw HTMLChecker", Pattern.compile("anw HTMLChecker")),
-
- /**
- * anw LoadControl
- */
- ANW_LOADCONTROL("anw LoadControl", Pattern.compile("anw LoadControl")),
-
- /**
- * AOL Explorer
- */
- AOL_EXPLORER("AOL Explorer", Pattern.compile("AOL Explorer")),
-
- /**
- * Apache internal dummy connection
- */
- APACHE_INTERNAL_DUMMY_CONNECTION("Apache internal dummy connection", Pattern.compile("Apache internal dummy connection")),
-
- /**
- * Apache Synapse
- */
- APACHE_SYNAPSE("Apache Synapse", Pattern.compile("Apache Synapse")),
-
- /**
- * Apercite
- */
- APERCITE("Apercite", Pattern.compile("Apercite")),
-
- /**
- * AportWorm
- */
- APORTWORM("AportWorm", Pattern.compile("AportWorm")),
-
- /**
- * Apple-PubSub
- */
- APPLE_MAIL("Apple Mail", Pattern.compile("Apple Mail")),
-
- /**
- * Apple-PubSub
- */
- APPLE_PUBSUB("Apple-PubSub", Pattern.compile("Apple-PubSub")),
-
- /**
- * arachnode.net
- */
- ARACHNODE_NET("arachnode.net", Pattern.compile("arachnode.net")),
-
- /**
- * archive.org_bot
- */
- ARCHIVE_ORG_BOT("archive.org_bot", Pattern.compile("archive.org_bot")),
-
- /**
- * Arora
- */
- ARORA("Arora", Pattern.compile("Arora")),
-
- /**
- * ASAHA Search Engine Turkey
- */
- ASAHA_SEARCH_ENGINE_TURKEY("ASAHA Search Engine Turkey", Pattern.compile("ASAHA Search Engine Turkey")),
-
- /**
- * Ask Jeeves/Teoma
- */
- ASK_JEEVES_TEOMA("Ask Jeeves/Teoma", Pattern.compile("Ask Jeeves/Teoma")),
-
- /**
- * Atomic Email Hunter
- */
- ATOMIC_EMAIL_HUNTER("Atomic Email Hunter", Pattern.compile("Atomic Email Hunter")),
-
- /**
- * Atomic Web Browser
- */
- ATOMIC_WEB_BROWSER("Atomic Web Browser", Pattern.compile("Atomic Web Browser")),
-
- /**
- * Avant Browser
- */
- AVANT_BROWSER("Avant Browser", Pattern.compile("Avant Browser")),
-
- /**
- * AvantGo
- */
- AVANTGO("AvantGo", Pattern.compile("AvantGo")),
-
- /**
- * Awasu
- */
- AWASU("Awasu", Pattern.compile("Awasu")),
-
- /**
- * Axel
- */
- AXEL("Axel", Pattern.compile("Axel")),
-
- /**
- * BabalooSpider
- */
- BABALOOSPIDER("BabalooSpider", Pattern.compile("BabalooSpider")),
-
- /**
- * BacklinkCrawler
- */
- BACKLINKCRAWLER("BacklinkCrawler", Pattern.compile("BacklinkCrawler")),
-
- /**
- * Bad-Neighborhood
- */
- BAD_NEIGHBORHOOD("Bad-Neighborhood", Pattern.compile("Bad-Neighborhood")),
-
- /**
- * Baidu Browser
- */
- BAIDU_BROWSER("Baidu Browser", Pattern.compile("Baidu Browser")),
-
- /**
- * Baiduspider
- */
- BAIDUSPIDER("Baiduspider", Pattern.compile("Baiduspider")),
-
- /**
- * Banshee
- */
- BANSHEE("Banshee", Pattern.compile("Banshee")),
-
- /**
- * Barca
- */
- BARCA("Barca", Pattern.compile("Barca")),
-
- /**
- * baypup
- */
- BAYPUP("baypup", Pattern.compile("baypup")),
-
- /**
- * BDFetch
- */
- BDFETCH("BDFetch", Pattern.compile("BDFetch")),
-
- /**
- * Beamrise
- */
- BEAMRISE("Beamrise", Pattern.compile("Beamrise")),
-
- /**
- * BecomeBot
- */
- BECOMEBOT("BecomeBot", Pattern.compile("BecomeBot")),
-
- /**
- * Beonex
- */
- BEONEX("Beonex", Pattern.compile("Beonex")),
-
- /**
- * Bigsearch.ca
- */
- BIGSEARCH_CA("Bigsearch.ca", Pattern.compile("Bigsearch.ca")),
-
- /**
- * bingbot
- */
- BINGBOT("bingbot", Pattern.compile("bingbot")),
-
- /**
- * BinGet
- */
- BINGET("BinGet", Pattern.compile("BinGet")),
-
- /**
- * bitlybot
- */
- BITLYBOT("bitlybot", Pattern.compile("bitlybot")),
-
- /**
- * biwec
- */
- BIWEC("biwec", Pattern.compile("biwec")),
-
- /**
- * bixo
- */
- BIXO("bixo", Pattern.compile("bixo")),
-
- /**
- * bixolabs
- */
- BIXOLABS("bixocrawler", Pattern.compile("(bixocrawler|bixolabs)")),
-
- /**
- * BlackBerry Browser
- */
- BLACKBERRY_BROWSER("BlackBerry Browser", Pattern.compile("BlackBerry Browser")),
-
- /**
- * Blackbird
- */
- BLACKBIRD("Blackbird", Pattern.compile("Blackbird")),
-
- /**
- * BlackHawk
- */
- BLACKHAWK("BlackHawk", Pattern.compile("BlackHawk")),
-
- /**
- * Blaiz-Bee
- */
- BLAIZ_BEE("Blaiz-Bee", Pattern.compile("Blaiz-Bee")),
-
- /**
- * Blazer
- */
- BLAZER("Blazer", Pattern.compile("Blazer")),
-
- /**
- * Blekkobot
- */
- BLEKKOBOT("Blekkobot", Pattern.compile("Blekkobot")),
-
- /**
- * BlinkaCrawler
- */
- BLINKACRAWLER("BlinkaCrawler", Pattern.compile("BlinkaCrawler")),
-
- /**
- * BlogBridge
- */
- BLOGBRIDGE("BlogBridge", Pattern.compile("BlogBridge")),
-
- /**
- * Bloggsi
- */
- BLOGGSI("Bloggsi", Pattern.compile("Bloggsi")),
-
- /**
- * Bloglines
- */
- BLOGLINES("Bloglines", Pattern.compile("Bloglines")),
-
- /**
- * BlogPulse
- */
- BLOGPULSE("BlogPulse", Pattern.compile("BlogPulse")),
-
- /**
- * bnf.fr_bot
- */
- BNF_FR_BOT("bnf.fr_bot", Pattern.compile("bnf.fr_bot")),
-
- /**
- * boitho.com-dc
- */
- BOITHO_COM_DC("boitho.com-dc", Pattern.compile("boitho.com-dc")),
-
- /**
- * Bolt
- */
- BOLT("Bolt", Pattern.compile("Bolt")),
-
- /**
- * Bookdog
- */
- BOOKDOG("Bookdog", Pattern.compile("Bookdog")),
-
- /**
- * BookmarkTracker
- */
- BOOKMARKTRACKER("BookmarkTracker", Pattern.compile("BookmarkTracker")),
-
- /**
- * bot-pge.chlooe.com
- */
- BOT_PGE_CHLOOE_COM("bot-pge.chlooe.com", Pattern.compile("bot-pge.chlooe.com")),
-
- /**
- * botmobi
- */
- BOTMOBI("botmobi", Pattern.compile("botmobi")),
-
- /**
- * BotOnParade
- */
- BOTONPARADE("BotOnParade", Pattern.compile("BotOnParade")),
-
- /**
- * Boxxe
- */
- BOXXE("Boxxe", Pattern.compile("Boxxe")),
-
- /**
- * BrownRecluse
- */
- BROWNRECLUSE("BrownRecluse", Pattern.compile("BrownRecluse")),
-
- /**
- * Browsershots
- */
- BROWSERSHOTS("Browsershots", Pattern.compile("Browsershots")),
-
- /**
- * BrowseX
- */
- BROWSEX("BrowseX", Pattern.compile("BrowseX")),
-
- /**
- * Browzar
- */
- BROWZAR("Browzar", Pattern.compile("Browzar")),
-
- /**
- * btbot
- */
- BTBOT("btbot", Pattern.compile("btbot")),
-
- /**
- * Bunjalloo
- */
- BUNJALLOO("Bunjalloo", Pattern.compile("Bunjalloo")),
-
- /**
- * Butterfly
- */
- BUTTERFLY("Butterfly", Pattern.compile("Butterfly")),
-
- /**
- * BuzzRankingBot
- */
- BUZZRANKINGBOT("BuzzRankingBot", Pattern.compile("BuzzRankingBot")),
-
- /**
- * Camino
- */
- CAMINO("Camino", Pattern.compile("Camino")),
-
- /**
- * CamontSpider
- */
- CAMONTSPIDER("CamontSpider", Pattern.compile("CamontSpider")),
-
- /**
- * CareerBot
- */
- CAREERBOT("CareerBot", Pattern.compile("CareerBot")),
-
- /**
- * ^Nail
- */
- CARET_NAIL("^Nail", Pattern.compile("^Nail")),
-
- /**
- * Castabot
- */
- CASTABOT("Castabot", Pattern.compile("Castabot")),
-
- /**
- * CatchBot
- */
- CATCHBOT("CatchBot", Pattern.compile("CatchBot")),
-
- /**
- * CazoodleBot
- */
- CAZOODLEBOT("CazoodleBot", Pattern.compile("CazoodleBot")),
-
- /**
- * CCBot
- */
- CCBOT("CCBot", Pattern.compile("CCBot")),
-
- /**
- * ccubee
- */
- CCUBEE("ccubee", Pattern.compile("ccubee")),
-
- /**
- * ChangeDetection
- */
- CHANGEDETECTION("ChangeDetection", Pattern.compile("ChangeDetection(/\\d+(\\.\\d+)*)?", Pattern.CASE_INSENSITIVE)),
-
- /**
- * Charlotte
- */
- CHARLOTTE("Charlotte", Pattern.compile("Charlotte")),
-
- /**
- * Charon
- */
- CHARON("Charon", Pattern.compile("Charon")),
-
- /**
- * Checkbot
- */
- CHECKBOT("Checkbot", Pattern.compile("Checkbot")),
-
- /**
- * Cheshire
- */
- CHESHIRE("Cheshire", Pattern.compile("Cheshire")),
-
- /**
- * Chilkat HTTP .NET
- */
- CHILKAT_HTTP_NET("Chilkat HTTP .NET", Pattern.compile("Chilkat HTTP .NET")),
-
- /**
- * Chrome
- */
- CHROME("Chrome", Pattern.compile("Chrome")),
-
- /**
- * Chrome Mobile
- */
- CHROME_MOBILE("Chrome Mobile", Pattern.compile("Chrome Mobile")),
-
- /**
- * Chromium
- */
- CHROMIUM("Chromium", Pattern.compile("Chromium")),
-
- /**
- * City4you
- */
- CITY4YOU("City4you", Pattern.compile("City4you")),
-
- /**
- * cityreview
- */
- CITYREVIEW("cityreview", Pattern.compile("cityreview")),
-
- /**
- * CJB.NET Proxy
- */
- CJB_NET_PROXY("CJB.NET Proxy", Pattern.compile("CJB.NET Proxy")),
-
- /**
- * Claws Mail GtkHtml2 plugin
- */
- CLAWS_MAIL_GTKHTML2_PLUGIN("Claws Mail GtkHtml2 plugin", Pattern.compile("Claws Mail GtkHtml2 plugin")),
-
- /**
- * CligooRobot
- */
- CLIGOOROBOT("CligooRobot", Pattern.compile("CligooRobot")),
-
- /**
- * Coast
- */
- COAST("Coast", Pattern.compile("Coast")),
-
- /**
- * coccoc
- */
- COCCOC("coccoc", Pattern.compile("coccoc")),
-
- /**
- * Columbus
- */
- COLUMBUS("Columbus", Pattern.compile("Columbus")),
-
- /**
- * Combine
- */
- COMBINE("Combine", Pattern.compile("Combine")),
-
- /**
- * CometBird
- */
- COMETBIRD("CometBird", Pattern.compile("CometBird")),
-
- /**
- * Comodo Dragon
- */
- COMODO_DRAGON("Comodo Dragon", Pattern.compile("Comodo Dragon")),
-
- /**
- * CompSpyBot - Competitive Spying and Scraping
- */
- COMPSPYBOT("CompSpyBot/1.0", Pattern.compile("CompSpyBot(/\\d+(\\.\\d+)*)?")),
-
- /**
- * Conkeror
- */
- CONKEROR("Conkeror", Pattern.compile("Conkeror")),
-
- /**
- * ConveraCrawler
- */
- CONVERACRAWLER("ConveraCrawler", Pattern.compile("ConveraCrawler")),
-
- /**
- * CoolNovo
- */
- COOLNOVO("CoolNovo", Pattern.compile("CoolNovo")),
-
- /**
- * copyright sheriff
- */
- COPYRIGHT_SHERIFF("copyright sheriff", Pattern.compile("copyright sheriff")),
-
- /**
- * CorePlayer
- */
- COREPLAYER("CorePlayer", Pattern.compile("CorePlayer")),
-
- /**
- * CorpusCrawler
- */
- CORPUSCRAWLER("CorpusCrawler", Pattern.compile("CorpusCrawler")),
-
- /**
- * Covario-IDS
- */
- COVARIO_IDS("Covario-IDS", Pattern.compile("Covario-IDS")),
-
- /**
- * CPG Dragonfly RSS Module
- */
- CPG_DRAGONFLY_RSS_MODULE("CPG Dragonfly RSS Module", Pattern.compile("CPG Dragonfly RSS Module")),
-
- /**
- * Crawler4j
- */
- CRAWLER4J("Crawler4j", Pattern.compile("Crawler4j")),
-
- /**
- * Crazy Browser
- */
- CRAZY_BROWSER("Crazy Browser", Pattern.compile("Crazy Browser")),
-
- /**
- * csci_b659
- */
- CSCI_B659("csci_b659", Pattern.compile("csci_b659")),
-
- /**
- * CSE HTML Validator
- */
- CSE_HTML_VALIDATOR("CSE HTML Validator", Pattern.compile("CSE HTML Validator")),
-
- /**
- * cURL
- */
- CURL("cURL", Pattern.compile("cURL")),
-
- /**
- * Cyberduck
- */
- CYBERDUCK("Cyberduck", Pattern.compile("Cyberduck")),
-
- /**
- * Cynthia
- */
- CYNTHIA("Cynthia", Pattern.compile("Cynthia")),
-
- /**
- * D+
- */
- D_PLUS("D+", Pattern.compile("D+")),
-
- /**
- * DataFountains
- */
- DATAFOUNTAINS("DataFountains", Pattern.compile("DataFountains")),
-
- /**
- * DataparkSearch
- */
- DATAPARKSEARCH("DataparkSearch", Pattern.compile("DataparkSearch")),
-
- /**
- * Daumoa
- */
- DAUMOA("Daumoa", Pattern.compile("Daumoa")),
-
- /**
- * DBLBot
- */
- DBLBOT("DBLBot", Pattern.compile("DBLBot")),
-
- /**
- * DCPbot
- */
- DCPBOT("DCPbot", Pattern.compile("DCPbot")),
-
- /**
- * DealGates Bot
- */
- DEALGATES_BOT("DealGates Bot", Pattern.compile("DealGates Bot")),
-
- /**
- * Deepnet Explorer
- */
- DEEPNET_EXPLORER("Deepnet Explorer", Pattern.compile("Deepnet Explorer")),
-
- /**
- * del.icio.us-thumbnails
- */
- DEL_ICIO_US_THUMBNAILS("del.icio.us-thumbnails", Pattern.compile("del.icio.us-thumbnails")),
-
- /**
- * Dell Web Monitor
- */
- DELL_WEB_MONITOR("Dell Web Monitor", Pattern.compile("Dell Web Monitor")),
-
- /**
- * Demeter
- */
- DEMETER("Demeter", Pattern.compile("Demeter")),
-
- /**
- * DepSpid
- */
- DEPSPID("DepSpid", Pattern.compile("DepSpid")),
-
- /**
- * DeskBrowse
- */
- DESKBROWSE("DeskBrowse", Pattern.compile("DeskBrowse")),
-
- /**
- * Dillo
- */
- DILLO("Dillo", Pattern.compile("Dillo")),
-
- /**
- * Discoverybot is Discovery Engine's web crawler. It downloads text/html documents for use in building our full web
- * search engine.
- */
- DISCOBOT("discobot", Pattern.compile("(discobot|discoverybot)(/\\d+(\\.\\d+))?")),
-
- /**
- * DKIMRepBot
- */
- DKIMREPBOT("DKIMRepBot", Pattern.compile("DKIMRepBot")),
-
- /**
- * DNS-Digger-Explorer
- */
- DNS_DIGGER_EXPLORER("DNS-Digger-Explorer", Pattern.compile("DNS-Digger-Explorer")),
-
- /**
- * DocZilla
- */
- DOCZILLA("DocZilla", Pattern.compile("DocZilla")),
-
- /**
- * Dolphin
- */
- DOLPHIN("Dolphin", Pattern.compile("Dolphin")),
-
- /**
- * DomainDB
- */
- DOMAINDB("DomainDB", Pattern.compile("DomainDB")),
-
- /**
- * Dooble
- */
- DOOBLE("Dooble", Pattern.compile("Dooble")),
-
- /**
- * Doris
- */
- DORIS("Doris", Pattern.compile("Doris")),
-
- /**
- * Dot TK - spider
- */
- DOT_TK_SPIDER("Dot TK - spider", Pattern.compile("Dot TK - spider")),
-
- /**
- * DotBot
- */
- DOTBOT("DotBot", Pattern.compile("DotBot")),
-
- /**
- * dotSemantic
- */
- DOTSEMANTIC("dotSemantic", Pattern.compile("dotSemantic")),
-
- /**
- * DownloadStudio
- */
- DOWNLOADSTUDIO("DownloadStudio", Pattern.compile("DownloadStudio")),
-
- /**
- * DripfeedBot
- */
- DRIPFEEDBOT("DripfeedBot", Pattern.compile("DripfeedBot")),
-
- /**
- * DuckDuckBot
- */
- DUCKDUCKBOT("DuckDuckBot", Pattern.compile("DuckDuckBot")),
-
- /**
- * DuckDuckPreview
- */
- DUCKDUCKPREVIEW("DuckDuckPreview", Pattern.compile("DuckDuckPreview")),
-
- /**
- * e-SocietyRobot
- */
- E_SOCIETYROBOT("e-SocietyRobot", Pattern.compile("e-SocietyRobot")),
-
- /**
- * EasyBib AutoCite
- */
- EASYBIB_AUTOCITE("EasyBib AutoCite", Pattern.compile("EasyBib AutoCite")),
-
- /**
- * eCairn-Grabber
- */
- ECAIRN_GRABBER("eCairn-Grabber", Pattern.compile("eCairn-Grabber")),
-
- /**
- * Edbrowse
- */
- EDBROWSE("Edbrowse", Pattern.compile("Edbrowse")),
-
- /**
- * EDI
- */
- EDI("EDI", Pattern.compile("EDI")),
-
- /**
- * EdisterBot
- */
- EDISTERBOT("EdisterBot", Pattern.compile("EdisterBot")),
-
- /**
- * egothor
- */
- EGOTHOR("egothor", Pattern.compile("egothor")),
-
- /**
- * ejupiter.com
- */
- EJUPITER_COM("ejupiter.com", Pattern.compile("ejupiter.com")),
-
- /**
- * Element Browser
- */
- ELEMENT_BROWSER("Element Browser", Pattern.compile("Element Browser")),
-
- /**
- * Elinks
- */
- ELINKS("Elinks", Pattern.compile("Elinks")),
-
- /**
- * EnaBot
- */
- ENABOT("EnaBot", Pattern.compile("EnaBot")),
-
- /**
- * Enigma browser
- */
- ENIGMA_BROWSER("Enigma browser", Pattern.compile("Enigma browser")),
-
- /**
- * Enterprise_Search
- */
- ENTERPRISE_SEARCH("Enterprise_Search", Pattern.compile("Enterprise_Search")),
-
- /**
- * envolk
- */
- ENVOLK("envolk", Pattern.compile("envolk")),
-
- /**
- * Epic
- */
- EPIC("Epic", Pattern.compile("Epic")),
-
- /**
- * Epiphany
- */
- EPIPHANY("Epiphany", Pattern.compile("Epiphany")),
-
- /**
- * Espial TV Browser
- */
- ESPIAL_TV_BROWSER("Espial TV Browser", Pattern.compile("Espial TV Browser")),
-
- /**
- * Eudora
- */
- EUDORA("Eudora", Pattern.compile("Eudora")),
-
- /**
- * EuripBot
- */
- EURIPBOT("EuripBot", Pattern.compile("EuripBot")),
-
- /**
- * Eurobot
- */
- EUROBOT("Eurobot", Pattern.compile("Eurobot")),
-
- /**
- * EventGuruBot
- */
- EVENTGURUBOT("EventGuruBot", Pattern.compile("EventGuruBot")),
-
- /**
- * EventMachine
- */
- EVENTMACHINE("EventMachine", Pattern.compile("EventMachine")),
-
- /**
- * Evolution/Camel.Stream
- */
- EVOLUTION_CAMEL_STREAM("Evolution/Camel.Stream", Pattern.compile("Evolution/Camel.Stream")),
-
- /**
- * EvriNid
- */
- EVRINID("EvriNid", Pattern.compile("EvriNid")),
-
- /**
- * Exabot
- */
- EXABOT("Exabot", Pattern.compile("Exabot")),
-
- /**
- * ExactSEEK
- */
- EXACTSEEK("ExactSEEK", Pattern.compile("ExactSEEK")),
-
- /**
- * Ezooms
- */
- EZOOMS("Ezooms", Pattern.compile("Ezooms")),
-
- /**
- * FacebookExternalHit
- */
- FACEBOOKEXTERNALHIT("FacebookExternalHit", Pattern.compile("FacebookExternalHit")),
-
- /**
- * factbot
- */
- FACTBOT("factbot", Pattern.compile("factbot")),
-
- /**
- * FairShare
- */
- FAIRSHARE("FairShare", Pattern.compile("FairShare")),
-
- /**
- * Falconsbot
- */
- FALCONSBOT("Falconsbot", Pattern.compile("Falconsbot")),
-
- /**
- * FAST Enterprise Crawler
- */
- FAST_ENTERPRISE_CRAWLER("FAST Enterprise Crawler", Pattern.compile("FAST Enterprise Crawler")),
-
- /**
- * FAST MetaWeb Crawler
- */
- FAST_METAWEB_CRAWLER("FAST MetaWeb Crawler", Pattern.compile("FAST MetaWeb Crawler")),
-
- /**
- * Fastladder FeedFetcher
- */
- FASTLADDER_FEEDFETCHER("Fastladder FeedFetcher", Pattern.compile("Fastladder FeedFetcher")),
-
- /**
- * FauBot
- */
- FAUBOT("FauBot", Pattern.compile("FauBot")),
-
- /**
- * favorstarbot
- */
- FAVORSTARBOT("favorstarbot", Pattern.compile("favorstarbot")),
-
- /**
- * Feed::Find
- */
- FEED_FIND("Feed::Find", Pattern.compile("Feed::Find")),
-
- /**
- * Feed Viewer
- */
- FEED_VIEWER("Feed Viewer", Pattern.compile("Feed Viewer")),
-
- /**
- * FeedCatBot
- */
- FEEDCATBOT("FeedCatBot", Pattern.compile("FeedCatBot")),
-
- /**
- * FeedDemon
- */
- FEEDDEMON("FeedDemon", Pattern.compile("FeedDemon")),
-
- /**
- * Feedfetcher-Google
- */
- FEEDFETCHER_GOOGLE("Feedfetcher-Google", Pattern.compile("Feedfetcher-Google")),
-
- /**
- * FeedFinder/bloggz.se
- */
- FEEDFINDER_BLOGGZ_SE("FeedFinder/bloggz.se", Pattern.compile("FeedFinder/bloggz.se")),
-
- /**
- * FeedParser
- */
- FEEDPARSER("FeedParser", Pattern.compile("FeedParser")),
-
- /**
- * FeedValidator
- */
- FEEDVALIDATOR("FeedValidator", Pattern.compile("FeedValidator")),
-
- /**
- * Findexa Crawler
- */
- FINDEXA_CRAWLER("Findexa Crawler", Pattern.compile("Findexa Crawler")),
-
- /**
- * findlinks
- */
- FINDLINKS("findlinks", Pattern.compile("findlinks")),
-
- /**
- * Firebird (old name for Firefox)
- */
- FIREBIRD("Firebird (old name for Firefox)", Pattern.compile("Firebird \\(old name for Firefox\\)")),
-
- /**
- * Firefox
- */
- FIREFOX("Firefox", Pattern.compile("Firefox")),
-
- /**
- * Firefox (BonEcho)
- */
- FIREFOX_BONECHO("Firefox (BonEcho)", Pattern.compile("Firefox \\(BonEcho\\)")),
-
- /**
- * Firefox (GranParadiso)
- */
- FIREFOX_GRANPARADISO("Firefox (GranParadiso)", Pattern.compile("Firefox \\(GranParadiso\\)")),
-
- /**
- * Firefox (Lorentz)
- */
- FIREFOX_LORENTZ("Firefox (Lorentz)", Pattern.compile("Firefox \\(Lorentz\\)")),
-
- /**
- * Firefox (Minefield)
- */
- FIREFOX_MINEFIELD("Firefox (Minefield)", Pattern.compile("Firefox \\(Minefield\\)")),
-
- /**
- * Firefox (Namoroka)
- */
- FIREFOX_NAMOROKA("Firefox (Namoroka)", Pattern.compile("Firefox \\(Namoroka\\)")),
-
- /**
- * Firefox (Shiretoko)
- */
- FIREFOX_SHIRETOKO("Firefox (Shiretoko)", Pattern.compile("Firefox \\(Shiretoko\\)")),
-
- /**
- * Fireweb Navigator
- */
- FIREWEB_NAVIGATOR("Fireweb Navigator", Pattern.compile("Fireweb Navigator")),
-
- /**
- * Flatland Industries Web Spider
- */
- FLATLAND_INDUSTRIES_WEB_SPIDER("Flatland Industries Web Spider", Pattern.compile("Flatland Industries Web Spider")),
-
- /**
- * flatlandbot
- */
- FLATLANDBOT("flatlandbot", Pattern.compile("flatlandbot")),
-
- /**
- * FlightDeckReportsBot
- */
- FLIGHTDECKREPORTSBOT("FlightDeckReportsBot", Pattern.compile("FlightDeckReportsBot")),
-
- /**
- * FlipboardProxy
- */
- FLIPBOARDPROXY("FlipboardProxy", Pattern.compile("FlipboardProxy")),
-
- /**
- * Flock
- */
- FLOCK("Flock", Pattern.compile("Flock")),
-
- /**
- * Flocke bot
- */
- FLOCKE_BOT("Flocke bot", Pattern.compile("Flocke bot")),
-
- /**
- * Fluid
- */
- FLUID("Fluid", Pattern.compile("Fluid")),
-
- /**
- * FlyCast
- */
- FLYCAST("FlyCast", Pattern.compile("FlyCast")),
-
- /**
- * FollowSite Bot
- */
- FOLLOWSITE_BOT("FollowSite Bot", Pattern.compile("FollowSite Bot")),
-
- /**
- * foobar2000
- */
- FOOBAR2000("foobar2000", Pattern.compile("foobar2000")),
-
- /**
- * Fooooo_Web_Video_Crawl
- */
- FOOOOO_WEB_VIDEO_CRAWL("Fooooo_Web_Video_Crawl", Pattern.compile("Fooooo_Web_Video_Crawl")),
-
- /**
- * Forschungsportal
- */
- FORSCHUNGSPORTAL("Forschungsportal", Pattern.compile("Forschungsportal")),
-
- /**
- * Francis
- */
- FRANCIS("Francis", Pattern.compile("Francis")),
-
- /**
- * Funambol Mozilla Sync Client
- */
- FUNAMBOL_MOZILLA_SYNC_CLIENT("Funambol Mozilla Sync Client", Pattern.compile("Funambol Mozilla Sync Client")),
-
- /**
- * Funambol Outlook Sync Client
- */
- FUNAMBOL_OUTLOOK_SYNC_CLIENT("Funambol Outlook Sync Client", Pattern.compile("Funambol Outlook Sync Client")),
-
- /**
- * FunnelBack
- */
- FUNNELBACK("FunnelBack", Pattern.compile("FunnelBack")),
-
- /**
- * FurlBot
- */
- FURLBOT("FurlBot", Pattern.compile("FurlBot")),
-
- /**
- * FyberSpider
- */
- FYBERSPIDER("FyberSpider", Pattern.compile("FyberSpider")),
-
- /**
- * g2crawler
- */
- G2CRAWLER("g2crawler", Pattern.compile("g2crawler")),
-
- /**
- * Gaisbot
- */
- GAISBOT("Gaisbot", Pattern.compile("Gaisbot")),
-
- /**
- * Galeon
- */
- GALEON("Galeon", Pattern.compile("Galeon")),
-
- /**
- * Gallent Search Spider
- */
- GALLENT_SEARCH_SPIDER("Gallent Search Spider", Pattern.compile("Gallent Search Spider")),
-
- /**
- * GarlikCrawler
- */
- GARLIKCRAWLER("GarlikCrawler", Pattern.compile("GarlikCrawler")),
-
- /**
- * GcMail
- */
- GCMAIL("GcMail", Pattern.compile("GcMail")),
-
- /**
- * genieBot
- */
- GENIEBOT("genieBot", Pattern.compile("genieBot")),
-
- /**
- * GeonaBot
- */
- GEONABOT("GeonaBot", Pattern.compile("GeonaBot")),
-
- /**
- * GetRight
- */
- GETRIGHT("GetRight", Pattern.compile("GetRight")),
-
- /**
- * Giant/1.0
- */
- GIANT("Giant", Pattern.compile("Giant/(\\d+(\\.\\d+)*)")),
-
- /**
- * Gigabot
- */
- GIGABOT("Gigabot", Pattern.compile("Gigabot")),
-
- /**
- * GingerCrawler
- */
- GINGERCRAWLER("GingerCrawler", Pattern.compile("GingerCrawler")),
-
- /**
- * Girafabot
- */
- GIRAFABOT("Girafabot", Pattern.compile("Girafabot")),
-
- /**
- * GlobalMojo
- */
- GLOBALMOJO("GlobalMojo", Pattern.compile("GlobalMojo")),
-
- /**
- * Gmail image proxy
- */
- GMAIL_IMAGE_PROXY("Gmail image proxy", Pattern.compile("Gmail image proxy")),
-
- /**
- * GnomeVFS
- */
- GNOMEVFS("GnomeVFS", Pattern.compile("GnomeVFS")),
-
- /**
- * GO Browser
- */
- GO_BROWSER("GO Browser", Pattern.compile("GO Browser")),
-
- /**
- * GOFORITBOT
- */
- GOFORITBOT("GOFORITBOT", Pattern.compile("GOFORITBOT")),
-
- /**
- * GoldenPod
- */
- GOLDENPOD("GoldenPod", Pattern.compile("GoldenPod")),
-
- /**
- * GOM Player
- */
- GOM_PLAYER("GOM Player", Pattern.compile("GOM Player")),
-
- /**
- * gonzo
- */
- GONZO("gonzo", Pattern.compile("gonzo")),
-
- /**
- * Google App Engine
- */
- GOOGLE_APP_ENGINE("Google App Engine", Pattern.compile("Google App Engine")),
-
- /**
- * Google Earth
- */
- GOOGLE_EARTH("Google Earth", Pattern.compile("Google Earth")),
-
- /**
- * Google Friend Connect
- */
- GOOGLE_FRIEND_CONNECT("Google Friend Connect", Pattern.compile("Google Friend Connect")),
-
- /**
- * Google Listen
- */
- GOOGLE_LISTEN("Google Listen", Pattern.compile("Google Listen")),
-
- /**
- * Google Rich Snippets Testing Tool
- */
- GOOGLE_RICH_SNIPPETS_TESTING_TOOL("Google Rich Snippets Testing Tool", Pattern.compile("Google Rich Snippets Testing Tool")),
-
- /**
- * Google Wireless Transcoder
- */
- GOOGLE_WIRELESS_TRANSCODER("Google Wireless Transcoder", Pattern.compile("Google Wireless Transcoder")),
-
- /**
- * Googlebot
- */
- GOOGLEBOT("Googlebot", Pattern.compile("Googlebot")),
-
- /**
- * Googlebot-Mobile
- */
- GOOGLEBOT_MOBILE("Googlebot-Mobile", Pattern.compile("Googlebot-Mobile")),
-
- /**
- * gPodder
- */
- GPODDER("gPodder", Pattern.compile("gPodder")),
-
- /**
- * GrapeshotCrawler
- */
- GRAPESHOTCRAWLER("GrapeshotCrawler", Pattern.compile("GrapeshotCrawler")),
-
- /**
- * GreatNews
- */
- GREATNEWS("GreatNews", Pattern.compile("GreatNews")),
-
- /**
- * GreenBrowser
- */
- GREENBROWSER("GreenBrowser", Pattern.compile("GreenBrowser")),
-
- /**
- * Gregarius
- */
- GREGARIUS("Gregarius", Pattern.compile("Gregarius")),
-
- /**
- * GSiteCrawler
- */
- GSITECRAWLER("GSiteCrawler", Pattern.compile("GSiteCrawler")),
-
- /**
- * GStreamer
- */
- GSTREAMER("GStreamer", Pattern.compile("GStreamer")),
-
- /**
- * GurujiBot
- */
- GURUJIBOT("GurujiBot", Pattern.compile("GurujiBot")),
-
- /**
- * Hailoobot
- */
- HAILOOBOT("Hailoobot", Pattern.compile("Hailoobot")),
-
- /**
- * HatenaScreenshot
- */
- HATENASCREENSHOT("HatenaScreenshot", Pattern.compile("HatenaScreenshot")),
-
- /**
- * HeartRails_Capture
- */
- HEARTRAILS_CAPTURE("HeartRails_Capture", Pattern.compile("HeartRailsBot")),
-
- /**
- * heritrix
- */
- HERITRIX("heritrix", Pattern.compile("heritrix")),
-
- /**
- * HiddenMarket
- */
- HIDDENMARKET("HiddenMarket", Pattern.compile("HiddenMarket")),
-
- /**
- * Holmes
- */
- HOLMES("Holmes", Pattern.compile("Holmes")),
-
- /**
- * HolmesBot
- */
- HOLMESBOT("HolmesBot", Pattern.compile("HolmesBot")),
-
- /**
- * HomeTags
- */
- HOMETAGS("HomeTags", Pattern.compile("HomeTags")),
-
- /**
- * HooWWWer
- */
- HOOWWWER("HooWWWer", Pattern.compile("HooWWWer")),
-
- /**
- * HostTracker.com
- */
- HOSTTRACKER_COM("HostTracker", Pattern.compile("HostTracker")),
-
- /**
- * HotJava
- */
- HOTJAVA("HotJava", Pattern.compile("HotJava")),
-
- /**
- * ht://Dig
- */
- HT_DIG("ht://Dig", Pattern.compile("ht://Dig")),
-
- /**
- * HTML2JPG
- */
- HTML2JPG("HTML2JPG", Pattern.compile("HTML2JPG")),
-
- /**
- * HTMLayout
- */
- HTMLAYOUT("HTMLayout", Pattern.compile("HTMLayout")),
-
- /**
- * HTMLParser
- */
- HTMLPARSER("HTMLParser", Pattern.compile("HTMLParser")),
-
- /**
- * HTTP nagios plugin
- */
- HTTP_NAGIOS_PLUGIN("HTTP nagios plugin", Pattern.compile("HTTP nagios plugin")),
-
- /**
- * HTTP_Request2
- */
- HTTP_REQUEST2("HTTP_Request2", Pattern.compile("HTTP_Request2")),
-
- /**
- * HTTrack
- */
- HTTRACK("HTTrack", Pattern.compile("HTTrack")),
-
- /**
- * HuaweiSymantecSpider
- */
- HUAWEISYMANTECSPIDER("HuaweiSymantecSpider", Pattern.compile("HuaweiSymantecSpider")),
-
- /**
- * Hv3
- */
- HV3("Hv3", Pattern.compile("Hv3")),
-
- /**
- * Hydra Browser
- */
- HYDRA_BROWSER("Hydra Browser", Pattern.compile("Hydra Browser")),
-
- /**
- * ia_archiver
- */
- IA_ARCHIVER("ia_archiver", Pattern.compile("ia_archiver")),
-
- /**
- * iaskspider
- */
- IASKSPIDER("iaskspider", Pattern.compile("iaskspider")),
-
- /**
- * IBrowse
- */
- IBROWSE("IBrowse", Pattern.compile("IBrowse")),
-
- /**
- * iCab
- */
- ICAB("iCab", Pattern.compile("iCab")),
-
- /**
- * iCatcher!
- */
- ICATCHER("iCatcher!", Pattern.compile("iCatcher!")),
-
- /**
- * ICC-Crawler
- */
- ICC_CRAWLER("ICC-Crawler", Pattern.compile("ICC-Crawler")),
-
- /**
- * ICE browser
- */
- ICE_BROWSER("ICE browser", Pattern.compile("ICE browser")),
-
- /**
- * IceApe
- */
- ICEAPE("IceApe", Pattern.compile("IceApe")),
-
- /**
- * IceCat
- */
- ICECAT("IceCat", Pattern.compile("IceCat")),
-
- /**
- * IceDragon: A faster, more secure version of Firefox
- */
- ICEDRAGON("IceDragon", Pattern.compile("IceDragon")),
-
- /**
- * IceWeasel
- */
- ICEWEASEL("IceWeasel", Pattern.compile("IceWeasel")),
-
- /**
- * ICF_Site_Crawler
- */
- ICF_SITE_CRAWLER("ICF_Site_Crawler", Pattern.compile("ICF_Site_Crawler")),
-
- /**
- * ichiro
- */
- ICHIRO("ichiro", Pattern.compile("ichiro")),
-
- /**
- * iCjobs
- */
- ICJOBS("iCjobs", Pattern.compile("iCjobs")),
-
- /**
- * Internet Explorer
- */
- IE("IE", Pattern.compile("IE")),
-
- /**
- * Internet Explorer Mobile
- */
- IE_MOBILE("IE Mobile", Pattern.compile("IE Mobile")),
-
- /**
- * Internet Explorer RSS reader
- */
- IE_RSS_READER("IE RSS reader", Pattern.compile("IE RSS reader")),
-
- /**
- * iGetter
- */
- IGETTER("iGetter", Pattern.compile("iGetter")),
-
- /**
- * iGooMap
- */
- IGOOMAP("iGooMap", Pattern.compile("iGooMap")),
-
- /**
- * IlseBot
- */
- ILSEBOT("IlseBot", Pattern.compile("IlseBot")),
-
- /**
- * IlTrovatore
- */
- ILTROVATORE("IlTrovatore", Pattern.compile("IlTrovatore")),
-
- /**
- * IlTrovatore-Setaccio
- */
- ILTROVATORE_SETACCIO("IlTrovatore-Setaccio", Pattern.compile("IlTrovatore-Setaccio")),
-
- /**
- * imbot
- */
- IMBOT("imbot", Pattern.compile("imbot")),
-
- /**
- * Indy Library
- */
- INDY_LIBRARY("Indy Library", Pattern.compile("Indy Library")),
-
- /**
- * Influencebot
- */
- INFLUENCEBOT("Influencebot", Pattern.compile("Influencebot")),
-
- /**
- * InfociousBot
- */
- INFOCIOUSBOT("InfociousBot", Pattern.compile("InfociousBot")),
-
- /**
- * Infohelfer
- */
- INFOHELFER("Infohelfer", Pattern.compile("Infohelfer")),
-
- /**
- * InternetSeer
- */
- INTERNETSEER("InternetSeer", Pattern.compile("InternetSeer")),
-
- /**
- * InternetSurfboard
- */
- INTERNETSURFBOARD("InternetSurfboard", Pattern.compile("InternetSurfboard")),
-
- /**
- * Ipselonbot
- */
- IPSELONBOT("Ipselonbot", Pattern.compile("Ipselonbot")),
-
- /**
- * iRider
- */
- IRIDER("iRider", Pattern.compile("iRider")),
-
- /**
- * IRLbot
- */
- IRLBOT("IRLbot", Pattern.compile("IRLbot")),
-
- /**
- * Iron
- */
- IRON("Iron", Pattern.compile("Iron")),
-
- /**
- * iSiloX
- */
- ISILOX("iSiloX", Pattern.compile("iSiloX")),
-
- /**
- * iSiloXC
- */
- ISILOXC("iSiloXC", Pattern.compile("iSiloXC")),
-
- /**
- * iTunes
- */
- ITUNES("iTunes", Pattern.compile("iTunes")),
-
- /**
- * iVideo
- */
- IVIDEO("iVideo", Pattern.compile("iVideo")),
-
- /**
- * IXR lib
- */
- IXR_LIB("IXR lib", Pattern.compile("IXR lib")),
-
- /**
- * JadynAve
- */
- JADYNAVE("JadynAve", Pattern.compile("JadynAve")),
-
- /**
- * JadynAveBot
- */
- JADYNAVEBOT("JadynAveBot", Pattern.compile("JadynAveBot")),
-
- /**
- * Jakarta Commons-HttpClient
- */
- JAKARTA_COMMONS_HTTPCLIENT("Jakarta Commons-HttpClient", Pattern.compile("(Apache-HttpClient|Jakarta Commons-HttpClient)")),
-
- /**
- * Jambot
- */
- JAMBOT("Jambot", Pattern.compile("Jambot")),
-
- /**
- * Jamcast
- */
- JAMCAST("Jamcast", Pattern.compile("Jamcast")),
-
- /**
- * Jasmine
- */
- JASMINE("Jasmine", Pattern.compile("Jasmine")),
-
- /**
- * Java
- */
- JAVA("Java", Pattern.compile("Java")),
-
- /**
- * JikeSpider
- */
- JIKESPIDER("JikeSpider", Pattern.compile("JikeSpider")),
-
- /**
- * Job Roboter Spider
- */
- JOB_ROBOTER_SPIDER("Job Roboter Spider", Pattern.compile("Job Roboter Spider")),
-
- /**
- * JoBo
- */
- JOBO("JoBo", Pattern.compile("JoBo")),
-
- /**
- * JS-Kit/Echo
- */
- JS_KIT_ECHO("JS-Kit/Echo", Pattern.compile("JS-Kit/Echo")),
-
- /**
- * JUST-CRAWLER
- */
- JUST_CRAWLER("JUST-CRAWLER", Pattern.compile("JUST-CRAWLER")),
-
- /**
- * Jyxobot
- */
- JYXOBOT("Jyxobot", Pattern.compile("Jyxobot")),
-
- /**
- * K-Meleon
- */
- K_MELEON("K-Meleon", Pattern.compile("K-Meleon")),
-
- /**
- * K-Ninja
- */
- K_NINJA("K-Ninja", Pattern.compile("K-Ninja")),
-
- /**
- * Kakle Bot
- */
- KAKLE_BOT("Kakle Bot", Pattern.compile("Kakle Bot")),
-
- /**
- * Kalooga
- */
- KALOOGA("Kalooga", Pattern.compile("Kalooga")),
-
- /**
- * Kapiko
- */
- KAPIKO("Kapiko", Pattern.compile("Kapiko")),
-
- /**
- * Karneval-Bot
- */
- KARNEVAL_BOT("Karneval-Bot", Pattern.compile("Karneval-Bot")),
-
- /**
- * Kazehakase
- */
- KAZEHAKASE("Kazehakase", Pattern.compile("Kazehakase")),
-
- /**
- * KeywenBot
- */
- KEYWENBOT("KeywenBot", Pattern.compile("KeywenBot")),
-
- /**
- * KeywordDensityRobot
- */
- KEYWORDDENSITYROBOT("KeywordDensityRobot", Pattern.compile("KeywordDensityRobot")),
-
- /**
- * Kindle Browser
- */
- KINDLE_BROWSER("Kindle Browser", Pattern.compile("Kindle Browser")),
-
- /**
- * Kirix Strata
- */
- KIRIX_STRATA("Kirix Strata", Pattern.compile("Kirix Strata")),
-
- /**
- * KKman
- */
- KKMAN("KKman", Pattern.compile("KKman")),
-
- /**
- * Klondike
- */
- KLONDIKE("Klondike", Pattern.compile("Klondike")),
-
- /**
- * Kongulo
- */
- KONGULO("Kongulo", Pattern.compile("Kongulo")),
-
- /**
- * Konqueror
- */
- KONQUEROR("Konqueror", Pattern.compile("Konqueror")),
-
- /**
- * KRetrieve
- */
- KRETRIEVE("KRetrieve", Pattern.compile("KRetrieve")),
-
- /**
- * Krugle
- */
- KRUGLE("Krugle", Pattern.compile("Krugle")),
-
- /**
- * ksibot
- */
- KSIBOT("ksibot", Pattern.compile("ksibot")),
-
- /**
- * Kylo
- */
- KYLO("Kylo", Pattern.compile("Kylo")),
-
- /**
- * L.webis
- */
- L_WEBIS("L.webis", Pattern.compile("L.webis")),
-
- /**
- * LapozzBot
- */
- LAPOZZBOT("LapozzBot", Pattern.compile("LapozzBot")),
-
- /**
- * Larbin
- */
- LARBIN("Larbin", Pattern.compile("Larbin")),
-
- /**
- * LBrowser
- */
- LBROWSER("LBrowser", Pattern.compile("LBrowser")),
-
- /**
- * LeechCraft
- */
- LEECHCRAFT("LeechCraft", Pattern.compile("LeechCraft")),
-
- /**
- * LemurWebCrawler
- */
- LEMURWEBCRAWLER("LemurWebCrawler", Pattern.compile("LemurWebCrawler")),
-
- /**
- * LexxeBot
- */
- LEXXEBOT("LexxeBot", Pattern.compile("LexxeBot")),
-
- /**
- * LFTP
- */
- LFTP("LFTP", Pattern.compile("LFTP")),
-
- /**
- * LG Web Browser
- */
- LG_WEB_BROWSER("LG Web Browser", Pattern.compile("LG Web Browser")),
-
- /**
- * LibSoup
- */
- LIBSOUP("LibSoup", Pattern.compile("LibSoup")),
-
- /**
- * libwww-perl
- */
- LIBWWW_PERL("libwww-perl", Pattern.compile("libwww-perl")),
-
- /**
- * Liferea
- */
- LIFEREA("Liferea", Pattern.compile("Liferea")),
-
- /**
- * Lijit
- */
- LIJIT("Lijit", Pattern.compile("Lijit")),
-
- /**
- * LinguaBot
- */
- LINGUABOT("LinguaBot", Pattern.compile("LinguaBot")),
-
- /**
- * Linguee Bot
- */
- LINGUEE_BOT("Linguee Bot", Pattern.compile("Linguee Bot")),
-
- /**
- * Link Valet Online
- */
- LINK_VALET_ONLINE("Link Valet Online", Pattern.compile("Link Valet Online")),
-
- /**
- * LinkAider
- */
- LINKAIDER("LinkAider", Pattern.compile("LinkAider")),
-
- /**
- * LinkbackPlugin for Laconica
- */
- LINKBACKPLUGIN_FOR_LACONICA("LinkbackPlugin for Laconica", Pattern.compile("LinkbackPlugin for Laconica")),
-
- /**
- * LinkChecker
- */
- LINKCHECKER("LinkChecker", Pattern.compile("LinkChecker")),
-
- /**
- * linkdex.com
- */
- LINKDEX_COM("linkdex.com", Pattern.compile("linkdex.com")),
-
- /**
- * LinkExaminer
- */
- LINKEXAMINER("LinkExaminer", Pattern.compile("LinkExaminer")),
-
- /**
- * Links
- */
- LINKS("Links", Pattern.compile("Links")),
-
- /**
- * linksmanager_bot
- */
- LINKSMANAGER_BOT("linksmanager_bot", Pattern.compile("linksmanager_bot")),
-
- /**
- * LinkWalker
- */
- LINKWALKER("LinkWalker", Pattern.compile("LinkWalker")),
-
- /**
- * livedoor ScreenShot
- */
- LIVEDOOR_SCREENSHOT("livedoor ScreenShot", Pattern.compile("livedoor ScreenShot")),
-
- /**
- * lmspider
- */
- LMSPIDER("lmspider", Pattern.compile("lmspider")),
-
- /**
- * Lobo
- */
- LOBO("Lobo", Pattern.compile("Lobo")),
-
- /**
- * lolifox
- */
- LOLIFOX("lolifox", Pattern.compile("lolifox")),
-
- /**
- * Lotus Notes
- */
- LOTUS_NOTES("Lotus Notes", Pattern.compile("Lotus Notes")),
-
- /**
- * Lunascape
- */
- LUNASCAPE("Lunascape", Pattern.compile("Lunascape")),
-
- /**
- * LWP::Simple
- */
- LWP_SIMPLE("LWP::Simple", Pattern.compile("LWP::Simple")),
-
- /**
- * Lynx
- */
- LYNX("Lynx", Pattern.compile("Lynx")),
-
- /**
- * Madfox
- */
- MADFOX("Madfox", Pattern.compile("Madfox")),
-
- /**
- * magpie-crawler
- */
- MAGPIE_CRAWLER("magpie-crawler", Pattern.compile("magpie-crawler")),
-
- /**
- * MagpieRSS
- */
- MAGPIERSS("MagpieRSS", Pattern.compile("MagpieRSS")),
-
- /**
- * Mahiti Crawler
- */
- MAHITI_CRAWLER("Mahiti Crawler", Pattern.compile("Mahiti Crawler")),
-
- /**
- * Mail.RU
- */
- MAIL_RU("Mail.Ru", Pattern.compile("Mail.RU(_Bot)?(/\\d+(\\.\\d+)*)?", Pattern.CASE_INSENSITIVE)),
-
- /**
- * Maple browser
- */
- MAPLE_BROWSER("Maple browser", Pattern.compile("Maple browser")),
-
- /**
- * Maxthon
- */
- MAXTHON("Maxthon", Pattern.compile("Maxthon")),
-
- /**
- * Mechanize
- */
- MECHANIZE("Mechanize", Pattern.compile("Mechanize")),
-
- /**
- * Megatext
- */
- MEGATEXT("Megatext", Pattern.compile("Megatext")),
-
- /**
- * MetaGeneratorCrawler
- */
- METAGENERATORCRAWLER("MetaGeneratorCrawler", Pattern.compile("MetaGeneratorCrawler")),
-
- /**
- * MetaJobBot
- */
- METAJOBBOT("MetaJobBot", Pattern.compile("MetaJobBot")),
-
- /**
- * MetamojiCrawler
- */
- METAMOJICRAWLER("MetamojiCrawler", Pattern.compile("MetamojiCrawler")),
-
- /**
- * Metaspinner/0.01
- */
- METASPINNER("Metaspinner", Pattern.compile("Metaspinner(/\\d+(\\.\\d+)*)?")),
-
- /**
- * MetaTagRobot
- */
- METATAGROBOT("MetaTagRobot", Pattern.compile("MetaTagRobot")),
-
- /**
- * MetaURI
- */
- METAURI("MetaURI", Pattern.compile("MetaURI")),
-
- /**
- * MIA Bot
- */
- MIA_BOT("MIA Bot", Pattern.compile("MIA Bot")),
-
- /**
- * MicroB
- */
- MICROB("MicroB", Pattern.compile("MicroB")),
-
- /**
- * Microsoft Edge
- */
- MICROSOFT_EDGE("Microsoft Edge", Pattern.compile("Microsoft Edge")),
-
- /**
- * Microsoft Edge
- */
- MICROSOFT_EDGE_MOBILE("Microsoft Edge mobile", Pattern.compile("Microsoft Edge mobile")),
-
- /**
- * Microsoft Office Existence Discovery
- */
- MICROSOFT_OFFICE_EXISTENCE_DISCOVERY("Microsoft Office Existence Discovery", Pattern.compile("Microsoft Office Existence Discovery")),
-
- /**
- * Microsoft WebDAV client
- */
- MICROSOFT_WEBDAV_CLIENT("Microsoft WebDAV client", Pattern.compile("Microsoft WebDAV client")),
-
- /**
- * Midori
- */
- MIDORI("Midori", Pattern.compile("Midori")),
-
- /**
- * Mini Browser
- */
- MINI_BROWSER("Mini Browser", Pattern.compile("Mini Browser")),
-
- /**
- * Minimo
- */
- MINIMO("Minimo", Pattern.compile("Minimo")),
-
- /**
- * miniRank
- */
- MINIRANK("miniRank", Pattern.compile("miniRank")),
-
- /**
- * Miro
- */
- MIRO("Miro", Pattern.compile("Miro")),
-
- /**
- * MJ12bot
- */
- MJ12BOT("MJ12bot", Pattern.compile("MJ12bot")),
-
- /**
- * MLBot
- */
- MLBOT("MLBot", Pattern.compile("MLBot")),
-
- /**
- * MnoGoSearch
- */
- MNOGOSEARCH("MnoGoSearch", Pattern.compile("MnoGoSearch")),
-
- /**
- * Moatbot
- */
- MOATBOT("Moatbot", Pattern.compile("Moatbot")),
-
- /**
- * moba-crawler
- */
- MOBA_CRAWLER("moba-crawler", Pattern.compile("moba-crawler")),
-
- /**
- * Mobile Firefox
- */
- MOBILE_FIREFOX("Mobile Firefox", Pattern.compile("Firefox mobile")),
-
- /**
- * Mobile Safari
- */
- MOBILE_SAFARI("Mobile Safari", Pattern.compile("Safari mobile")),
-
- /**
- * MojeekBot
- */
- MOJEEKBOT("MojeekBot", Pattern.compile("MojeekBot")),
-
- /**
- * Motoricerca-Robots.txt-Checker
- */
- MOTORICERCA_ROBOTS_TXT_CHECKER("Motoricerca-Robots.txt-Checker", Pattern.compile("Motoricerca-Robots.txt-Checker")),
-
- /**
- * Motorola Internet Browser
- */
- MOTOROLA_INTERNET_BROWSER("Motorola Internet Browser", Pattern.compile("Motorola Internet Browser")),
-
- /**
- * mozDex
- */
- MOZDEX("mozDex", Pattern.compile("mozDex")),
-
- /**
- * Mozilla
- */
- MOZILLA("Mozilla", Pattern.compile("Mozilla")),
-
- /**
- * Mp3Bot
- */
- MP3BOT("Mp3Bot", Pattern.compile("Mp3Bot")),
-
- /**
- * MPlayer
- */
- MPLAYER("MPlayer", Pattern.compile("MPlayer")),
-
- /**
- * MPlayer2
- */
- MPLAYER2("MPlayer2", Pattern.compile("MPlayer2")),
-
- /**
- * MQbot
- */
- MQBOT("MQbot", Pattern.compile("MQbot")),
-
- /**
- * MSNBot
- */
- MSNBOT("MSNBot", Pattern.compile("MSNBot")),
-
- /**
- * MSRBOT
- */
- MSRBOT("MSRBOT", Pattern.compile("MSRBOT")),
-
- /**
- * muCommander
- */
- MUCOMMANDER("muCommander", Pattern.compile("muCommander")),
-
- /**
- * Multi-Browser XP
- */
- MULTI_BROWSER_XP("Multi-Browser XP", Pattern.compile("Multi-Browser XP")),
-
- /**
- * MultiCrawler
- */
- MULTICRAWLER("MultiCrawler", Pattern.compile("MultiCrawler")),
-
- /**
- * Multipage Validator
- */
- MULTIPAGE_VALIDATOR("Multipage Validator", Pattern.compile("Multipage Validator")),
-
- /**
- * MultiZilla
- */
- MULTIZILLA("MultiZilla", Pattern.compile("MultiZilla")),
-
- /**
- * My Internet Browser
- */
- MY_INTERNET_BROWSER("My Internet Browser", Pattern.compile("My Internet Browser")),
-
- /**
- * MyFamilyBot
- */
- MYFAMILYBOT("MyFamilyBot", Pattern.compile("MyFamilyBot")),
-
- /**
- * Najdi.si
- */
- NAJDI_SI("Najdi.si", Pattern.compile("Najdi.si")),
-
- /**
- * NaverBot
- */
- NAVERBOT("NaverBot", Pattern.compile("NaverBot")),
-
- /**
- * navissobot
- */
- NAVISSOBOT("navissobot", Pattern.compile("navissobot")),
-
- /**
- * NCSA Mosaic
- */
- NCSA_MOSAIC("NCSA Mosaic", Pattern.compile("NCSA Mosaic")),
-
- /**
- * NerdByNature.Bot
- */
- NERDBYNATURE_BOT("NerdByNature.Bot", Pattern.compile("NerdByNature.Bot")),
-
- /**
- * nestReader
- */
- NESTREADER("nestReader", Pattern.compile("nestReader")),
-
- /**
- * NetBox
- */
- NETBOX("NetBox", Pattern.compile("NetBox")),
-
- /**
- * NetCaptor
- */
- NETCAPTOR("NetCaptor", Pattern.compile("NetCaptor")),
-
- /**
- * NetcraftSurveyAgent
- */
- NETCRAFTSURVEYAGENT("NetcraftSurveyAgent", Pattern.compile("NetcraftSurveyAgent")),
-
- /**
- * netEstate Crawler
- */
- NETESTATE_CRAWLER("netEstate Crawler", Pattern.compile("netEstate Crawler")),
-
- /**
- * NetFront
- */
- NETFRONT("NetFront", Pattern.compile("NetFront")),
-
- /**
- * NetFront Mobile Content Viewer
- */
- NETFRONT_MOBILE_CONTENT_VIEWER("NetFront Mobile Content Viewer", Pattern.compile("NetFront Mobile Content Viewer")),
-
- /**
- * Netintelligence LiveAssessment
- */
- NETINTELLIGENCE_LIVEASSESSMENT("Netintelligence LiveAssessment", Pattern.compile("Netintelligence LiveAssessment")),
-
- /**
- * NetNewsWire
- */
- NETNEWSWIRE("NetNewsWire", Pattern.compile("NetNewsWire")),
-
- /**
- * NetPositive
- */
- NETPOSITIVE("NetPositive", Pattern.compile("NetPositive")),
-
- /**
- * NetResearchServer
- */
- NETRESEARCHSERVER("NetResearchServer", Pattern.compile("NetResearchServer")),
-
- /**
- * Netscape Navigator
- */
- NETSCAPE_NAVIGATOR("Netscape Navigator", Pattern.compile("Netscape Navigator")),
-
- /**
- * Netseer
- */
- NETSEER("Netseer", Pattern.compile("Netseer")),
-
- /**
- * NetSurf
- */
- NETSURF("NetSurf", Pattern.compile("NetSurf")),
-
- /**
- * Netvibes feed reader
- */
- NETVIBES_FEED_READER("Netvibes feed reader", Pattern.compile("Netvibes feed reader")),
-
- /**
- * NetWhatCrawler
- */
- NETWHATCRAWLER("NetWhatCrawler", Pattern.compile("NetWhatCrawler")),
-
- /**
- * Newsbeuter
- */
- NEWSBEUTER("Newsbeuter", Pattern.compile("Newsbeuter")),
-
- /**
- * NewsBreak
- */
- NEWSBREAK("NewsBreak", Pattern.compile("NewsBreak")),
-
- /**
- * NewsFox
- */
- NEWSFOX("NewsFox", Pattern.compile("NewsFox")),
-
- /**
- * NewsGatorOnline
- */
- NEWSGATORONLINE("NewsGatorOnline", Pattern.compile("NewsGatorOnline")),
-
- /**
- * NextGenSearchBot
- */
- NEXTGENSEARCHBOT("NextGenSearchBot", Pattern.compile("NextGenSearchBot")),
-
- /**
- * nextthing.org
- */
- NEXTTHING_ORG("nextthing.org", Pattern.compile("nextthing.org")),
-
- /**
- * NFReader
- */
- NFREADER("NFReader", Pattern.compile("NFReader")),
-
- /**
- * NG
- */
- NG("NG", Pattern.compile("NG")),
-
- /**
- * NG-Search
- */
- NG_SEARCH("NG-Search", Pattern.compile("NG-Search")),
-
- /**
- * Nigma.ru
- */
- NIGMA_RU("Nigma.ru", Pattern.compile("Nigma.ru")),
-
- /**
- * NimbleCrawler
- */
- NIMBLECRAWLER("NimbleCrawler", Pattern.compile("NimbleCrawler")),
-
- /**
- * NineSky
- */
- NINESKY("NineSky", Pattern.compile("NineSky")),
-
- /**
- * Nintendo Browser
- */
- NINTENDO("Nintendo Browser", Pattern.compile("Nintendo Browser")),
-
- /**
- * nodestackbot
- */
- NODESTACKBOT("nodestackbot", Pattern.compile("nodestackbot")),
-
- /**
- * Nokia SyncML Client
- */
- NOKIA_SYNCML_CLIENT("Nokia SyncML Client", Pattern.compile("Nokia SyncML Client")),
-
- /**
- * Nokia Web Browser
- */
- NOKIA_WEB_BROWSER("Nokia Web Browser", Pattern.compile("Nokia Web Browser")),
-
- /**
- * Novell BorderManager
- */
- NOVELL_BORDERMANAGER("Novell BorderManager", Pattern.compile("Novell BorderManager")),
-
- /**
- * noyona
- */
- NOYONA("noyona", Pattern.compile("noyona")),
-
- /**
- * NPBot
- */
- NPBOT("NPBot", Pattern.compile("NPBot")),
-
- /**
- * Nuhk
- */
- NUHK("Nuhk", Pattern.compile("Nuhk")),
-
- /**
- * NuSearch Spider
- */
- NUSEARCH_SPIDER("NuSearch Spider", Pattern.compile("NuSearch Spider")),
-
- /**
- * Nutch
- */
- NUTCH("Nutch", Pattern.compile("Nutch")),
-
- /**
- * nworm
- */
- NWORM("nworm", Pattern.compile("nworm")),
-
- /**
- * Nymesis
- */
- NYMESIS("Nymesis", Pattern.compile("Nymesis")),
-
- /**
- * Obigo
- */
- OBIGO("Obigo", Pattern.compile("Obigo")),
-
- /**
- * oBot
- */
- OBOT("oBot", Pattern.compile("oBot")),
-
- /**
- * Ocelli
- */
- OCELLI("Ocelli", Pattern.compile("Ocelli")),
-
- /**
- * Off By One
- */
- OFF_BY_ONE("Off By One", Pattern.compile("Off By One")),
-
- /**
- * Offline Explorer
- */
- OFFLINE_EXPLORER("Offline Explorer", Pattern.compile("Offline Explorer")),
-
- /**
- * Omea Reader
- */
- OMEA_READER("Omea Reader", Pattern.compile("Omea Reader")),
-
- /**
- * OmniExplorer_Bot
- */
- OMNIEXPLORER_BOT("OmniExplorer_Bot", Pattern.compile("OmniExplorer_Bot")),
-
- /**
- * OmniWeb
- */
- OMNIWEB("OmniWeb", Pattern.compile("OmniWeb")),
-
- /**
- * OnetSzukaj
- */
- ONETSZUKAJ("OnetSzukaj", Pattern.compile("OnetSzukaj")),
-
- /**
- * Openbot
- */
- OPENBOT("Openbot", Pattern.compile("Openbot")),
-
- /**
- * OpenCalaisSemanticProxy
- */
- OPENCALAISSEMANTICPROXY("OpenCalaisSemanticProxy", Pattern.compile("OpenCalaisSemanticProxy")),
-
- /**
- * OpenindexSpider
- */
- OPENINDEXSPIDER("OpenindexSpider", Pattern.compile("OpenindexSpider")),
-
- /**
- * Openwave Mobile Browser
- */
- OPENWAVE_MOBILE_BROWSER("Openwave Mobile Browser", Pattern.compile("Openwave Mobile Browser")),
-
- /**
- * Opera
- */
- OPERA("Opera", Pattern.compile("Opera")),
-
- /**
- * Opera Mini
- */
- OPERA_MINI("Opera Mini", Pattern.compile("Opera Mini")),
-
- /**
- * Opera Mobile
- */
- OPERA_MOBILE("Opera Mobile", Pattern.compile("Opera Mobile")),
-
- /**
- * Orbiter
- */
- ORBITER("Orbiter", Pattern.compile("Orbiter")),
-
- /**
- * Orca
- */
- ORCA("Orca", Pattern.compile("Orca")),
-
- /**
- * Oregano
- */
- OREGANO("Oregano", Pattern.compile("Oregano")),
-
- /**
- * OrgbyBot
- */
- ORGBYBOT("OrgbyBot", Pattern.compile("OrgbyBot")),
-
- /**
- * OsObot
- */
- OSOBOT("OsObot", Pattern.compile("OsObot")),
-
- /**
- * Outlook 2007
- */
- OUTLOOK_2007("Outlook 2007", Pattern.compile("Outlook 2007")),
-
- /**
- * Outlook 2010
- */
- OUTLOOK_2010("Outlook 2010", Pattern.compile("Outlook 2010")),
-
- /**
- * Outlook 2013
- */
- OUTLOOK_2013("Outlook 2013", Pattern.compile("Outlook 2013")),
-
- /**
- * OWB
- */
- OWB("OWB", Pattern.compile("OWB")),
-
- /**
- * owsBot
- */
- OWSBOT("owsBot", Pattern.compile("owsBot")),
-
- /**
- * P3P Validator
- */
- P3P_VALIDATOR("P3P Validator", Pattern.compile("P3P Validator")),
-
- /**
- * page_verifier
- */
- PAGE_VERIFIER("page_verifier", Pattern.compile("page_verifier")),
-
- /**
- * Page2RSS
- */
- PAGE2RSS("Page2RSS", Pattern.compile("Page2RSS")),
-
- /**
- * PageBitesHyperBot
- */
- PAGEBITESHYPERBOT("PageBitesHyperBot", Pattern.compile("PageBitesHyperBot")),
-
- /**
- * PagePeeker
- */
- PAGEPEEKER("PagePeeker", Pattern.compile("PagePeeker")),
-
- /**
- * Pale Moon
- */
- PALE_MOON("Pale Moon", Pattern.compile("Pale Moon")),
-
- /**
- * Palm Pre web browser
- */
- PALM_PRE_WEB_BROWSER("Palm Pre web browser", Pattern.compile("Palm Pre web browser")),
-
- /**
- * Panscient web crawler
- */
- PANSCIENT_WEB_CRAWLER("panscient.com", Pattern.compile("panscient.com")),
-
- /**
- * Paparazzi!
- */
- PAPARAZZI("Paparazzi!", Pattern.compile("Paparazzi!")),
-
- /**
- * PaperLiBot
- */
- PAPERLIBOT("PaperLiBot", Pattern.compile("PaperLiBot")),
-
- /**
- * ParchBot
- */
- PARCHBOT("ParchBot", Pattern.compile("ParchBot")),
-
- /**
- * Patriott
- */
- PATRIOTT("Patriott", Pattern.compile("Patriott")),
-
- /**
- * Pattern is a web mining module for the Python programming language.
- */
- PATTERN("Pattern", Pattern.compile("Pattern")),
-
- /**
- * PEAR HTTP_Request
- */
- PEAR_HTTP_REQUEST("PEAR HTTP_Request", Pattern.compile("PEAR HTTP_Request")),
-
- /**
- * Peew
- */
- PEEW("Peew", Pattern.compile("Peew")),
-
- /**
- * percbotspider
- */
- PERCBOTSPIDER("percbotspider", Pattern.compile("percbotspider")),
-
- /**
- * Phaseout
- */
- PHASEOUT("Phaseout", Pattern.compile("Phaseout")),
-
- /**
- * Phoenix (old name for Firefox)
- */
- PHOENIX("Phoenix (old name for Firefox)", Pattern.compile("Phoenix \\(old name for Firefox\\)")),
-
- /**
- * PHP
- */
- PHP("PHP", Pattern.compile("PHP")),
-
- /**
- * PHP link checker
- */
- PHP_LINK_CHECKER("PHP link checker", Pattern.compile("PHP link checker")),
-
- /**
- * PHP OpenID library
- */
- PHP_OPENID_LIBRARY("PHP OpenID library", Pattern.compile("PHP OpenID library")),
-
- /**
- * PHPcrawl
- */
- PHPCRAWL("PHPcrawl", Pattern.compile("PHPcrawl")),
-
- /**
- * pingdom.com_bot
- */
- PINGDOM_COM_BOT("pingdom.com_bot", Pattern.compile("pingdom.com_bot")),
-
- /**
- * Pixray-Seeker
- */
- PIXRAY_SEEKER("Pixray-Seeker", Pattern.compile("Pixray-Seeker")),
-
- /**
- * Plex Media Center
- */
- PLEX_MEDIA_CENTER("Plex Media Center", Pattern.compile("Plex Media Center")),
-
- /**
- * Plukkie
- */
- PLUKKIE("Plukkie", Pattern.compile("Plukkie")),
-
- /**
- * Pocket Tunes
- */
- POCKET_TUNES("Pocket Tunes", Pattern.compile("Pocket Tunes")),
-
- /**
- * PocoMail
- */
- POCOMAIL("PocoMail", Pattern.compile("PocoMail")),
-
- /**
- * Podkicker
- */
- PODKICKER("Podkicker", Pattern.compile("Podkicker")),
-
- /**
- * POE-Component-Client-HTTP
- */
- POE_COMPONENT_CLIENT_HTTP("POE-Component-Client-HTTP", Pattern.compile("POE-Component-Client-HTTP")),
-
- /**
- * Pogodak.co.yu
- */
- POGODAK_CO_YU("Pogodak.co.yu", Pattern.compile("Pogodak.co.yu")),
-
- /**
- * Polaris
- */
- POLARIS("Polaris", Pattern.compile("Polaris")),
-
- /**
- * polixea.de
- */
- POLIXEA_DE("polixea.de", Pattern.compile("polixea.de")),
-
- /**
- * Pompos
- */
- POMPOS("Pompos", Pattern.compile("Pompos")),
-
- /**
- * Postbox
- */
- POSTBOX("Postbox", Pattern.compile("Postbox")),
-
- /**
- * posterus
- */
- POSTERUS("posterus", Pattern.compile("posterus")),
-
- /**
- * PostPost
- */
- POSTPOST("PostPost", Pattern.compile("PostPost")),
-
- /**
- * Powermarks
- */
- POWERMARKS("Powermarks", Pattern.compile("Powermarks")),
-
- /**
- * Prism
- */
- PRISM("Prism", Pattern.compile("Prism")),
-
- /**
- * ProCogBot
- */
- PROCOGBOT("ProCogBot", Pattern.compile("ProCogBot")),
-
- /**
- * proximic
- */
- PROXIMIC("proximic", Pattern.compile("proximic")),
-
- /**
- * PRTG Network Monitor
- */
- PRTG_NETWORK_MONITOR("PRTG Network Monitor", Pattern.compile("PRTG Network Monitor")),
-
- /**
- * PS Vita browser
- */
- PS_VITA_BROWSER("PS Vita browser", Pattern.compile("PS Vita browser")),
-
- /**
- * psbot
- */
- PSBOT("psbot", Pattern.compile("psbot")),
-
- /**
- * ptd-crawler
- */
- PTD_CRAWLER("ptd-crawler", Pattern.compile("ptd-crawler")),
-
- /**
- * Public Radio Player
- */
- PUBLIC_RADIO_PLAYER("Public Radio Player", Pattern.compile("Public Radio Player")),
-
- /**
- * PycURL
- */
- PYCURL("PycURL", Pattern.compile("PycURL")),
-
- /**
- * Python-requests
- */
- PYTHON_REQUESTS("Python-requests", Pattern.compile("Python-requests")),
-
- /**
- * Python-urllib
- */
- PYTHON_URLLIB("Python-urllib", Pattern.compile("Python-urllib")),
-
- /**
- * Python-webchecker
- */
- PYTHON_WEBCHECKER("Python-webchecker", Pattern.compile("Python-webchecker")),
-
- /**
- * Qirina Hurdler
- */
- QIRINA_HURDLER("Qirina Hurdler", Pattern.compile("Qirina Hurdler")),
-
- /**
- * QQbrowser
- */
- QQBROWSER("QQbrowser", Pattern.compile("QQbrowser")),
-
- /**
- * Qseero
- */
- QSEERO("Qseero", Pattern.compile("Qseero")),
-
- /**
- * QtWeb
- */
- QTWEB("QtWeb", Pattern.compile("QtWeb")),
-
- /**
- * Qualidator.com Bot
- */
- QUALIDATOR_COM_BOT("Qualidator.com Bot", Pattern.compile("Qualidator.com Bot")),
-
- /**
- * Quantcastbot
- */
- QUANTCASTBOT("Quantcastbot", Pattern.compile("Quantcastbot")),
-
- /**
- * quickobot
- */
- QUICKOBOT("quickobot", Pattern.compile("quickobot")),
-
- /**
- * QuickTime
- */
- QUICKTIME("QuickTime", Pattern.compile("QuickTime")),
-
- /**
- * QupZilla
- */
- QUPZILLA("QupZilla", Pattern.compile("QupZilla")),
-
- /**
- * R6 bot
- */
- R6_BOT("R6 bot", Pattern.compile("R6 bot")),
-
- /**
- * RADaR-Bot
- */
- RADAR_BOT("RADaR-Bot", Pattern.compile("RADaR-Bot")),
-
- /**
- * Radio Downloader
- */
- RADIO_DOWNLOADER("Radio Downloader", Pattern.compile("Radio Downloader")),
-
- /**
- * RankurBot
- */
- RANKURBOT("RankurBot", Pattern.compile("RankurBot")),
-
- /**
- * RedBot
- */
- REDBOT("RedBot", Pattern.compile("RedBot")),
-
- /**
- * Reeder
- */
- REEDER("Reeder", Pattern.compile("Reeder")),
-
- /**
- * Rekonq
- */
- REKONQ("Rekonq", Pattern.compile("Rekonq")),
-
- /**
- * REL Link Checker Lite
- */
- REL_LINK_CHECKER_LITE("REL Link Checker Lite", Pattern.compile("REL Link Checker Lite")),
-
- /**
- * retawq
- */
- RETAWQ("retawq", Pattern.compile("retawq")),
-
- /**
- * Robo Crawler
- */
- ROBO_CRAWLER("Robo Crawler", Pattern.compile("Robo Crawler")),
-
- /**
- * Robots_Tester
- */
- ROBOTS_TESTER("Robots_Tester", Pattern.compile("Robots_Tester")),
-
- /**
- * Robozilla
- */
- ROBOZILLA("Robozilla", Pattern.compile("Robozilla")),
-
- /**
- * RockMelt
- */
- ROCKMELT("RockMelt", Pattern.compile("RockMelt")),
-
- /**
- * ROME library
- */
- ROME_LIBRARY("ROME library", Pattern.compile("ROME library")),
-
- /**
- * Ronzoobot
- */
- RONZOOBOT("Ronzoobot", Pattern.compile("Ronzoobot")),
-
- /**
- * Rss Bandit
- */
- RSS_BANDIT("Rss Bandit", Pattern.compile("Rss Bandit")),
-
- /**
- * RSS Menu
- */
- RSS_MENU("RSS Menu", Pattern.compile("RSS Menu")),
-
- /**
- * RSS Popper
- */
- RSS_POPPER("RSS Popper", Pattern.compile("RSS Popper")),
-
- /**
- * RSS Radio
- */
- RSS_RADIO("RSS Radio", Pattern.compile("RSS Radio")),
-
- /**
- * RSSMicro.com RSS/Atom Feed Robot
- */
- RSSMICRO_COM("RSSMicro.com RSS/Atom Feed Robot", Pattern.compile("RSSMicro.com RSS/Atom Feed Robot")),
-
- /**
- * RSSOwl
- */
- RSSOWL("RSSOwl", Pattern.compile("RSSOwl")),
-
- /**
- * Ruky-Roboter
- */
- RUKY_ROBOTER("Ruky-Roboter", Pattern.compile("Ruky-Roboter")),
-
- /**
- * Ryouko
- */
- RYOUKO("Ryouko", Pattern.compile("Ryouko")),
-
- /**
- * RyzeCrawler
- */
- RYZECRAWLER("RyzeCrawler", Pattern.compile("RyzeCrawler")),
-
- /**
- * SaaYaa Explorer
- */
- SAAYAA_EXPLORER("SaaYaa Explorer", Pattern.compile("SaaYaa Explorer")),
-
- /**
- * Safari
- */
- SAFARI("Safari", Pattern.compile("Safari")),
-
- /**
- * Safari RSS reader
- */
- SAFARI_RSS_READER("Safari RSS reader", Pattern.compile("Safari RSS reader")),
-
- /**
- * Sage
- */
- SAGE("Sage", Pattern.compile("Sage")),
-
- /**
- * SAI Crawler
- */
- SAI_CRAWLER("SAI Crawler", Pattern.compile("SAI Crawler")),
-
- /**
- * SanszBot
- */
- SANSZBOT("SanszBot", Pattern.compile("SanszBot")),
-
- /**
- * SBIder
- */
- SBIDER("SBIder", Pattern.compile("SBIder")),
-
- /**
- * SBSearch
- */
- SBSEARCH("SBSearch", Pattern.compile("SBSearch")),
-
- /**
- * Scarlett
- */
- SCARLETT("Scarlett", Pattern.compile("Scarlett")),
-
- /**
- * schibstedsokbot
- */
- SCHIBSTEDSOKBOT("schibstedsokbot", Pattern.compile("schibstedsokbot")),
-
- /**
- * ScollSpider
- */
- SCOLLSPIDER("ScollSpider", Pattern.compile("ScollSpider")),
-
- /**
- * Scooter
- */
- SCOOTER("Scooter", Pattern.compile("Scooter")),
-
- /**
- * ScoutJet
- */
- SCOUTJET("ScoutJet", Pattern.compile("ScoutJet")),
-
- /**
- * SeaMonkey
- */
- SEAMONKEY("SeaMonkey", Pattern.compile("SeaMonkey")),
-
- /**
- * Search Engine World Robots.txt Validator
- */
- SEARCH_ENGINE_WORLD_ROBOTS_TXT_VALIDATOR("Search Engine World Robots.txt Validator", Pattern
- .compile("Search Engine World Robots.txt Validator")),
-
- /**
- * search.KumKie.com
- */
- SEARCH_KUMKIE_COM("search.KumKie.com", Pattern.compile("search.KumKie.com")),
-
- /**
- * Search17Bot
- */
- SEARCH17BOT("Search17Bot", Pattern.compile("Search17Bot")),
-
- /**
- * Semager
- */
- SEMAGER("Semager", Pattern.compile("Semager")),
-
- /**
- * SEMC Browser
- */
- SEMC_BROWSER("SEMC Browser", Pattern.compile("SEMC Browser")),
-
- /**
- * SemrushBot
- */
- SEMRUSHBOT("SemrushBot", Pattern.compile("SemrushBot")),
-
- /**
- * Sensis Web Crawler
- */
- SENSIS_WEB_CRAWLER("Sensis Web Crawler", Pattern.compile("Sensis Web Crawler")),
-
- /**
- * SEODat
- */
- SEODAT("SEODat", Pattern.compile("SEODat")),
-
- /**
- * SEOENGBot
- */
- SEOENGBOT("SEOENGBot", Pattern.compile("SEOENGBot")),
-
- /**
- * SEOkicks-Robot
- */
- SEOKICKS_ROBOT("SEOkicks-Robot", Pattern.compile("SEOkicks-Robot")),
-
- /**
- * Setoozbot
- */
- SETOOZBOT("Setoozbot", Pattern.compile("Setoozbot")),
-
- /**
- * Seznam RSS reader
- */
- SEZNAM_RSS_READER("Seznam RSS reader", Pattern.compile("Seznam RSS reader")),
-
- /**
- * Seznam WAP Proxy
- */
- SEZNAM_WAP_PROXY("Seznam WAP Proxy", Pattern.compile("Seznam WAP Proxy")),
-
- /**
- * SeznamBot
- */
- SEZNAMBOT("SeznamBot", Pattern.compile("SeznamBot")),
-
- /**
- * SharpReader
- */
- SHARPREADER("SharpReader", Pattern.compile("SharpReader")),
-
- /**
- * Shelob
- */
- SHELOB("Shelob", Pattern.compile("Shelob")),
-
- /**
- * Shiira
- */
- SHIIRA("Shiira", Pattern.compile("Shiira")),
-
- /**
- * Shim-Crawler
- */
- SHIM_CRAWLER("Shim-Crawler", Pattern.compile("Shim-Crawler")),
-
- /**
- * ShopWiki
- */
- SHOPWIKI("ShopWiki", Pattern.compile("ShopWiki")),
-
- /**
- * ShowyouBot
- */
- SHOWYOUBOT("ShowyouBot", Pattern.compile("ShowyouBot")),
-
- /**
- * Shredder
- */
- SHREDDER("Shredder", Pattern.compile("Shredder")),
-
- /**
- * Siege
- */
- SIEGE("Siege", Pattern.compile("Siege")),
-
- /**
- * silk
- */
- SILK("Silk", Pattern.compile("silk", Pattern.CASE_INSENSITIVE)),
-
- /**
- * SimplePie
- */
- SIMPLEPIE("SimplePie", Pattern.compile("SimplePie")),
-
- /**
- * Sirketce/Busiverse
- */
- SIRKETCE_BUSIVERSE("Sirketce/Busiverse", Pattern.compile("Sirketce/Busiverse")),
-
- /**
- * sistrix
- */
- SISTRIX("sistrix", Pattern.compile("sistrix")),
-
- /**
- * Sitedomain-Bot
- */
- SITEDOMAIN_BOT("Sitedomain-Bot", Pattern.compile("Sitedomain-Bot")),
-
- /**
- * SiteKiosk
- */
- SITEKIOSK("SiteKiosk", Pattern.compile("SiteKiosk")),
-
- /**
- * SiteSucker
- */
- SITESUCKER("SiteSucker", Pattern.compile("SiteSucker")),
-
- /**
- * SkipStone
- */
- SKIPSTONE("SkipStone", Pattern.compile("SkipStone")),
-
- /**
- * SkreemRBot
- */
- SKREEMRBOT("SkreemRBot", Pattern.compile("SkreemRBot")),
-
- /**
- * Skyfire
- */
- SKYFIRE("Skyfire", Pattern.compile("Skyfire")),
-
- /**
- * Sleipnir
- */
- SLEIPNIR("Sleipnir", Pattern.compile("Sleipnir")),
-
- /**
- * SlimBoat
- */
- SLIMBOAT("SlimBoat", Pattern.compile("SlimBoat")),
-
- /**
- * SlimBrowser
- */
- SLIMBROWSER("SlimBrowser", Pattern.compile("SlimBrowser")),
-
- /**
- * smart.apnoti.com Robot
- */
- SMART_APNOTI_COM_ROBOT("smart.apnoti.com Robot", Pattern.compile("smart.apnoti.com Robot")),
-
- /**
- * snap.com
- */
- SNAP_COM("snap.com", Pattern.compile("snap.com")),
-
- /**
- * SnapBot
- */
- SNAPBOT("SnapBot", Pattern.compile("SnapBot")),
-
- /**
- * Snappy
- */
- SNAPPY("Snappy", Pattern.compile("Snappy")),
-
- /**
- * SniffRSS
- */
- SNIFFRSS("SniffRSS", Pattern.compile("SniffRSS")),
-
- /**
- * Snoopy
- */
- SNOOPY("Snoopy", Pattern.compile("Snoopy")),
-
- /**
- * Sogou
- */
- SOGOU("Sogou", Pattern.compile("Sogou")),
-
- /**
- * Sogou Explorer
- */
- SOGOU_EXPLORER("Sogou Explorer", Pattern.compile("Sogou Explorer")),
-
- /**
- * sogou spider
- */
- SOGOU_SPIDER("sogou spider", Pattern.compile("sogou spider")),
-
- /**
- * Songbird
- */
- SONGBIRD("Songbird", Pattern.compile("Songbird")),
-
- /**
- * Sosospider
- */
- SOSOSPIDER("Sosospider", Pattern.compile("Sosospider")),
-
- /**
- * Sparrow
- */
- SPARROW("Sparrow", Pattern.compile("Sparrow")),
-
- /**
- * spbot
- */
- SPBOT("spbot", Pattern.compile("spbot")),
-
- /**
- * Speedy
- */
- SPEEDY("Speedy Spider", Pattern.compile("Speedy Spider")),
-
- /**
- * Spicebird
- */
- SPICEBIRD("Spicebird", Pattern.compile("Spicebird")),
-
- /**
- * SpiderLing
- */
- SPIDERLING("SpiderLing", Pattern.compile("SpiderLing")),
-
- /**
- * Spinn3r
- */
- SPINN3R("Spinn3r", Pattern.compile("Spinn3r")),
-
- /**
- * Spock Crawler
- */
- SPOCK_CRAWLER("Spock Crawler", Pattern.compile("Spock Crawler")),
-
- /**
- * SpokeSpider
- */
- SPOKESPIDER("SpokeSpider", Pattern.compile("SpokeSpider")),
-
- /**
- * Sproose
- */
- SPROOSE("Sproose", Pattern.compile("Sproose")),
-
- /**
- * SrevBot
- */
- SREVBOT("SrevBot", Pattern.compile("SrevBot")),
-
- /**
- * SSLBot
- */
- SSLBOT("SSLBot", Pattern.compile("SSLBot")),
-
- /**
- * StackRambler
- */
- STACKRAMBLER("StackRambler", Pattern.compile("StackRambler")),
-
- /**
- * Stainless
- */
- STAINLESS("Stainless", Pattern.compile("Stainless")),
-
- /**
- * StatoolsBot
- */
- STATOOLSBOT("StatoolsBot", Pattern.compile("StatoolsBot")),
-
- /**
- * Steeler
- */
- STEELER("Steeler", Pattern.compile("Steeler")),
-
- /**
- * Strokebot
- */
- STROKEBOT("Strokebot", Pattern.compile("Strokebot")),
-
- /**
- * SubStream
- */
- SUBSTREAM("SubStream", Pattern.compile("SubStream")),
-
- /**
- * suggybot
- */
- SUGGYBOT("suggybot", Pattern.compile("suggybot")),
-
- /**
- * Summer
- */
- SUMMER("Summer", Pattern.compile("Summer")),
-
- /**
- * Sundance
- */
- SUNDANCE("Sundance", Pattern.compile("Sundance")),
-
- /**
- * Sundial
- */
- SUNDIAL("Sundial", Pattern.compile("Sundial")),
-
- /**
- * Sunrise
- */
- SUNRISE("Sunrise", Pattern.compile("Sunrise")),
-
- /**
- * SuperBot
- */
- SUPERBOT("SuperBot", Pattern.compile("SuperBot")),
-
- /**
- * Surf
- */
- SURF("Surf", Pattern.compile("Surf")),
-
- /**
- * Surphace Scout
- */
- SURPHACE_SCOUT("Surphace Scout", Pattern.compile("Surphace Scout")),
-
- /**
- * SurveyBot
- */
- SURVEYBOT("SurveyBot", Pattern.compile("SurveyBot")),
-
- /**
- * SWEBot
- */
- SWEBOT("SWEBot", Pattern.compile("SWEBot")),
-
- /**
- * Swiftfox
- */
- SWIFTFOX("Swiftfox", Pattern.compile("Swiftfox")),
-
- /**
- * Swiftweasel
- */
- SWIFTWEASEL("Swiftweasel", Pattern.compile("Swiftweasel")),
-
- /**
- * SygolBot
- */
- SYGOLBOT("SygolBot", Pattern.compile("SygolBot")),
-
- /**
- * SynooBot
- */
- SYNOOBOT("SynooBot", Pattern.compile("SynooBot")),
-
- /**
- * Szukacz
- */
- SZUKACZ("Szukacz", Pattern.compile("Szukacz")),
-
- /**
- * Szukankobot
- */
- SZUKANKOBOT("Szukankobot", Pattern.compile("Szukankobot")),
-
- /**
- * Tagoobot
- */
- TAGOOBOT("Tagoobot", Pattern.compile("Tagoobot")),
-
- /**
- * taptubot
- */
- TAPTUBOT("taptubot", Pattern.compile("taptubot")),
-
- /**
- * Tear
- */
- TEAR("Tear", Pattern.compile("Tear")),
-
- /**
- * TeaShark
- */
- TEASHARK("TeaShark", Pattern.compile("TeaShark")),
-
- /**
- * Technoratibot
- */
- TECHNORATIBOT("Technoratibot", Pattern.compile("Technoratibot")),
-
- /**
- * Teleport Pro
- */
- TELEPORT_PRO("Teleport Pro", Pattern.compile("Teleport Pro")),
-
- /**
- * TenFourFox
- */
- TENFOURFOX("TenFourFox", Pattern.compile("TenFourFox")),
-
- /**
- * TeragramCrawler
- */
- TERAGRAMCRAWLER("TeragramCrawler", Pattern.compile("TeragramCrawler")),
-
- /**
- * textractor
- */
- TEXTRACTOR("textractor", Pattern.compile("textractor")),
-
- /**
- * The Bat!
- */
- THE_BAT("The Bat!", Pattern.compile("The Bat!")),
-
- /**
- * Theophrastus
- */
- THEOPHRASTUS("Theophrastus", Pattern.compile("Theophrastus")),
-
- /**
- * TheWorld Browser
- */
- THEWORLD_BROWSER("TheWorld Browser", Pattern.compile("TheWorld Browser")),
-
- /**
- * Thumbnail.CZ robot
- */
- THUMBNAIL_CZ_ROBOT("Thumbnail.CZ robot", Pattern.compile("Thumbnail.CZ robot")),
-
- /**
- * ThumbShots-Bot
- */
- THUMBSHOTS_BOT("ThumbShots-Bot", Pattern.compile("ThumbShots-Bot")),
-
- /**
- * thumbshots-de-Bot
- */
- THUMBSHOTS_DE_BOT("thumbshots-de-Bot", Pattern.compile("thumbshots-de-Bot")),
-
- /**
- * Thumbshots.ru
- */
- THUMBSHOTS_RU("Thumbshots.ru", Pattern.compile("Thumbshots.ru")),
-
- /**
- * Thunderbird
- */
- THUNDERBIRD("Thunderbird", Pattern.compile("Thunderbird")),
-
- /**
- * TinEye
- */
- TINEYE("TinEye", Pattern.compile("TinEye")),
-
- /**
- * Tizen Browser
- */
- TIZEN_BROWSER("Tizen Browser", Pattern.compile("Tizen Browser")),
-
- /**
- * Tjusig
- */
- TJUSIG("Tjusig", Pattern.compile("Tjusig")),
-
- /**
- * Topicbot
- */
- TOPICBOT("Topicbot", Pattern.compile("Topicbot")),
-
- /**
- * Toread-Crawler
- */
- TOREAD_CRAWLER("Toread-Crawler", Pattern.compile("Toread-Crawler")),
-
- /**
- * Touche
- */
- TOUCHE("Touche", Pattern.compile("Touche")),
-
- /**
- * trendictionbot
- */
- TRENDICTIONBOT("trendictionbot", Pattern.compile("trendictionbot")),
-
- /**
- * Trileet NewsRoom
- */
- TRILEET_NEWSROOM("Trileet NewsRoom", Pattern.compile("Trileet NewsRoom")),
-
- /**
- * TT Explorer
- */
- TT_EXPLORER("TT Explorer", Pattern.compile("TT Explorer")),
-
- /**
- * Tulip Chain
- */
- TULIP_CHAIN("Tulip Chain", Pattern.compile("Tulip Chain")),
-
- /**
- * TurnitinBot
- */
- TURNITINBOT("TurnitinBot", Pattern.compile("TurnitinBot")),
-
- /**
- * TutorGigBot
- */
- TUTORGIGBOT("TutorGigBot", Pattern.compile("TutorGigBot")),
-
- /**
- * TwengaBot
- */
- TWENGABOT("TwengaBot", Pattern.compile("TwengaBot")),
-
- /**
- * Twiceler
- */
- TWICELER("Twiceler", Pattern.compile("Twiceler")),
-
- /**
- * Twikle
- */
- TWIKLE("Twikle", Pattern.compile("Twikle")),
-
- /**
- * Typhoeus
- */
- TYPHOEUS("Typhoeus", Pattern.compile("Typhoeus")),
-
- /**
- * UASlinkChecker
- */
- UASLINKCHECKER("UASlinkChecker", Pattern.compile("UASlinkChecker")),
-
- /**
- * UC Browser
- */
- UC_BROWSER("UC Browser", Pattern.compile("UC Browser")),
-
- /**
- * UltraBrowser
- */
- ULTRABROWSER("UltraBrowser ", Pattern.compile("UltraBrowser ")),
-
- /**
- * UnisterBot
- */
- UNISTERBOT("UnisterBot", Pattern.compile("UnisterBot")),
-
- /**
- * UnwindFetchor
- */
- UNWINDFETCHOR("UnwindFetchor", Pattern.compile("UnwindFetchor")),
-
- /**
- * updated
- */
- UPDATED("updated", Pattern.compile("updated")),
-
- /**
- * Updownerbot
- */
- UPDOWNERBOT("Updownerbot", Pattern.compile("Updownerbot")),
-
- /**
- * UptimeDog
- */
- UPTIMEDOG("UptimeDog", Pattern.compile("UptimeDog")),
-
- /**
- * UptimeRobot
- */
- UPTIMEROBOT("UptimeRobot", Pattern.compile("UptimeRobot")),
-
- /**
- * urlfan-bot
- */
- URLFAN_BOT("urlfan-bot", Pattern.compile("urlfan-bot")),
-
- /**
- * Urlfilebot (Urlbot)
- */
- URLFILEBOT("Urlfilebot (Urlbot)", Pattern.compile("Urlfilebot \\(Urlbot\\)")),
-
- /**
- * urlgrabber
- */
- URLGRABBER("urlgrabber", Pattern.compile("urlgrabber")),
-
- /**
- * Usejump
- */
- USEJUMP("Usejump", Pattern.compile("Usejump")),
-
- /**
- * uZard Web
- */
- UZARD_WEB("uZard Web", Pattern.compile("uZard Web")),
-
- /**
- * Uzbl
- */
- UZBL("Uzbl", Pattern.compile("Uzbl")),
-
- /**
- * Vagabondo
- */
- VAGABONDO("Vagabondo", Pattern.compile("Vagabondo")),
-
- /**
- * Validator.nu
- */
- VALIDATOR_NU("Validator.nu", Pattern.compile("Validator.nu")),
-
- /**
- * VERASYS 2k
- */
- VERASYS_2K("VERASYS 2k", Pattern.compile("VERASYS 2k")),
-
- /**
- * Vermut
- */
- VERMUT("Vermut", Pattern.compile("Vermut")),
-
- /**
- * Vespa Crawler
- */
- VESPA_CRAWLER("Vespa Crawler", Pattern.compile("Vespa Crawler")),
-
- /**
- * VideoSurf_bot
- */
- VIDEOSURF_BOT("VideoSurf_bot", Pattern.compile("VideoSurf_bot")),
-
- /**
- * virus_detector
- */
- VIRUS_DETECTOR("virus_detector", Pattern.compile("virus_detector")),
-
- /**
- * Vivaldi
- */
- VIVALDI("Vivaldi", Pattern.compile("Vivaldi")),
-
- /**
- * Visbot
- */
- VISBOT("Visbot", Pattern.compile("Visbot")),
-
- /**
- * VLC media player
- */
- VLC_MEDIA_PLAYER("VLC media player", Pattern.compile("VLC media player")),
-
- /**
- * VMBot
- */
- VMBOT("VMBot", Pattern.compile("VMBot")),
-
- /**
- * void-bot
- */
- VOID_BOT("void-bot", Pattern.compile("void-bot")),
-
- /**
- * VoilaBot
- */
- VOILABOT("OrangeBot", Pattern.compile("OrangeBot")),
-
- /**
- * Vonkeror
- */
- VONKEROR("Vonkeror", Pattern.compile("Vonkeror")),
-
- /**
- * VORTEX
- */
- VORTEX("VORTEX", Pattern.compile("VORTEX")),
-
- /**
- * voyager
- */
- VOYAGER("voyager", Pattern.compile("voyager")),
-
- /**
- * Vuze
- */
- VUZE("Vuze", Pattern.compile("Vuze")),
-
- /**
- * VWBot
- */
- VWBOT("VWBot", Pattern.compile("VWBot")),
-
- /**
- * W3C Checklink
- */
- W3C_CHECKLINK("W3C Checklink", Pattern.compile("W3C Checklink")),
-
- /**
- * W3C CSS Validator
- */
- W3C_CSS_VALIDATOR("W3C CSS Validator", Pattern.compile("W3C CSS Validator")),
-
- /**
- * W3C mobileOK Checker
- */
- W3C_MOBILEOK_CHECKER("W3C mobileOK Checker", Pattern.compile("W3C mobileOK Checker")),
-
- /**
- * W3C Validator
- */
- W3C_VALIDATOR("W3C Validator", Pattern.compile("W3C Validator")),
-
- /**
- * w3m
- */
- W3M("w3m", Pattern.compile("w3m")),
-
- /**
- * WapTiger
- */
- WAPTIGER("WapTiger", Pattern.compile("WapTiger")),
-
- /**
- * WASALive-Bot
- */
- WASALIVE_BOT("WASALive-Bot", Pattern.compile("WASALive-Bot")),
-
- /**
- * WatchMouse
- */
- WATCHMOUSE("WatchMouse", Pattern.compile("WatchMouse")),
-
- /**
- * WBSearchBot
- */
- WBSEARCHBOT("WBSearchBot", Pattern.compile("WBSearchBot")),
-
- /**
- * WDG CSSCheck
- */
- WDG_CSSCHECK("WDG CSSCheck", Pattern.compile("WDG CSSCheck")),
-
- /**
- * WDG Page Valet
- */
- WDG_PAGE_VALET("WDG Page Valet", Pattern.compile("Page Valet")),
-
- /**
- * WDG Validator
- */
- WDG_VALIDATOR("WDG Validator", Pattern.compile("WDG Validator")),
-
- /**
- * Web-sniffer
- */
- WEB_SNIFFER("Web-sniffer", Pattern.compile("Web-sniffer")),
-
- /**
- * WebAlta Crawler
- */
- WEBALTA_CRAWLER("WebAlta Crawler", Pattern.compile("WebAlta Crawler")),
-
- /**
- * WebarooBot
- */
- WEBAROOBOT("WebarooBot", Pattern.compile("WebarooBot")),
-
- /**
- * WebCollage
- */
- WEBCOLLAGE("WebCollage", Pattern.compile("WebCollage")),
-
- /**
- * WebCopier
- */
- WEBCOPIER("WebCopier", Pattern.compile("WebCopier")),
-
- /**
- * webfetch
- */
- WEBFETCH("webfetch", Pattern.compile("webfetch")),
-
- /**
- * webfs
- */
- WEBFS("webfs", Pattern.compile("webfs")),
-
- /**
- * Webian Shell
- */
- WEBIAN_SHELL("Webian Shell", Pattern.compile("Webian Shell")),
-
- /**
- * WebImages
- */
- WEBIMAGES("WebImages", Pattern.compile("WebImages")),
-
- /**
- * webinatorbot
- */
- WEBINATORBOT("webinatorbot", Pattern.compile("webinatorbot")),
-
- /**
- * webmastercoffee
- */
- WEBMASTERCOFFEE("webmastercoffee", Pattern.compile("webmastercoffee")),
-
- /**
- * WebNL
- */
- WEBNL("WebNL", Pattern.compile("WebNL")),
-
- /**
- * WebRankSpider
- */
- WEBRANKSPIDER("WebRankSpider", Pattern.compile("WebRankSpider")),
-
- /**
- * WebRender
- */
- WEBRENDER("WebRender", Pattern.compile("WebRender")),
-
- /**
- * Webscope Crawler
- */
- WEBSCOPE_CRAWLER("Webscope Crawler", Pattern.compile("Webscope Crawler")),
-
- /**
- * WebStripper
- */
- WEBSTRIPPER("WebStripper", Pattern.compile("WebStripper")),
-
- /**
- * WebWatch/Robot_txtChecker
- */
- WEBWATCH_ROBOT_TXT_CHECKER("WebWatch/Robot_txtChecker", Pattern.compile("WebWatch/Robot_txtChecker")),
-
- /**
- * WebZIP
- */
- WEBZIP("WebZIP", Pattern.compile("WebZIP")),
-
- /**
- * wectar
- */
- WECTAR("wectar", Pattern.compile("wectar")),
-
- /**
- * Weltweitimnetz Browser
- */
- WELTWEITIMNETZ_BROWSER("Weltweitimnetz Browser", Pattern.compile("Weltweitimnetz Browser")),
-
- /**
- * WeSEE:Search
- */
- WESEE_SEARCH("WeSEE:Search", Pattern.compile("WeSEE:Search")),
-
- /**
- * Wget
- */
- WGET("Wget", Pattern.compile("Wget")),
-
- /**
- * Whoismindbot
- */
- WHOISMINDBOT("Whoismindbot", Pattern.compile("Whoismindbot")),
-
- /**
- * WikioFeedBot
- */
- WIKIOFEEDBOT("WikioFeedBot", Pattern.compile("WikioFeedBot")),
-
- /**
- * wikiwix-bot
- */
- WIKIWIX_BOT("wikiwix-bot", Pattern.compile("wikiwix-bot")),
-
- /**
- * Willow Internet Crawler
- */
- WILLOW_INTERNET_CRAWLER("Willow Internet Crawler", Pattern.compile("Willow Internet Crawler")),
-
- /**
- * Winamp for Android
- */
- WINAMP_FOR_ANDROID("Winamp for Android", Pattern.compile("Winamp for Android")),
-
- /**
- * Windows Live Mail
- */
- WINDOWS_LIVE_MAIL("Windows Live Mail", Pattern.compile("Windows Live Mail")),
-
- /**
- * Windows Media Player
- */
- WINDOWS_MEDIA_PLAYER("Windows Media Player", Pattern.compile("Windows Media Player")),
-
- /**
- * WinHTTP
- */
- WINHTTP("WinHTTP", Pattern.compile("WinHTTP")),
-
- /**
- * WinkBot
- */
- WINKBOT("WinkBot", Pattern.compile("WinkBot")),
-
- /**
- * WinPodder
- */
- WINPODDER("WinPodder", Pattern.compile("WinPodder")),
-
- /**
- * WinWap
- */
- WINWAP("WinWap", Pattern.compile("WinWap")),
-
- /**
- * WinWebBot
- */
- WINWEBBOT("WinWebBot", Pattern.compile("WinWebBot")),
-
- /**
- * WIRE
- */
- WIRE("WIRE", Pattern.compile("WIRE")),
-
- /**
- * wKiosk
- */
- WKIOSK("wKiosk", Pattern.compile("wKiosk")),
-
- /**
- * WMCAI_robot
- */
- WMCAI_ROBOT("WMCAI_robot", Pattern.compile("WMCAI_robot")),
-
- /**
- * Woko
- */
- WOKO("Woko", Pattern.compile("Woko")),
-
- /**
- * WordPress pingback
- */
- WORDPRESS_PINGBACK("WordPress pingback", Pattern.compile("WordPress pingback")),
-
- /**
- * woriobot
- */
- WORIOBOT("woriobot", Pattern.compile("woriobot")),
-
- /**
- * WorldWideWeb
- */
- WORLDWIDEWEB("WorldWideWeb", Pattern.compile("WorldWideWeb")),
-
- /**
- * wOSBrowser
- */
- WOSBROWSER("wOSBrowser", Pattern.compile("wOSBrowser")),
-
- /**
- * Wotbox
- */
- WOTBOX("Wotbox", Pattern.compile("Wotbox")),
-
- /**
- * wsAnalyzer
- */
- WSANALYZER("wsAnalyzer", Pattern.compile("wsAnalyzer")),
-
- /**
- * www.fi crawler
- */
- WWW_FI_CRAWLER("www.fi crawler", Pattern.compile("www.fi crawler")),
-
- /**
- * WWW::Mechanize
- */
- WWW_MECHANIZE("WWW::Mechanize", Pattern.compile("WWW::Mechanize")),
-
- /**
- * wwwster
- */
- WWWSTER("wwwster", Pattern.compile("wwwster")),
-
- /**
- * Wyzo
- */
- WYZO("Wyzo", Pattern.compile("Wyzo")),
-
- /**
- * X-Smiles
- */
- X_SMILES("X-Smiles", Pattern.compile("X-Smiles")),
-
- /**
- * Xaldon WebSpider
- */
- XALDON_WEBSPIDER("Xaldon WebSpider", Pattern.compile("Xaldon WebSpider")),
-
- /**
- * XBMC
- */
- XBMC("XBMC", Pattern.compile("XBMC")),
-
- /**
- * Xenu
- */
- XENU("Xenu", Pattern.compile("Xenu")),
-
- /**
- * xine
- */
- XINE("xine", Pattern.compile("xine")),
-
- /**
- * XmarksFetch
- */
- XMARKSFETCH("XmarksFetch", Pattern.compile("XmarksFetch")),
-
- /**
- * XML-RPC for PHP
- */
- XML_RPC_FOR_PHP("XML-RPC for PHP", Pattern.compile("XML-RPC for PHP")),
-
- /**
- * XML-RPC for Ruby
- */
- XML_RPC_FOR_RUBY("XML-RPC for Ruby", Pattern.compile("XML-RPC for Ruby")),
-
- /**
- * XML Sitemaps Generator
- */
- XML_SITEMAPS_GENERATOR("XML Sitemaps Generator", Pattern.compile("XML Sitemaps Generator")),
-
- /**
- * XMPlay
- */
- XMPLAY("XMPlay", Pattern.compile("XMPlay")),
-
- /**
- * Yaanb
- */
- YAANB("Yaanb", Pattern.compile("Yaanb")),
-
- /**
- * yacybot
- */
- YACYBOT("yacybot", Pattern.compile("yacybot")),
-
- /**
- * Yahoo!
- */
- YAHOO("Yahoo!", Pattern.compile("Yahoo!")),
-
- /**
- * Yahoo Link Preview
- */
- YAHOO_LINK_PREVIEW("Yahoo Link Preview", Pattern.compile("Yahoo Link Preview")),
-
- /**
- * Yahoo! JAPAN
- */
- YAHOO_JAPAN("Yahoo! JAPAN", Pattern.compile("Yahoo! JAPAN")),
-
- /**
- * YahooFeedSeeker
- */
- YAHOOFEEDSEEKER("YahooFeedSeeker", Pattern.compile("YahooFeedSeeker")),
-
- /**
- * Yandex.Browser
- */
- YANDEX_BROWSER("Yandex.Browser", Pattern.compile("Yandex\\.Browser")),
-
- /**
- * YandexBot
- */
- YANDEXBOT("YandexBot", Pattern.compile("YandexBot")),
-
- /**
- * Yanga
- */
- YANGA("Yanga", Pattern.compile("Yanga")),
-
- /**
- * YeahReader
- */
- YEAHREADER("YeahReader", Pattern.compile("YeahReader")),
-
- /**
- * YioopBot
- */
- YIOOPBOT("YioopBot", Pattern.compile("YioopBot")),
-
- /**
- * YodaoBot
- */
- YODAOBOT("YodaoBot", Pattern.compile("YodaoBot")),
-
- /**
- * Yoono Bot
- */
- YOONO_BOT("Yoono Bot", Pattern.compile("Yoono Bot")),
-
- /**
- * YoudaoBot
- */
- YOUDAOBOT("YoudaoBot", Pattern.compile("YoudaoBot")),
-
- /**
- * YowedoBot
- */
- YOWEDOBOT("YowedoBot", Pattern.compile("YowedoBot")),
-
- /**
- * YRSpider
- */
- YRSPIDER("YRSpider", Pattern.compile("YRSpider")),
-
- /**
- * ZACATEK_CZ
- */
- ZACATEK_CZ("ZACATEK_CZ", Pattern.compile("ZACATEK_CZ")),
-
- /**
- * zBrowser
- */
- ZBROWSER("zBrowser", Pattern.compile("zBrowser")),
-
- /**
- * Zend_Http_Client
- */
- ZEND_HTTP_CLIENT("Zend_Http_Client", Pattern.compile("Zend_Http_Client")),
-
- /**
- * Zeusbot
- */
- ZEUSBOT("Zeusbot", Pattern.compile("Zeusbot")),
-
- /**
- * ZipZap
- */
- ZIPZAP("ZipZap", Pattern.compile("ZipZap")),
-
- /**
- * ZookaBot
- */
- ZOOKABOT("ZookaBot", Pattern.compile("ZookaBot(/\\d+(\\.\\d+)*)?", Pattern.CASE_INSENSITIVE)),
-
- /**
- * ZoomSpider (ZSEBOT)
- */
- ZOOMSPIDER("ZoomSpider (ZSEBOT)", Pattern.compile("ZoomSpider \\(ZSEBOT\\)")),
-
- /**
- * ZyBorg
- */
- ZYBORG("ZyBorg", Pattern.compile("ZyBorg"));
-
- /**
- * This method try to find by the given family name a matching enum value. The family name must match against an
- * user agent entry in UAS data file.
- *
- * @param family
- * name of an user agent family
- * @return the matching enum value or {@code UserAgentFamily#UNKNOWN}
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if the given argument is {@code null}
- */
- @Nonnull
- public static UserAgentFamily evaluate(@Nonnull final String family) {
- Check.notNull(family, "family");
-
- UserAgentFamily result = UNKNOWN;
-
- // search by name
- result = evaluateByName(family);
-
- // search by pattern
- if (result == UNKNOWN) {
- result = evaluateByPattern(family);
- }
-
- return result;
- }
-
- /**
- * This method try to find by the given family name a matching enum value. The family name will be evaluated against
- * the stored name of an user agent entry.
- *
- * @param family
- * name of an user agent family
- * @return the matching enum value or {@code UserAgentFamily#UNKNOWN}
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if the given argument is {@code null}
- */
- @Nonnull
- protected static UserAgentFamily evaluateByName(@Nonnull final String family) {
- Check.notNull(family, "family");
-
- UserAgentFamily result = UNKNOWN;
- for (final UserAgentFamily value : values()) {
- if (value.getName().equalsIgnoreCase(family)) {
- result = value;
- break;
- }
- }
-
- return result;
- }
-
- /**
- * This method try to find by the given family name a matching enum value. The family name will be evaluated against
- * the stored regular expression of an user agent entry.
- *
- * @param family
- * name of an user agent family
- * @return the matching enum value or {@code UserAgentFamily#UNKNOWN}
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if the given argument is {@code null}
- */
- @Nonnull
- protected static UserAgentFamily evaluateByPattern(@Nonnull final String family) {
- Check.notNull(family, "family");
-
- UserAgentFamily result = UNKNOWN;
- for (final UserAgentFamily value : values()) {
- final Matcher m = value.getPattern().matcher(family);
- if (m.matches()) {
- result = value;
- break;
- }
- }
-
- return result;
- }
-
- /**
- * The internal family name in the UAS database.
- */
- @Nonnull
- private final String name;
-
- /**
- * The regular expression which a family name must be match.
- */
- @Nonnull
- private final Pattern pattern;
-
- private UserAgentFamily(@Nonnull final String name, @Nonnull final Pattern pattern) {
- this.name = name;
- this.pattern = pattern;
- }
-
- /**
- * Gets the internal family name in the UAS database.
- *
- * @return the internal family name
- */
- @Nonnull
- public String getName() {
- return this.name;
- }
-
- /**
- * Gets the regular expression which a family name must be match with.
- *
- * @return regular expression
- */
- @Nonnull
- public Pattern getPattern() {
- return pattern;
- }
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/UserAgentStringParser.java b/app/src/main/java/net/sf/uadetector/UserAgentStringParser.java
deleted file mode 100644
index 79cc6b5..0000000
--- a/app/src/main/java/net/sf/uadetector/UserAgentStringParser.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright 2012 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector;
-
-import javax.annotation.PreDestroy;
-
-/**
- * Basic interface for user agent string parsers.
- *
- * @author André Rouél
- */
-public interface UserAgentStringParser {
-
- /**
- * Returns the current version information of the used UAS data.
- *
- *
- * The version will be set by the UAS data provider (http://user-agent-string.info/) and the version should
- * look like this:
- * For example, if a web application with UADetector will be re-deployed within an Apache Tomcat you must
- * shutdown your self-created or via
- * An implementation of
- * If you call shutdown on a non-updating
- * A number of Dependency Injection containers support the annotation {@link PreDestroy} which is be useful for
- * indicating methods that should be called when the container is shutting down. This annotation is available by
- * default in Java SE 7 and can be made available through the external library jsr250-api-1.0.jar for earlier
- * versions of Java.
- *
- * We recommend to annotate an implementation of {@link #shutdown()} with {@link PreDestroy} to inform a container
- * (for example Spring Framework) to trigger the shutdown method automatically by convention during the
- * shutdown lifecycle. This saves developers to call explicitly the shutdown method.
- *
- * To shutdown all managed {@code ExecutorService} by UADetector at once, you can call also
- * {@link net.sf.uadetector.internal.util.ExecutorServices#shutdownAll()}.
- */
- void shutdown();
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/UserAgentType.java b/app/src/main/java/net/sf/uadetector/UserAgentType.java
deleted file mode 100644
index 9bdda7d..0000000
--- a/app/src/main/java/net/sf/uadetector/UserAgentType.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright 2012 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector;
-
-import javax.annotation.Nonnull;
-
-import net.sf.qualitycheck.Check;
-import net.sf.uadetector.internal.data.domain.Robot;
-
-/**
- * This enum represents the type of an user agent. The assignment to a type is performed within the UAS data.
- *
- * @author André Rouél
- */
-public enum UserAgentType {
-
- /**
- * A web browser, especially on a desktop, notebook or workstation
- */
- BROWSER("Browser"),
-
- /**
- * An email client, email reader
- */
- EMAIL_CLIENT("Email client"),
-
- /**
- * A news aggregator, also termed a feed aggregator, feed reader, news reader, RSS
- * reader or simply aggregator
- */
- FEED_READER("Feed Reader"),
-
- /**
- * A library is a collection of resources used to develop software.
- */
- LIBRARY("Library"),
-
- /**
- * Media player, also called multimedia player, is a term typically used to describe computer software for playing
- * back multimedia files.
- */
- MEDIAPLAYER("Multimedia Player"),
-
- /**
- * A mobile browser, also called a microbrowser, minibrowser, or wireless internet browser (WIB), is a web browser
- * designed for use on a mobile device.
- */
- MOBILE_BROWSER("Mobile Browser"),
-
- /**
- * Offline browser which may download completely or partially a website to a hard drive
- */
- OFFLINE_BROWSER("Offline Browser"),
-
- /**
- * A software that doesn't match the other types
- */
- OTHER("Other"),
-
- /**
- * Bots, such as Web crawlers
- */
- ROBOT(Robot.TYPENAME),
-
- /**
- * An unknown user agent type
- */
- UNKNOWN(""),
-
- /**
- * A software to hide the real user agent information
- */
- USERAGENT_ANONYMIZER("Useragent Anonymizer"),
-
- /**
- * A software or service that validates parts of a website or webservice, such as CSS, HTML, JSON, XML
- */
- VALIDATOR("Validator"),
-
- /**
- * A WAP browser is a web browser for mobile devices such as mobile phones that uses the Wireless Application
- * Protocol (WAP). WAP is a technical standard for accessing information over a mobile wireless network.
- */
- WAP_BROWSER("Wap Browser");
-
- /**
- * This method try to find by the given type name a matching enum value. The type name must match against an user
- * agent entry in UAS data file.
- *
- * @param typeName
- * name of an user agent type
- * @return the matching enum value or {@code UserAgentType#UNKNOWN}
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if the given argument is {@code null}
- */
- public static UserAgentType evaluateByTypeName(@Nonnull final String typeName) {
- Check.notNull(typeName, "typeName");
-
- UserAgentType result = UNKNOWN;
- for (final UserAgentType value : values()) {
- if (value.getName().equals(typeName)) {
- result = value;
- break;
- }
- }
- return result;
- }
-
- /**
- * Name of the user agent type
- */
- @Nonnull
- private final String name;
-
- private UserAgentType(@Nonnull final String name) {
- this.name = name;
- }
-
- /**
- * Returns the name of the user agent type.
- *
- * @return name of the type
- */
- @Nonnull
- public String getName() {
- return name;
- }
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/VersionNumber.java b/app/src/main/java/net/sf/uadetector/VersionNumber.java
deleted file mode 100644
index 3e941ee..0000000
--- a/app/src/main/java/net/sf/uadetector/VersionNumber.java
+++ /dev/null
@@ -1,435 +0,0 @@
-/*******************************************************************************
- * Copyright 2012 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.regex.Pattern;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-import net.sf.qualitycheck.Check;
-import net.sf.qualitycheck.exception.IllegalStateOfArgumentException;
-import net.sf.uadetector.internal.util.AlphanumComparator;
-
-/**
- * The {@code VersionNumber} class represents the version number of an operating system or User-Agent.
- * The implementing class must ensure that no error leads to a termination of this operation. In case of an error
- * this operation must return {@link Data#EMPTY} and all error information must be stored in a log.
- *
- * @param url
- * the URL where the UAS data can be retrieved
- * @param charset
- * the character set in which the data should be read
- * @return read in UAS data as new {@code Data} instance or {@link Data#EMPTY}
- */
- Data read(final URL url, final Charset charset);
-
- /**
- * Reads UAS data from the given {@code String}.
- *
- *
- * The implementing class must ensure that no error leads to a termination of this operation. In case of an error
- * this operation must return {@link Data#EMPTY} and all error information must be stored in a log.
- *
- * @param data
- * a string of UAS data
- * @return read in UAS data as new {@code Data} instance or {@link Data#EMPTY}
- */
- Data read(final String data);
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/datareader/XmlDataReader.java b/app/src/main/java/net/sf/uadetector/datareader/XmlDataReader.java
deleted file mode 100644
index 058ecdd..0000000
--- a/app/src/main/java/net/sf/uadetector/datareader/XmlDataReader.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*******************************************************************************
- * Copyright 2012 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector.datareader;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.nio.charset.Charset;
-
-import javax.annotation.Nonnull;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import net.sf.qualitycheck.Check;
-import net.sf.uadetector.exception.CanNotOpenStreamException;
-import net.sf.uadetector.internal.data.Data;
-import net.sf.uadetector.internal.data.DataBuilder;
-import net.sf.uadetector.internal.data.XmlDataHandler;
-import net.sf.uadetector.internal.util.Closeables;
-import net.sf.uadetector.internal.util.UrlUtil;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xml.sax.SAXException;
-
-/**
- * Reader for the XML data for UASparser from http://user-agent-string.info.
- * Such a store must always have an usable instance of {@link Data} and should be initialized with the supplied UAS file
- * in the uadetector-resources module.
- *
- * @author André Rouél
- */
-public abstract class AbstractRefreshableDataStore implements RefreshableDataStore {
-
- /**
- * Corresponding default logger for this class
- */
- private static final Logger LOG = LoggerFactory.getLogger(AbstractRefreshableDataStore.class);
-
- /**
- * Runtime check that the passed instance of {@link Data} is not empty (respectively {@link Data#EMPTY}).
- *
- * @param data
- * instance of {@code Data}
- * @throws net.sf.qualitycheck.exception.IllegalStateOfArgumentException
- * if the passed instance is empty
- */
- private static Data checkData(final Data data) {
- if (Data.EMPTY.equals(data)) {
- throw new IllegalStateOfArgumentException("Argument 'data' must not be empty.");
- }
- return data;
- }
-
- /**
- * Current the character set in which the UAS data will be read
- */
- private final Charset charset;
-
- /**
- * Current UAS data
- */
- private Data data;
-
- /**
- * The {@code URL} to get UAS data
- */
- private final URL dataUrl;
-
- /**
- * Default data store which will be used during initialization of a {@code DataStore} and can be used in emergency
- * cases.
- */
- private final DataStore fallback;
-
- /**
- * The data reader to read in UAS data
- */
- private final DataReader reader;
-
- /**
- * Update operation which runs itself in background (non-blocking)
- */
- private UpdateOperation updateOperation = new UpdateOperationTask(this);
-
- /**
- * The {@code URL} to get the latest version information of UAS data
- */
- private final URL versionUrl;
-
- /**
- * Constructs an {@code AbstractDataStore} by reading the given {@code dataUrl} as UAS data.
- *
- * @param reader
- * data reader to read the given {@code dataUrl}
- * @param dataUrl
- * URL to UAS data
- * @param versionUrl
- * URL to version information about the given UAS data
- * @param charset
- * the character set in which the data should be read
- * @param fallback
- * UAS data as fallback in case the data on the specified resource can not be read correctly
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if one of the given arguments is {@code null}
- * @throws net.sf.qualitycheck.exception.IllegalStateOfArgumentException
- * if the given strings are not valid URLs
- */
- protected AbstractRefreshableDataStore(@Nonnull final DataReader reader, @Nonnull final String dataUrl,
- @Nonnull final String versionUrl, @Nonnull final Charset charset, @Nonnull final DataStore fallback) {
- this(reader, UrlUtil.build(dataUrl), UrlUtil.build(versionUrl), charset, fallback);
- }
-
- /**
- * Constructs an {@code AbstractDataStore} by reading the given {@code dataUrl} as UAS data.
- *
- * @param reader
- * data reader to read the given {@code dataUrl}
- * @param dataUrl
- * URL to UAS data
- * @param versionUrl
- * URL to version information about the given UAS data
- * @param charset
- * the character set in which the data should be read
- * @param fallback
- * UAS data as fallback in case the data on the specified resource can not be read correctly
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if the given argument is {@code null}
- * @throws net.sf.qualitycheck.exception.IllegalStateOfArgumentException
- * if the created instance of {@link Data} is empty
- */
- protected AbstractRefreshableDataStore(@Nonnull final DataReader reader, @Nonnull final URL dataUrl, @Nonnull final URL versionUrl,
- @Nonnull final Charset charset, final DataStore fallback) {
- Check.notNull(reader, "reader");
- Check.notNull(charset, "charset");
- Check.notNull(dataUrl, "dataUrl");
- Check.notNull(versionUrl, "versionUrl");
- Check.notNull(fallback, "fallback");
-
- this.reader = reader;
- this.dataUrl = dataUrl;
- this.versionUrl = versionUrl;
- this.charset = charset;
- this.fallback = fallback;
-
- data = checkData(fallback.getData());
- }
-
- @Override
- public Charset getCharset() {
- return charset;
- }
-
- @Override
- public Data getData() {
- return data;
- }
-
- @Override
- public DataReader getDataReader() {
- return reader;
- }
-
- @Override
- public URL getDataUrl() {
- return dataUrl;
- }
-
- @Override
- public DataStore getFallback() {
- return fallback;
- }
-
- @Override
- public UpdateOperation getUpdateOperation() {
- return updateOperation;
- }
-
- @Override
- public URL getVersionUrl() {
- return versionUrl;
- }
-
- /**
- * Triggers the update of the
- * Attention: This method is implemented as background task. You can not assume that you immediately get an
- * updated data store.
- */
- @Override
- public void refresh() {
- try {
- updateOperation.run();
- } catch (final CanNotOpenStreamException e) {
- LOG.warn(String.format(MSG_URL_NOT_READABLE, e.getLocalizedMessage()));
- } catch (final IllegalArgumentException e) {
- LOG.warn(MSG_FAULTY_CONTENT + " " + e.getLocalizedMessage());
- } catch (final RuntimeException e) {
- LOG.warn(MSG_FAULTY_CONTENT, e);
- }
- }
-
- /**
- * Sets new UAS data in the store.
- *
- * @param data
- * UAS data to override the current ({@code null} is not allowed)
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if the given argument is {@code null}
- * @throws net.sf.qualitycheck.exception.IllegalStateOfArgumentException
- * if the given instance of {@code Data} is empty
- */
- protected void setData(@Nonnull final Data data) {
- Check.notNull(data, "data");
-
- this.data = checkData(data);
-
- // add some useful UAS data informations to the log
- if (LOG.isDebugEnabled()) {
- LOG.debug(data.toStats());
- }
- }
-
- /**
- * Sets a new update operation.
- *
- * @param updateOperation
- * operation to override the current ({@code null} is not allowed)
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if the given argument is {@code null}
- */
- protected void setUpdateOperation(@Nonnull final UpdateOperation updateOperation) {
- Check.notNull(updateOperation, "updateOperation");
- this.updateOperation = updateOperation;
- }
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/datastore/AbstractUpdateOperation.java b/app/src/main/java/net/sf/uadetector/datastore/AbstractUpdateOperation.java
deleted file mode 100644
index 26d3b52..0000000
--- a/app/src/main/java/net/sf/uadetector/datastore/AbstractUpdateOperation.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*******************************************************************************
- * Copyright 2013 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector.datastore;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.LineNumberReader;
-import java.net.URL;
-import java.nio.charset.Charset;
-import java.util.concurrent.ExecutorService;
-import java.util.regex.Pattern;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-import net.sf.qualitycheck.Check;
-import net.sf.uadetector.internal.util.ExecutorServices;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Provides a basic implementation to update UAS data in the background when calling {@link #run()}.
- *
- * @author André Rouél
- */
-public abstract class AbstractUpdateOperation implements UpdateOperation {
-
- /**
- * Defines an empty version string
- */
- private static final String EMPTY_VERSION = "";
-
- /**
- * Corresponding default logger for this class
- */
- private static final Logger LOG = LoggerFactory.getLogger(AbstractUpdateOperation.class);
-
- /**
- * Message for the log when no update is available.
- * Attentation: During initialization the fallback data store will be used and the remote data will be read in
- * background (non-blocking).
- *
- * @author André Rouél
- */
-public final class OnlineXmlDataStore extends AbstractRefreshableDataStore {
-
- /**
- * The default data reader to read in UAS data in XML format
- */
- private static final DataReader DEFAULT_DATA_READER = new XmlDataReader();
-
- /**
- * Constructs an {@code OnlineXmlDataStore} by reading UAS data by the specified default URL
- * {@link DataStore#DEFAULT_DATA_URL} (in XML format).
- *
- * @param fallback
- * UAS data as fallback in case the data on the specified resource can not be read correctly
- */
- @Deprecated
- public OnlineXmlDataStore(final DataStore fallback) {
- super(DEFAULT_DATA_READER, DEFAULT_DATA_URL, DEFAULT_VERSION_URL, DEFAULT_CHARSET, fallback);
- }
-
- /**
- * Constructs an {@code OnlineXmlDataStore} by reading UAS data by the specified URL (in XML format).
- * @param dataurl
- * @param versionUrl
- * @param fallback
- */
- public OnlineXmlDataStore(final URL dataurl, final URL versionUrl, final DataStore fallback) {
- super(DEFAULT_DATA_READER, dataurl, versionUrl, DEFAULT_CHARSET, fallback);
- }
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/datastore/RefreshableDataStore.java b/app/src/main/java/net/sf/uadetector/datastore/RefreshableDataStore.java
deleted file mode 100644
index 68bf001..0000000
--- a/app/src/main/java/net/sf/uadetector/datastore/RefreshableDataStore.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright 2012 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector.datastore;
-
-import javax.annotation.Nonnull;
-
-/**
- * Extends the interface with an update functionality for UAS data in the store.
- *
- * @author André Rouél
- */
-public interface RefreshableDataStore extends DataStore {
-
- /**
- * Message for the log if the read content can not be processed correctly
- */
- String MSG_FAULTY_CONTENT = "The read content is faulty and can not be processed correctly.";
-
- /**
- * Message for the log if the UAS data can not be read from the given URL
- */
- String MSG_URL_NOT_READABLE = "The data can not be read from the specified URL: %s";
-
- /**
- * This method returns a data store which will be used during start up and can be used in emergency cases.
- *
- * This data store will be used instantly during initialization to avoid long initializations times of an
- * {@link net.sf.uadetector.UserAgentStringParser}, especially when reading data by a network connection.
- */
- @Nonnull
- DataStore getFallback();
-
- /**
- * Returns the update operation of this data store which can be triggered within an executor service.
- *
- * @return an update operation
- */
- @Nonnull
- UpdateOperation getUpdateOperation();
-
- /**
- * Triggers the update of the {@code DataStore}. When this action is executed, the current data URL will be read in
- * and the {@code DataReader} parses and builds a new {@code Data} instance. Finally, the currently set {@code Data}
- * reference will be replaced by the new one.
- */
- void refresh();
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/datastore/SimpleXmlDataStore.java b/app/src/main/java/net/sf/uadetector/datastore/SimpleXmlDataStore.java
deleted file mode 100644
index 8b2deb2..0000000
--- a/app/src/main/java/net/sf/uadetector/datastore/SimpleXmlDataStore.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright 2013 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector.datastore;
-
-import java.net.URL;
-
-import net.sf.uadetector.datareader.DataReader;
-import net.sf.uadetector.datareader.XmlDataReader;
-
-/**
- * This is the simplest implementation of a {@link DataStore}. It initialize the store by reading the UAS data
- * via the passed URL and store it only in the Java heap space.
- *
- *
- * The given resource must have a valid XML format with UTF-8 charset that validates against specified schema under http://data.udger.com/uasxmldata_old.dtd.
- *
- * @author André Rouél
- */
-public final class SimpleXmlDataStore extends AbstractDataStore implements DataStore {
-
- /**
- * The default data reader to read in UAS data in XML format
- */
- private static final DataReader DEFAULT_DATA_READER = new XmlDataReader();
-
- /**
- * Constructs an {@code SimpleXmlDataStore} by reading UAS data by the specified default URL
- * {@link DataStore#DEFAULT_DATA_URL} (in XML format).
- *
- * @param dataUrl
- * URL to UAS data
- * @param versionUrl
- * URL to version information about the given UAS data
- */
- public SimpleXmlDataStore(final URL dataUrl, final URL versionUrl) {
- super(DEFAULT_DATA_READER, dataUrl, versionUrl, DEFAULT_CHARSET);
- }
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/datastore/UpdateOperation.java b/app/src/main/java/net/sf/uadetector/datastore/UpdateOperation.java
deleted file mode 100644
index ee65cf5..0000000
--- a/app/src/main/java/net/sf/uadetector/datastore/UpdateOperation.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright 2013 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector.datastore;
-
-import javax.annotation.Nonnegative;
-
-/**
- * Defines an update operation which will be executed within a executor service in background.
- *
- * @author André Rouél
- */
-public interface UpdateOperation extends Runnable {
-
- /**
- * The default interval to check for updates is once per day
- */
- @Nonnegative
- long DEFAULT_UPDATE_INTERVAL = 1000 * 60 * 60 * 24;
-
- /**
- * This function checks whether updated UAS data are available and updates silently the data in a
- * {@link net.sf.uadetector.datastore.DataStore}.
- */
- void call();
-
- /**
- * Gets the time of the last update check in milliseconds.
- *
- * @return time of the last update check in milliseconds
- */
- @Nonnegative
- long getLastUpdateCheck();
-
- /**
- * Shuts down the corresponding background executor.
- */
- void shutdown();
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/datastore/UpdateOperationTask.java b/app/src/main/java/net/sf/uadetector/datastore/UpdateOperationTask.java
deleted file mode 100644
index 1cd6d7d..0000000
--- a/app/src/main/java/net/sf/uadetector/datastore/UpdateOperationTask.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright 2013 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector.datastore;
-
-import net.sf.uadetector.internal.data.Data;
-
-final class UpdateOperationTask extends AbstractUpdateOperation {
-
- /**
- * The data store for instances that implements {@link net.sf.uadetector.internal.data.Data}
- */
- private final AbstractRefreshableDataStore store;
-
- public UpdateOperationTask(final AbstractRefreshableDataStore dataStore) {
- super(dataStore);
- store = dataStore;
- }
-
- @Override
- public void call() {
- if (isUpdateAvailable()) {
- final Data data = store.getDataReader().read(store.getDataUrl(), store.getCharset());
- store.setData(data);
- }
- }
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/datastore/UpdateOperationWithCacheFileTask.java b/app/src/main/java/net/sf/uadetector/datastore/UpdateOperationWithCacheFileTask.java
deleted file mode 100644
index 07b0f84..0000000
--- a/app/src/main/java/net/sf/uadetector/datastore/UpdateOperationWithCacheFileTask.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*******************************************************************************
- * Copyright 2013 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector.datastore;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.URL;
-import java.nio.charset.Charset;
-
-import javax.annotation.Nonnull;
-
-import net.sf.qualitycheck.Check;
-import net.sf.uadetector.exception.CanNotOpenStreamException;
-import net.sf.uadetector.internal.data.Data;
-import net.sf.uadetector.internal.util.Closeables;
-import net.sf.uadetector.internal.util.FileUtil;
-import net.sf.uadetector.internal.util.UrlUtil;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-final class UpdateOperationWithCacheFileTask extends AbstractUpdateOperation {
-
- /**
- * Corresponding default logger of this class
- */
- private static final Logger LOG = LoggerFactory.getLogger(UpdateOperationWithCacheFileTask.class);
-
- /**
- * Message for the log when issues occur during reading of or writing to the cache file.
- */
- private static final String MSG_CACHE_FILE_ISSUES = "Issues occured during reading of or writing to the cache file: %s";
-
- /**
- * Message for the log if the passed resources are the same and an update makes no sense
- */
- private static final String MSG_SAME_RESOURCES = "The passed URL and file resources are the same. An update was not performed.";
-
- /**
- * Creates a temporary file near the passed file. The name of the given one will be used and the suffix ".temp" will
- * be added.
- *
- * @param file
- * file in which the entire contents from the given URL can be saved
- * @throws IllegalStateException
- * if the file can not be deleted
- */
- protected static File createTemporaryFile(@Nonnull final File file) {
- Check.notNull(file, "file");
-
- final File tempFile = new File(file.getParent(), file.getName() + ".temp");
-
- // remove orphaned temporary file
- deleteFile(tempFile);
-
- return tempFile;
- }
-
- /**
- * Removes the given file.
- *
- * @param file
- * a file which should be deleted
- *
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if the given argument is {@code null}
- * @throws net.sf.qualitycheck.exception.IllegalStateOfArgumentException
- * if the file can not be deleted
- */
- protected static void deleteFile(@Nonnull final File file) {
- Check.notNull(file, "file");
- Check.stateIsTrue(!file.exists() || file.delete(), "Cannot delete file '%s'.", file.getPath());
- }
-
- /**
- * Checks if the given file is empty.
- *
- * @param file
- * the file that could be empty
- * @return {@code true} when the file is accessible and empty otherwise {@code false}
- * @throws IllegalStateException
- * if an I/O error occurs
- */
- private static boolean isEmpty(@Nonnull final File file, @Nonnull final Charset charset) {
- try {
- return FileUtil.isEmpty(file, charset);
- } catch (final IOException e) {
- throw new IllegalStateException("The given file could not be read.");
- }
- }
-
- /**
- * Checks that {@code older} {@link Data} has a lower version number than the {@code newer} one.
- *
- * @param older
- * possibly older {@code Data}
- * @param newer
- * possibly newer {@code Data}
- * @return {@code true} if the {@code newer} Data is really newer, otherwise {@code false}
- */
- protected static boolean isNewerData(@Nonnull final Data older, @Nonnull final Data newer) {
- return newer.getVersion().compareTo(older.getVersion()) > 0;
- }
-
- /**
- * Reads the content from the given {@link URL} and saves it to the passed file.
- *
- * @param file
- * file in which the entire contents from the given URL can be saved
- * @param store
- * a data store for UAS data
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if any of the passed arguments is {@code null}
- * @throws IOException
- * if an I/O error occurs
- */
- protected static void readAndSave(@Nonnull final File file, @Nonnull final DataStore store) throws IOException {
- Check.notNull(file, "file");
- Check.notNull(store, "store");
-
- final URL url = store.getDataUrl();
- final Charset charset = store.getCharset();
-
- final boolean isEqual = url.toExternalForm().equals(UrlUtil.toUrl(file).toExternalForm());
- if (!isEqual) {
-
- // check if the data can be read in successfully
- final String data = UrlUtil.read(url, charset);
- if (Data.EMPTY.equals(store.getDataReader().read(data))) {
- throw new IllegalStateException("The read in content can not be transformed to an instance of 'Data'.");
- }
-
- final File tempFile = createTemporaryFile(file);
-
- FileOutputStream outputStream = null;
- boolean threw = true;
- try {
- // write data to temporary file
- outputStream = new FileOutputStream(tempFile);
- outputStream.write(data.getBytes(charset));
-
- // delete the original file
- deleteFile(file);
-
- threw = false;
- } finally {
- Closeables.close(outputStream, threw);
- }
-
- // rename the new file to the original one
- renameFile(tempFile, file);
- } else {
- LOG.debug(MSG_SAME_RESOURCES);
- }
- }
-
- /**
- * Renames the given file {@code from} to the new file {@code to}.
- *
- * @param from
- * an existing file
- * @param to
- * a new file
- *
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if one of the given arguments is {@code null}
- * @throws net.sf.qualitycheck.exception.IllegalStateOfArgumentException
- * if the file can not be renamed
- */
- protected static void renameFile(@Nonnull final File from, @Nonnull final File to) {
- Check.notNull(from, "from");
- Check.stateIsTrue(from.exists(), "Argument 'from' must not be an existing file.");
- Check.notNull(to, "to");
- Check.stateIsTrue(from.renameTo(to), "Renaming file from '%s' to '%s' failed.", from.getAbsolutePath(), to.getAbsolutePath());
- }
-
- /**
- * File to cache read in UAS data
- */
- private final File cacheFile;
-
- /**
- * The data store for instances that implements {@link net.sf.uadetector.internal.data.Data}
- */
- private final AbstractRefreshableDataStore store;
-
- public UpdateOperationWithCacheFileTask(@Nonnull final AbstractRefreshableDataStore dataStore, @Nonnull final File cacheFile) {
- super(dataStore);
- Check.notNull(dataStore, "dataStore");
- Check.notNull(cacheFile, "cacheFile");
- store = dataStore;
- this.cacheFile = cacheFile;
- }
-
- @Override
- public void call() {
- readDataIfNewerAvailable();
- }
-
- private boolean isCacheFileEmpty() {
- return isEmpty(cacheFile, store.getCharset());
- }
-
- private void readDataIfNewerAvailable() {
- try {
- if (isUpdateAvailable() || isCacheFileEmpty()) {
- readAndSave(cacheFile, store);
- store.setData(store.getDataReader().read(cacheFile.toURI().toURL(), store.getCharset()));
- }
- } catch (final CanNotOpenStreamException e) {
- LOG.warn(String.format(RefreshableDataStore.MSG_URL_NOT_READABLE, e.getLocalizedMessage()));
- readFallbackData();
- } catch (final RuntimeException e) {
- LOG.warn(RefreshableDataStore.MSG_FAULTY_CONTENT, e);
- readFallbackData();
- } catch (final IOException e) {
- LOG.warn(String.format(MSG_CACHE_FILE_ISSUES, e.getLocalizedMessage()), e);
- readFallbackData();
- }
- }
-
- private void readFallbackData() {
- LOG.info("Reading fallback data...");
- try {
- if (isCacheFileEmpty()) {
- readAndSave(cacheFile, store.getFallback());
- final Data data = store.getDataReader().read(cacheFile.toURI().toURL(), store.getCharset());
- if (isNewerData(store.getData(), data)) {
- store.setData(data);
- }
- }
- } catch (final CanNotOpenStreamException e) {
- LOG.warn(String.format(RefreshableDataStore.MSG_URL_NOT_READABLE, e.getLocalizedMessage()));
- } catch (final RuntimeException e) {
- LOG.warn(RefreshableDataStore.MSG_FAULTY_CONTENT, e);
- } catch (final IOException e) {
- LOG.warn(String.format(MSG_CACHE_FILE_ISSUES, e.getLocalizedMessage()), e);
- }
- }
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/datastore/package-info.java b/app/src/main/java/net/sf/uadetector/datastore/package-info.java
deleted file mode 100644
index 62e253d..0000000
--- a/app/src/main/java/net/sf/uadetector/datastore/package-info.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright 2012 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-@javax.annotation.ParametersAreNonnullByDefault
-package net.sf.uadetector.datastore;
diff --git a/app/src/main/java/net/sf/uadetector/exception/CanNotOpenStreamException.java b/app/src/main/java/net/sf/uadetector/exception/CanNotOpenStreamException.java
deleted file mode 100644
index d8d8def..0000000
--- a/app/src/main/java/net/sf/uadetector/exception/CanNotOpenStreamException.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright 2012 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector.exception;
-
-/**
- * Thrown to indicate that no stream to an {@link java.net.URL} can be established.
- * An instance of {@code Data} is immutable, their values cannot be changed after creation.
- *
- * @author André Rouél
- */
-@Immutable
-public class Data implements Serializable {
-
- /**
- * An immutable empty {@code Data} object.
- */
- public static final Data EMPTY = new Data(new HashSet
- * This method is consistent with equals.
- *
- * @param other
- * another instance of {@code OperatingSystemPattern}
- * @return negative value if one of the attributes of this instance is less, 0 if equal, or positive value if
- * greater than the other one
- */
- @Override
- public int compareTo(final BrowserPattern other) {
- int result = other == null ? -1 : 0;
- if (result == 0) {
- result = compareInt(getPosition(), other.getPosition());
- if (result == 0) {
- result = compareInt(getId(), other.getId());
- }
- if (result == 0) {
- result = getPattern().pattern().compareTo(other.getPattern().pattern());
- }
- if (result == 0) {
- result = compareInt(getPattern().flags(), other.getPattern().flags());
- }
- }
- return result;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final BrowserPattern other = (BrowserPattern) obj;
- if (id != other.id) {
- return false;
- }
- if (position != other.position) {
- return false;
- }
- if (!pattern.pattern().equals(other.pattern.pattern())) {
- return false;
- }
- if (pattern.flags() != other.pattern.flags()) {
- return false;
- }
- return true;
- }
-
- /**
- * Gets the identification number (ID) of a browser pattern.
- *
- * @return identification number (ID) of a browser pattern
- */
- @Override
- public int getId() {
- return id;
- }
-
- @Override
- public Pattern getPattern() {
- return pattern;
- }
-
- @Override
- public int getPosition() {
- return position;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + id;
- result = prime * result + position;
- result = prime * result + pattern.pattern().hashCode();
- result = prime * result + pattern.flags();
- return result;
- }
-
- @Override
- public String toString() {
- final StringBuilder builder = new StringBuilder();
- builder.append("BrowserPattern [id=");
- builder.append(id);
- builder.append(", pattern=");
- builder.append(pattern);
- builder.append(", position=");
- builder.append(position);
- builder.append("]");
- return builder.toString();
- }
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/internal/data/domain/BrowserType.java b/app/src/main/java/net/sf/uadetector/internal/data/domain/BrowserType.java
deleted file mode 100644
index ece8c7d..0000000
--- a/app/src/main/java/net/sf/uadetector/internal/data/domain/BrowserType.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*******************************************************************************
- * Copyright 2012 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector.internal.data.domain;
-
-import java.io.Serializable;
-
-import javax.annotation.Nonnegative;
-import javax.annotation.Nonnull;
-import javax.annotation.concurrent.Immutable;
-import javax.annotation.concurrent.NotThreadSafe;
-
-import net.sf.qualitycheck.Check;
-
-/**
- * The {@code BrowserType} class represents the type of a browser.
- * This method is consistent with equals.
- *
- * @param other
- * another instance of {@code OperatingSystemPattern}
- * @return negative value if one of the attributes of this instance is less, 0 if equal, or positive value if
- * greater than the other one
- */
- @Override
- public int compareTo(final DevicePattern other) {
- int result = other == null ? -1 : 0;
- if (result == 0) {
- result = compareInt(getPosition(), other.getPosition());
- if (result == 0) {
- result = compareInt(getId(), other.getId());
- }
- if (result == 0) {
- result = getPattern().pattern().compareTo(other.getPattern().pattern());
- }
- if (result == 0) {
- result = compareInt(getPattern().flags(), other.getPattern().flags());
- }
- }
- return result;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final DevicePattern other = (DevicePattern) obj;
- if (id != other.id) {
- return false;
- }
- if (position != other.position) {
- return false;
- }
- if (!pattern.pattern().equals(other.pattern.pattern())) {
- return false;
- }
- if (pattern.flags() != other.pattern.flags()) {
- return false;
- }
- return true;
- }
-
- /**
- * Gets the identification number (ID) of a device pattern.
- *
- * @return identification number (ID) of a device pattern
- */
- @Override
- public int getId() {
- return id;
- }
-
- @Override
- public Pattern getPattern() {
- return pattern;
- }
-
- @Override
- public int getPosition() {
- return position;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + id;
- result = prime * result + position;
- result = prime * result + pattern.pattern().hashCode();
- result = prime * result + pattern.flags();
- return result;
- }
-
- @Override
- public String toString() {
- final StringBuilder builder = new StringBuilder();
- builder.append("DevicePattern [id=");
- builder.append(id);
- builder.append(", pattern=");
- builder.append(pattern);
- builder.append(", position=");
- builder.append(position);
- builder.append("]");
- return builder.toString();
- }
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/internal/data/domain/Identifiable.java b/app/src/main/java/net/sf/uadetector/internal/data/domain/Identifiable.java
deleted file mode 100644
index fc4bbae..0000000
--- a/app/src/main/java/net/sf/uadetector/internal/data/domain/Identifiable.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package net.sf.uadetector.internal.data.domain;
-
-/**
- * Defines domain objects that have a numeric identifier (ID).
- *
- * @author André Rouél
- */
-public interface Identifiable {
-
- /**
- * Returns the identifier (ID) of an instance.
- *
- * @return numeric identifier
- */
- int getId();
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/internal/data/domain/OperatingSystem.java b/app/src/main/java/net/sf/uadetector/internal/data/domain/OperatingSystem.java
deleted file mode 100644
index 4806399..0000000
--- a/app/src/main/java/net/sf/uadetector/internal/data/domain/OperatingSystem.java
+++ /dev/null
@@ -1,429 +0,0 @@
-/*******************************************************************************
- * Copyright 2012 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector.internal.data.domain;
-
-import java.io.Serializable;
-import java.util.Collections;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import javax.annotation.Nonnegative;
-import javax.annotation.Nonnull;
-import javax.annotation.concurrent.Immutable;
-import javax.annotation.concurrent.NotThreadSafe;
-
-import net.sf.qualitycheck.Check;
-import net.sf.uadetector.OperatingSystemFamily;
-import net.sf.uadetector.UserAgent;
-import net.sf.uadetector.VersionNumber;
-
-@Immutable
-public final class OperatingSystem implements Identifiable, Serializable {
-
- @NotThreadSafe
- public static final class Builder {
-
- @Nonnull
- private String family = "";
-
- @Nonnull
- private String icon = "";
-
- private int id = Integer.MIN_VALUE;
-
- @Nonnull
- private String infoUrl = "";
-
- @Nonnull
- private String name = "";
-
- @Nonnull
- private SortedSet
- * This method is consistent with equals.
- *
- * @param other
- * another instance of {@code OperatingSystemPattern}
- * @return negative value if one of the attributes of this instance is less, 0 if equal, or positive value if
- * greater than the other one
- */
- @Override
- public int compareTo(final OperatingSystemPattern other) {
- int result = other == null ? -1 : 0;
- if (result == 0) {
- result = CompareNullSafe.compareInt(getPosition(), other.getPosition());
- if (result == 0) {
- result = CompareNullSafe.compareInt(getId(), other.getId());
- }
- if (result == 0) {
- result = getPattern().pattern().compareTo(other.getPattern().pattern());
- }
- if (result == 0) {
- result = CompareNullSafe.compareInt(getPattern().flags(), other.getPattern().flags());
- }
- }
- return result;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final OperatingSystemPattern other = (OperatingSystemPattern) obj;
- if (id != other.id) {
- return false;
- }
- if (position != other.position) {
- return false;
- }
- if (!pattern.pattern().equals(other.pattern.pattern())) {
- return false;
- }
- if (pattern.flags() != other.pattern.flags()) {
- return false;
- }
- return true;
- }
-
- /**
- * Gets the identification number (ID) of an operating system pattern.
- *
- * @return identification number (ID) of an operating system pattern
- */
- @Override
- public int getId() {
- return id;
- }
-
- @Override
- public Pattern getPattern() {
- return pattern;
- }
-
- @Override
- public int getPosition() {
- return position;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + id;
- result = prime * result + position;
- result = prime * result + pattern.pattern().hashCode();
- result = prime * result + pattern.flags();
- return result;
- }
-
- @Override
- public String toString() {
- final StringBuilder builder = new StringBuilder();
- builder.append("OperatingSystemPattern [id=");
- builder.append(id);
- builder.append(", pattern=");
- builder.append(pattern);
- builder.append(", position=");
- builder.append(position);
- builder.append("]");
- return builder.toString();
- }
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/internal/data/domain/OrderedPattern.java b/app/src/main/java/net/sf/uadetector/internal/data/domain/OrderedPattern.java
deleted file mode 100644
index ffedd13..0000000
--- a/app/src/main/java/net/sf/uadetector/internal/data/domain/OrderedPattern.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright 2012 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector.internal.data.domain;
-
-import java.util.regex.Pattern;
-
-import javax.annotation.Nonnegative;
-import javax.annotation.Nonnull;
-
-public interface OrderedPattern
- * When no explicit charset parameter is provided by the sender, media subtypes of the "text" type are defined to have a default
- * charset value of "ISO-8859-1" when received via HTTP. Data in character sets other than "ISO-8859-1" or its subsets MUST be
- * labeled with an appropriate charset value.
+ * The default charset of ISO-8859-1 for text media types has been
+ * removed; the default is now whatever the media type definition says.
+ * Likewise, special treatment of ISO-8859-1 has been removed from the
+ * Accept-Charset header field.
*
+ *
+ * Technically, we would have to determine the charset on a per-content-type basis, but generally speaking, UTF-8 is a
+ * pretty safe default. (NOTE: In the previous HTTP/1.1 spec, section 3.7.1, the default charset was defined as ISO-8859-1.)
*/
- public static final Charset DEFAULT_HTTP_CHARSET = Charset.forName("ISO-8859-1");
+ public static final Charset DEFAULT_HTTP_CHARSET = StandardCharsets.UTF_8;
/**
* Buffer size when decompressing content.
@@ -290,7 +294,7 @@ public static String base64EncodeBasicCredentials(String username, String passwo
String credentialsToEncode = username + ':' + password;
// using UTF-8, which is the modern de facto standard, and which retains compatibility with US_ASCII for ASCII characters,
// as required by RFC 7616, section 3: http://tools.ietf.org/html/rfc7617#section-3
- byte[] credentialsAsUtf8Bytes = credentialsToEncode.getBytes(Charset.forName("UTF-8"));
- return new String(DatatypeConverter.parseBase64Binary(new String(credentialsAsUtf8Bytes)));
+ byte[] credentialsAsUtf8Bytes = credentialsToEncode.getBytes(StandardCharsets.UTF_8);
+ return BaseEncoding.base64().encode(credentialsAsUtf8Bytes);
}
}
diff --git a/app/src/main/java/net/lightbody/bmp/util/BrowserMobProxyUtil.java b/app/src/main/java/net/lightbody/bmp/util/BrowserMobProxyUtil.java
old mode 100644
new mode 100755
index f242fb0..62f33cf
--- a/app/src/main/java/net/lightbody/bmp/util/BrowserMobProxyUtil.java
+++ b/app/src/main/java/net/lightbody/bmp/util/BrowserMobProxyUtil.java
@@ -7,12 +7,10 @@
import net.lightbody.bmp.core.har.HarLog;
import net.lightbody.bmp.core.har.HarPage;
import net.lightbody.bmp.mitm.exception.UncheckedIOException;
-import net.sf.uadetector.UserAgentStringParser;
-import net.sf.uadetector.service.UADetectorServiceFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
import java.util.HashSet;
import java.util.Set;
@@ -32,11 +30,6 @@ public class BrowserMobProxyUtil {
*/
private static final String UNKNOWN_VERSION_STRING = "UNKNOWN-VERSION";
- /**
- * Singleton User Agent parser.
- */
- private static volatile UserAgentStringParser parser;
-
/**
* Singleton version string loader.
*/
@@ -47,27 +40,6 @@ public String get() {
}
});
- private static final Object PARSER_INIT_LOCK = new Object();
-
- /**
- * Retrieve the User Agent String Parser. Create the parser if it has not yet been initialized.
- *
- * @return singleton UserAgentStringParser object
- */
- public static UserAgentStringParser getUserAgentStringParser() {
- if (parser == null) {
- synchronized (PARSER_INIT_LOCK) {
- if (parser == null) {
- // using resourceModuleParser for now because user-agent-string.info no longer exists. the updating
- // parser will get incorrect data and wipe out its entire user agent repository.
- parser = UADetectorServiceFactory.getResourceModuleParser();
- }
- }
- }
-
- return parser;
- }
-
/**
* Copies {@link HarEntry} and {@link HarPage} references from the specified har to a new har copy, up to and including
* the specified pageRef. Does not perform a "deep copy", so any subsequent modification to the entries or pages will
@@ -136,7 +108,7 @@ public static String getVersionString() {
private static String readVersionFileOnClasspath() {
String versionString;
try {
- versionString = ClasspathResourceUtil.classpathResourceToString(VERSION_CLASSPATH_RESOURCE, Charset.forName("UTF-8"));
+ versionString = ClasspathResourceUtil.classpathResourceToString(VERSION_CLASSPATH_RESOURCE, StandardCharsets.UTF_8);
} catch (UncheckedIOException e) {
log.debug("Unable to load version from classpath resource: {}", VERSION_CLASSPATH_RESOURCE, e);
return UNKNOWN_VERSION_STRING;
diff --git a/app/src/main/java/net/lightbody/bmp/util/ClasspathResourceUtil.java b/app/src/main/java/net/lightbody/bmp/util/ClasspathResourceUtil.java
old mode 100644
new mode 100755
index 41e1f54..66bd3b1
--- a/app/src/main/java/net/lightbody/bmp/util/ClasspathResourceUtil.java
+++ b/app/src/main/java/net/lightbody/bmp/util/ClasspathResourceUtil.java
@@ -34,8 +34,7 @@ public static String classpathResourceToString(String resource, Charset charset)
throw new IllegalArgumentException("Character set cannot be null");
}
- try {
- InputStream resourceAsStream = ClasspathResourceUtil.class.getResourceAsStream(resource);
+ try (InputStream resourceAsStream = ClasspathResourceUtil.class.getResourceAsStream(resource)) {
if (resourceAsStream == null) {
throw new UncheckedIOException(new FileNotFoundException("Unable to locate classpath resource: " + resource));
}
diff --git a/app/src/main/java/net/lightbody/bmp/util/HttpMessageContents.java b/app/src/main/java/net/lightbody/bmp/util/HttpMessageContents.java
old mode 100644
new mode 100755
diff --git a/app/src/main/java/net/lightbody/bmp/util/HttpMessageInfo.java b/app/src/main/java/net/lightbody/bmp/util/HttpMessageInfo.java
old mode 100644
new mode 100755
diff --git a/app/src/main/java/net/lightbody/bmp/util/HttpObjectUtil.java b/app/src/main/java/net/lightbody/bmp/util/HttpObjectUtil.java
old mode 100644
new mode 100755
index 169a878..bb98333
--- a/app/src/main/java/net/lightbody/bmp/util/HttpObjectUtil.java
+++ b/app/src/main/java/net/lightbody/bmp/util/HttpObjectUtil.java
@@ -4,6 +4,8 @@
import io.netty.handler.codec.http.HttpContent;
import io.netty.handler.codec.http.HttpHeaders;
import io.netty.handler.codec.http.HttpMessage;
+import io.netty.handler.codec.http.LastHttpContent;
+
import net.lightbody.bmp.exception.UnsupportedCharsetException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -52,6 +54,31 @@ public static void replaceTextHttpEntityBody(FullHttpMessage message, String new
replaceBinaryHttpEntityBody(message, contentBytes);
}
+
+ public static void replaceTextHttpEntityBody(LastHttpContent message, String newContents) {
+ // get the content type for this message so we can encode the newContents into a byte stream appropriately
+ String contentTypeHeader = message.trailingHeaders().get(HttpHeaders.Names.CONTENT_TYPE);
+
+ Charset messageCharset;
+ try {
+ messageCharset = BrowserMobHttpUtil.readCharsetInContentTypeHeader(contentTypeHeader);
+ } catch (UnsupportedCharsetException e) {
+ java.nio.charset.UnsupportedCharsetException cause = e.getUnsupportedCharsetExceptionCause() ;
+ log.error("Found unsupported character set in Content-Type header '{}' while attempting to replace contents of HTTP message.", contentTypeHeader, cause);
+
+ throw cause;
+ }
+
+ if (messageCharset == null) {
+ messageCharset = BrowserMobHttpUtil.DEFAULT_HTTP_CHARSET;
+ log.warn("No character set declared in HTTP message. Replacing text using default charset {}.", messageCharset);
+ }
+
+ byte[] contentBytes = newContents.getBytes(messageCharset);
+
+ replaceBinaryHttpEntityBody(message, contentBytes);
+ }
+
/**
* Replaces an HTTP entity body with the specified binary contents.
* TODO: Currently this method only works for FullHttpMessages, since it must modify the Content-Length header; determine if this may be applied to chunked messages as well
@@ -69,6 +96,17 @@ public static void replaceBinaryHttpEntityBody(FullHttpMessage message, byte[] n
message.headers().set(HttpHeaders.Names.CONTENT_LENGTH, newBinaryContents.length);
}
+ public static void replaceBinaryHttpEntityBody(LastHttpContent message, byte[] newBinaryContents) {
+// message.content().capacity(newBinaryContents.length);
+ message.content().clear();
+ // resize the buffer if needed, since the new message may be longer than the old one
+ message.content().ensureWritable(newBinaryContents.length, true);
+ message.content().writeBytes(newBinaryContents);
+
+ // update the Content-Length header, since the size may have changed
+// message.trailingHeaders().set(HttpHeaders.Names.CONTENT_LENGTH, newBinaryContents.length);
+ }
+
/**
* Extracts the entity body from an HTTP content object, according to the specified character set. The character set cannot be null. If
* the character set is not specified or is unknown, you still must specify a suitable default charset (see {@link BrowserMobHttpUtil#DEFAULT_HTTP_CHARSET}).
diff --git a/app/src/main/java/net/lightbody/bmp/util/HttpUtil.java b/app/src/main/java/net/lightbody/bmp/util/HttpUtil.java
old mode 100644
new mode 100755
diff --git a/app/src/main/java/net/sf/uadetector/DeviceCategory.java b/app/src/main/java/net/sf/uadetector/DeviceCategory.java
deleted file mode 100644
index c1df405..0000000
--- a/app/src/main/java/net/sf/uadetector/DeviceCategory.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*******************************************************************************
- * Copyright 2012 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector;
-
-import java.io.Serializable;
-
-import javax.annotation.Nonnull;
-import javax.annotation.concurrent.Immutable;
-import javax.annotation.concurrent.NotThreadSafe;
-
-import net.sf.qualitycheck.Check;
-
-@Immutable
-public final class DeviceCategory implements ReadableDeviceCategory, Serializable {
-
- @NotThreadSafe
- public static final class Builder {
-
- private Category category;
-
- private String icon;
-
- private String infoUrl;
-
- private String name;
-
- public Builder() {
- // default constructor
- }
-
- public Builder(@Nonnull final DeviceCategory deviceCategory) {
- Check.notNull(deviceCategory, "deviceCategory");
- category = Check.notNull(deviceCategory.getCategory(), "deviceCategory.getCategory()");
- icon = Check.notNull(deviceCategory.getIcon(), "deviceCategory.getIcon()");
- infoUrl = Check.notNull(deviceCategory.getInfoUrl(), "deviceCategory.getInfoUrl()");
- name = Check.notNull(deviceCategory.getName(), "deviceCategory.getName()");
- }
-
- @Nonnull
- public DeviceCategory build() {
- return new DeviceCategory(category, icon, infoUrl, name);
- }
-
- @Nonnull
- public Builder setCategory(@Nonnull final Category category) {
- this.category = Check.notNull(category, "category");
- return this;
- }
-
- @Nonnull
- public Builder setIcon(@Nonnull final String icon) {
- this.icon = Check.notNull(icon, "icon");
- return this;
- }
-
- @Nonnull
- public Builder setInfoUrl(@Nonnull final String infoUrl) {
- this.infoUrl = Check.notNull(infoUrl, "infoUrl");
- return this;
- }
-
- @Nonnull
- public Builder setName(@Nonnull final String name) {
- this.name = Check.notNull(name, "name");
- return this;
- }
-
- }
-
- private static final long serialVersionUID = 1L;
-
- /**
- * Represents a not set device category.
- */
- public static final DeviceCategory EMPTY = new DeviceCategory();
-
- private static int buildHashCode(@Nonnull final Category category, @Nonnull final String icon, @Nonnull final String infoUrl,
- @Nonnull final String name) {
- final int prime = 31;
- int result = 1;
- result = prime * result + category.hashCode();
- result = prime * result + icon.hashCode();
- result = prime * result + infoUrl.hashCode();
- result = prime * result + name.hashCode();
- return result;
- }
-
- @Nonnull
- private final Category category;
-
- @Nonnull
- private final String icon;
-
- @Nonnull
- private final String infoUrl;
-
- @Nonnull
- private final String name;
-
- private final int hash;
-
- /**
- * Builds an instance that represents an empty device category.
- *
- *
- * This value is not an operating system family.
- */
- JVM("JVM", Pattern.compile("JVM")),
-
- /**
- * Linux or GNU/Linux are usually called free, unix-like multi-user operating systems running based on the Linux
- * kernel and other GNU software.
- */
- LINUX("Linux", Pattern.compile("Linux")),
-
- /**
- * Mac OS is the name of the classic operating system (1984-2001) by Apple for Macintosh computers.
- */
- MAC_OS("Mac OS", Pattern.compile("Mac OS")),
-
- /**
- * Maemo is a linux based software platform for smartphones and Internet tablets.
- */
- MAEMO("Maemo", Pattern.compile("Maemo")),
-
- /**
- * MeeGo was a Linux kernel-based free mobile operating system project resulting from the fusion of Intel's Moblin
- * and Nokia's Maemo operating systems.
- */
- MEEGO("MeeGo", Pattern.compile("MeeGo")),
-
- /**
- * Minix is a free unixoides operating system that was developed by Andrew S. Tanenbaum at the Free University of
- * Amsterdam as a teaching tool.
- */
- MINIX("MINIX", Pattern.compile("MINIX")),
-
- /**
- * OpenVMS (Open Virtual Memory System), previously known as VAX-11/VMS, VAX/VMS or (informally) VMS, is a computer
- * server operating system that runs on VAX, Alpha and Itanium-based families of computers.
- */
- OPENVMS("OpenVMS", Pattern.compile("OpenVMS")),
-
- /**
- * OS X, formerly Mac OS X, is a Unix-based operating systems developed by Apple. It is a proprietary distribution
- * of the free Darwin operating system from Apple.
- */
- OS_X("OS X", Pattern.compile("(Mac OS X|OS X)")),
-
- /**
- * MorphOS is an Amiga-compatible computer operating system. It is a mixed proprietary and open source OS produced
- * for the Pegasos PowerPC processor based computer.
- */
- MORPHOS("MorphOS", Pattern.compile("MorphOS")),
-
- /**
- * This value indicates the operating systems from Nintendo, which they developed for their devices.
- *
- * This value is not an operating system family.
- */
- NINTENDO("Nintendo", Pattern.compile("Nintendo")),
-
- /**
- * OS/2 is a multitasking operating system for PCs. It was originally developed by IBM and Microsoft together with
- * the aim to replace DOS.
- */
- OS_2("OS/2", Pattern.compile("OS/2")),
-
- /**
- * Palm OS was the operating system for organizer of the Palm series (known as PDAs) and smartphones.
- */
- PALM_OS("Palm OS", Pattern.compile("Palm OS")),
-
- /**
- * The PlayStation Vita system software is the official, updatable firmware and operating system for the PlayStation
- * Vita.
- */
- PLAYSTATION_VITA("LiveArea", Pattern.compile("LiveArea")),
-
- /**
- * QNX is a POSIX-compatible proprietary Unix-like real-time operating system that focused primarily at the embedded
- * market.
- */
- QNX("QNX", Pattern.compile("QNX")),
-
- /**
- * RISC OS is a computer operating system originally designed by Acorn Computers Ltd. It was specifically designed
- * to run on the ARM chipset, which Acorn had designed concurrently for use in its new line of Archimedes personal
- * computers.
- */
- RISC_OS("RISC OS", Pattern.compile("RISC OS|RISK OS")),
-
- /**
- * Binary Runtime Environment for Wireless (Brew MP, Brew, or BREW) is an application development platform created
- * by Qualcomm.
- */
- BREW("Brew", Pattern.compile("Brew")),
-
- /**
- * BlackBerry OS (up to the fifth edition known as the BlackBerry Device Software, also known as Research
- * In Motion OS) is a proprietary mobile operating system developed by BlackBerry Ltd for its BlackBerry line of
- * smartphone handheld devices.
- */
- BLACKBERRY_OS("BlackBerry OS", Pattern.compile("(RIM OS|BlackBerry OS)")),
-
- /**
- * Sailfish is a Linux-based mobile operating system developed by Jolla in cooperation with the Mer project and
- * supported by the Sailfish Alliance.
- */
- SAILFISH_OS("Sailfish", Pattern.compile("Sailfish")),
-
- /**
- * Solaris is the name of an operating system distribution based on SunOS and is a Unix operating system. Since the
- * takeover of Sun Microsystems in 2010 Solaris is part of Oracle.
- */
- SOLARIS("Solaris", Pattern.compile("Solaris")),
-
- /**
- * Syllable is a slim and fast desktop Unix-like operating system for x86 processors.
- */
- SYLLABLE("Syllable", Pattern.compile("Syllable")),
-
- /**
- * The Symbian platform, simply called Symbian, is an operating system for smartphones and PDAs. The Symbian
- * platform is the successor to Symbian OS
- */
- SYMBIAN("Symbian OS", Pattern.compile("Symbian OS")),
-
- /**
- * Tizen is a free operating system based on Linux respectively Debian and was launched by the Linux Foundation and
- * LiMo Foundation.
- */
- TIZEN("Tizen", Pattern.compile("Tizen")),
-
- /**
- * The Wii Operating System is based on Nintendo’s proprietary software and runs on the Wii video game console.
- */
- WII_OS("Wii OS", Pattern.compile("Nintendo Wii|Wii OS")),
-
- /**
- * Microsoft Windows is a trademark for operating systems of the Microsoft Corporation. Microsoft Windows was
- * originally a graphical extension of the operating system MS-DOS.
- */
- WINDOWS("Windows", Pattern.compile("Windows")),
-
- /**
- * XrossMediaBar (XMB) is the name of the graphical user interface, which are used on PlayStation 3, PlayStation
- * Portable, Sony Blu-Ray players and Sony Bravia TVs. Also some special versions of the PlayStation 2, PSX, already
- * using the XMB.
- */
- XROSSMEDIABAR("XrossMediaBar (XMB)", Pattern.compile("XrossMediaBar (XMB)")),
-
- /**
- * iOS (until June 2010 iPhone OS) is the standard operating system of Apple products like iPhone, iPod touch, iPad,
- * and the second generation of Apple TV. iOS is based on Mac OS X.
- */
- IOS("iOS", Pattern.compile("iOS|iPhone OS")),
-
- /**
- * webOS is a smartphone and tablet operating system from Hewlett-Packard (formerly HP Palm). It represents the
- * follower of Palm OS.
- */
- WEBOS("webOS", Pattern.compile("webOS")),
-
- /**
- * Unknown operating system family
- *
- * This value will be returned if the operating system family cannot be determined.
- */
- UNKNOWN("", Pattern.compile("^$"));
-
- /**
- * This method try to find by the given family name a matching enum value. The family name must match against an
- * operating system entry in UAS data file.
- *
- * @param family
- * name of an operating system family
- * @return the matching enum value or {@code OperatingSystemFamily#UNKNOWN}
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if the given argument is {@code null}
- */
- public static OperatingSystemFamily evaluate(@Nonnull final String family) {
- Check.notNull(family, "family");
-
- OperatingSystemFamily result = UNKNOWN;
-
- // search by name
- result = evaluateByName(family);
-
- // search by pattern
- if (result == UNKNOWN) {
- result = evaluateByPattern(family);
- }
-
- return result;
- }
-
- /**
- * This method try to find by the given family name a matching enum value. The family name will be evaluated against
- * the stored name of an operating system entry.
- *
- * @param family
- * name of an operating system family
- * @return the matching enum value or {@code OperatingSystemFamily#UNKNOWN}
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if the given argument is {@code null}
- */
- protected static OperatingSystemFamily evaluateByName(@Nonnull final String family) {
- Check.notNull(family, "family");
-
- OperatingSystemFamily result = UNKNOWN;
- for (final OperatingSystemFamily value : values()) {
- if (value.getName().equals(family)) {
- result = value;
- break;
- }
- }
-
- return result;
- }
-
- /**
- * This method try to find by the given family name a matching enum value. The family name will be evaluated against
- * the stored regular expression of an operating system entry.
- *
- * @param family
- * name of an operating system family
- * @return the matching enum value or {@code OperatingSystemFamily#UNKNOWN}
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if the given argument is {@code null}
- */
- protected static OperatingSystemFamily evaluateByPattern(@Nonnull final String family) {
- Check.notNull(family, "family");
-
- OperatingSystemFamily result = UNKNOWN;
- for (final OperatingSystemFamily value : values()) {
- final Matcher m = value.getPattern().matcher(family);
- if (m.matches()) {
- result = value;
- break;
- }
- }
-
- return result;
- }
-
- /**
- * The internal family name in the UAS database.
- */
- @Nonnull
- private final String name;
-
- /**
- * The regular expression which a family name must be match.
- */
- @Nonnull
- private final Pattern pattern;
-
- private OperatingSystemFamily(@Nonnull final String name, @Nonnull final Pattern pattern) {
- this.name = name;
- this.pattern = pattern;
- }
-
- /**
- * Gets the internal family name in the UAS database.
- *
- * @return the internal family name
- */
- @Nonnull
- public String getName() {
- return this.name;
- }
-
- /**
- * Gets the regular expression which a family name must be match with.
- *
- * @return regular expression
- */
- @Nonnull
- public Pattern getPattern() {
- return pattern;
- }
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/ReadableDeviceCategory.java b/app/src/main/java/net/sf/uadetector/ReadableDeviceCategory.java
deleted file mode 100644
index 58a72fc..0000000
--- a/app/src/main/java/net/sf/uadetector/ReadableDeviceCategory.java
+++ /dev/null
@@ -1,163 +0,0 @@
-package net.sf.uadetector;
-
-import javax.annotation.Nonnull;
-
-import net.sf.qualitycheck.Check;
-
-/**
- * Defines a category of devices.
- *
- *
- * An operating system (OS) is a set of software that manages the hardware of a computer and provides common services
- * for programs. Popular examples of modern operating systems are Android, iOS, Linux, Mac OS X and Windows.
- *
- * The implementation of this interface may be mutable or immutable. This interface only gives access to retrieve data,
- * never to change it.
- *
- * @author André Rouél
- */
-public interface ReadableOperatingSystem {
-
- /**
- * Gets the family of an operating system.
- *
- * @return the family of an operating system
- */
- @Nonnull
- OperatingSystemFamily getFamily();
-
- /**
- * Gets the family name of an operating system.
- *
- * @return the family of an operating system
- */
- @Nonnull
- String getFamilyName();
-
- /**
- * Gets the icon name of an operating system.
- *
- * @return the icon name of an operating system
- */
- @Nonnull
- String getIcon();
-
- /**
- * Gets the name of an operating system.
- *
- * @return the name of an operating system
- */
- @Nonnull
- String getName();
-
- /**
- * Returns the manufacturer of an operating system.
- *
- * @return the manufacturer
- */
- @Nonnull
- String getProducer();
-
- /**
- * Returns the URL to the main website of the manufacturer of an operating system.
- *
- * @return the URL to the website of the manufacturer
- */
- @Nonnull
- String getProducerUrl();
-
- /**
- * Returns the URL to the product or information page of an operating system.
- *
- * @return the URL to the product page
- */
- @Nonnull
- String getUrl();
-
- /**
- * Gets the version number of an operating system.
- *
- * @return version number an operating system
- */
- @Nonnull
- VersionNumber getVersionNumber();
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/ReadableUserAgent.java b/app/src/main/java/net/sf/uadetector/ReadableUserAgent.java
deleted file mode 100644
index 5d35fdc..0000000
--- a/app/src/main/java/net/sf/uadetector/ReadableUserAgent.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright 2012 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector;
-
-import javax.annotation.Nonnull;
-
-/**
- * Defines an user agent.
- *
- * An user agent is a client program with which a network service can be used. The user agent is the interface to
- * representing contents and taking orders of an user. Examples of user agents are web browsers, email programs, news
- * reader and web crawlers.
- *
- * The implementation of this interface may be mutable or immutable. This interface only gives access to retrieve data,
- * never to change it.
- *
- * @author André Rouél
- */
-public interface ReadableUserAgent {
-
- /**
- * Gets the detected device category.
- *
- * @return detected device category
- */
- @Nonnull
- ReadableDeviceCategory getDeviceCategory();
-
- /**
- * Gets the family of an user agent.
- *
- * @return family of an user agent
- */
- @Nonnull
- UserAgentFamily getFamily();
-
- /**
- * Gets the icon name of an user agent.
- *
- * @return icon name of an user agent
- */
- @Nonnull
- String getIcon();
-
- /**
- * Gets the name of an user agent.
- *
- * @return name of an user agent
- */
- @Nonnull
- String getName();
-
- /**
- * Gets the operating system on which the user agent is running.
- *
- * @return the running operating system
- */
- @Nonnull
- OperatingSystem getOperatingSystem();
-
- /**
- * Returns the manufacturer of an user agent.
- *
- * @return the manufacturer
- */
- @Nonnull
- String getProducer();
-
- /**
- * Returns the URL to the main website of the manufacturer of an user agent.
- *
- * @return URL to the website of the manufacturer
- */
- @Nonnull
- String getProducerUrl();
-
- /**
- * Returns the type of an user agent, for example, mobile browser or email client.
- *
- * @return the type of an user agent
- */
- @Nonnull
- UserAgentType getType();
-
- /**
- * Returns the type name of an user agent, for example, mobile browser or email client.
- *
- * @return the type name of an user agent
- */
- @Nonnull
- String getTypeName();
-
- /**
- * Returns the URL to the product or information page of an user agent.
- *
- * @return the URL to the product page
- */
- @Nonnull
- String getUrl();
-
- /**
- * Gets the version number of an user agent.
- *
- * @return version number of an user agent
- */
- @Nonnull
- VersionNumber getVersionNumber();
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/ReadableVersionNumber.java b/app/src/main/java/net/sf/uadetector/ReadableVersionNumber.java
deleted file mode 100644
index 2ec312d..0000000
--- a/app/src/main/java/net/sf/uadetector/ReadableVersionNumber.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright 2012 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector;
-
-import java.util.List;
-
-import javax.annotation.Nonnull;
-
-/**
- * Defines a version number of an operating system or user agent.
- *
- * Generally, a version number represents unique states of a software. Version numbers are different versions of a
- * single software in order to distinguish different versions of development cycles.
- *
- * A classic version number is often composed of:
- *
- *
- * A version number may also contain additions, for example, to document a development stage of a software.
- * indexes mostly very significant change in the program - for example when the program was completely rewritten or
- * libraries can be maintained at no interface compatibility.
- * usually referred to a functional extension of a program.
- * contains mostly bug fixes.
- *
- * The implementation of this interface may be mutable or immutable. This interface only gives access to retrieve data,
- * never to change it.
- *
- * @author André Rouél
- */
-public interface ReadableVersionNumber extends Comparable
- *
- * The returned list of the version number segments should be immutable.
- *
- * @return a list of segments of the version number
- */
- @Nonnull
- List
- *
- * format: YYYYMMDD-counter
(counter
is two digits long)
- * example: 20120931-02
- *
- * @return version of the current UAS data
- */
- String getDataVersion();
-
- /**
- * Detects informations about a network client based on a user agent string.
- *
- * Typically user agent string will be read by an instance of {@code HttpServletRequest}. With the method
- * {@code getHeader("User-Agent")} you can get direct access to this string.
- *
- * @param userAgent
- * user agent string
- * @return the detected information of an user agent
- */
- ReadableUserAgent parse(final String userAgent);
-
- /**
- * In environments where the JVM will never shut down while reinstalling UADetector, it is necessary to manually
- * shutdown running threads of UserAgentStringParser
s with updating functionality like
- * UADetectorServiceFactory.getCachingAndUpdatingParser()
or
- * UADetectorServiceFactory.getOnlineUpdatingParser()
.
- * UADetectorServiceFactory
retrieved updating
- * UserAgentStringParser
otherwise more and more threads will be registered.
- * UserAgentStringParser
has updating functionality if it works with a
- * {@link net.sf.uadetector.datastore.RefreshableDataStore}.
- * UserAgentStringParser
implementation nothing will happen.
- *
- *
- * A {@code VersionNumber} object is immutable, their values cannot be changed after creation.
- *
- * @author André Rouél
- */
-public final class VersionNumber implements ReadableVersionNumber, Serializable {
-
- /**
- * Empty extension or addition of a version number
- */
- public static final String EMPTY_EXTENSION = "";
-
- /**
- * Empty group or category of a version number
- */
- public static final String EMPTY_GROUP = "";
-
- /**
- * Minimum number of numeric group a version number
- */
- private static final int MIN_GROUP_SIZE = 3;
-
- /**
- * Regular expression to find only numerical values in strings
- */
- private static final Pattern NUMERIC = Pattern.compile("\\d+");
-
- /**
- * Separator between numeric groups of a version number
- */
- private static final char SEPARATOR = '.';
-
- /**
- * Serialization version
- */
- private static final long serialVersionUID = 1L;
-
- /**
- * Defines an empty or not set version number
- */
- public static final VersionNumber UNKNOWN = new VersionNumber(EMPTY_GROUP);
-
- /**
- * Checks a string that only numerical values are present. Negative numbers are not included.
- *
- * @param text
- * string to be tested
- * @return {@code true} if only numeric characters are present, otherwise {@code false}
- */
- private static boolean isNumeric(final String text) {
- return NUMERIC.matcher(text).matches();
- }
-
- /**
- * Interprets a string with version information. The last version number in the string will be searched and
- * processed.
- *
- * @param text
- * string with version information
- * @return an object of {@code VersionNumber}, never {@code null}
- */
- public static VersionNumber parseLastVersionNumber(@Nonnull final String text) {
- return VersionParser.parseLastVersionNumber(Check.notNull(text, "text"));
- }
-
- /**
- * Try to determine the version number of the operating system by parsing the user agent string.
- *
- *
- * @param family
- * family of the operating system
- * @param userAgent
- * user agent string
- * @return extracted version number
- */
- public static VersionNumber parseOperatingSystemVersion(@Nonnull final OperatingSystemFamily family, @Nonnull final String userAgent) {
- Check.notNull(family, "family");
- Check.notNull(userAgent, "userAgent");
- return VersionParser.parseOperatingSystemVersion(family, userAgent);
- }
-
- /**
- * Interprets a string with version information. The first found group will be taken and processed.
- *
- * @param version
- * version as string
- * @return an object of {@code VersionNumber}, never {@code null}
- */
- public static VersionNumber parseVersion(@Nonnull final String version) {
- return VersionParser.parseVersion(Check.notNull(version, "version"));
- }
-
- /**
- * Replaces all {@code null} values in the given list of groups with {@code VersionNumber#EMPTY_GROUP}.
- *
- * @param groups
- * list of numbers of a version number
- * @return a new list of groups without {@code null} values
- */
- public static List
- *
- * The returned list of the version number segments is immutable.
- *
- * @return an unmodifiable view of the of the version number groups
- */
- @Override
- public List
- *
- * This reader is safe when used concurrently by multiple threads.
- *
- * @author André Rouél
- */
-public final class XmlDataReader implements DataReader {
-
- protected static final class XmlParser {
-
- private static final String MSG_NOT_PARSED_AS_EXPECTED = "The UAS data has not been parsed as expected.";
-
- public static void parse(@Nonnull final InputStream stream, @Nonnull final DataBuilder builder)
- throws ParserConfigurationException, SAXException, IOException {
- final SAXParserFactory factory = SAXParserFactory.newInstance();
-// factory.setValidating(true);
- final SAXParser parser = factory.newSAXParser();
- final XmlDataHandler handler = new XmlDataHandler(builder);
- parser.parse(stream, handler);
- validate(handler);
- }
-
- protected static void validate(@Nonnull final XmlDataHandler handler) {
- if (handler.hasError()) {
- throw new IllegalStateException(MSG_NOT_PARSED_AS_EXPECTED);
- }
- }
-
- private XmlParser() {
- // This class is not intended to create objects from it.
- }
-
- }
-
- /**
- * Default character set to read UAS data
- */
- private static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8");
-
- /**
- * Corresponding default logger for this class
- */
- private static final Logger LOG = LoggerFactory.getLogger(XmlDataReader.class);
-
- /**
- * Reads the UAS data in XML format based on the given URL.
- *
- * When during the reading errors occur which lead to a termination of the read operation, the information will be
- * written to a log. The termination of the read operation will not lead to a program termination and in this case
- * this method returns {@link Data#EMPTY}.
- *
- * @param inputStream
- * an input stream for reading UAS data
- * @param charset
- * the character set in which the data should be read
- * @return read in UAS data as {@code Data} instance
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if any of the given arguments is {@code null}
- * @throws net.sf.uadetector.exception.CanNotOpenStreamException
- * if no stream to the given {@code URL} can be established
- */
- protected static Data readXml(@Nonnull final InputStream inputStream, @Nonnull final Charset charset) {
- Check.notNull(inputStream, "inputStream");
- Check.notNull(charset, "charset");
-
- final DataBuilder builder = new DataBuilder();
- boolean hasErrors = false;
- try {
- XmlParser.parse(inputStream, builder);
- } catch (final ParserConfigurationException e) {
- hasErrors = true;
- LOG.warn(e.getLocalizedMessage());
- } catch (final SAXException e) {
- hasErrors = true;
- LOG.warn(e.getLocalizedMessage());
- } catch (final IOException e) {
- hasErrors = true;
- LOG.warn(e.getLocalizedMessage());
- } catch (final IllegalStateException e) {
- hasErrors = true;
- LOG.warn(e.getLocalizedMessage());
- } catch (final Exception e) {
- hasErrors = true;
- LOG.warn(e.getLocalizedMessage(), e);
- } finally {
- Closeables.closeAndConvert(inputStream, true);
- }
-
- return hasErrors ? Data.EMPTY : builder.build();
- }
-
- /**
- * Reads the UAS data in XML format from the given string.
- *
- * @param data
- * UAS data as string
- * @return read in User-Agent data as {@code Data} instance otherwise {@link Data#EMPTY}
- *
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if any of the given argument is {@code null}
- */
- @Override
- public Data read(@Nonnull final String data) {
- Check.notNull(data, "data");
-
- return readXml(new ByteArrayInputStream(data.getBytes(DEFAULT_CHARSET)), DEFAULT_CHARSET);
- }
-
- /**
- * Reads the UAS data in XML format based on the given URL.
- *
- * @param url
- * {@code URL} to User-Agent informations
- * @param charset
- * the character set in which the data should be read
- * @return read in User-Agent data as {@code Data} instance otherwise {@link Data#EMPTY}
- *
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if any of the given arguments is {@code null}
- */
- @Override
- public Data read(@Nonnull final URL url, @Nonnull final Charset charset) {
- Check.notNull(url, "url");
- Check.notNull(charset, "charset");
-
- Data data = Data.EMPTY;
- try {
- data = readXml(UrlUtil.open(url), charset);
- } catch (final CanNotOpenStreamException e) {
- LOG.warn(e.getLocalizedMessage());
- }
-
- return data;
- }
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/datareader/package-info.java b/app/src/main/java/net/sf/uadetector/datareader/package-info.java
deleted file mode 100644
index 47a7b71..0000000
--- a/app/src/main/java/net/sf/uadetector/datareader/package-info.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright 2012 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-@javax.annotation.ParametersAreNonnullByDefault
-package net.sf.uadetector.datareader;
diff --git a/app/src/main/java/net/sf/uadetector/datastore/AbstractDataStore.java b/app/src/main/java/net/sf/uadetector/datastore/AbstractDataStore.java
deleted file mode 100644
index b5075bc..0000000
--- a/app/src/main/java/net/sf/uadetector/datastore/AbstractDataStore.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright 2012 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector.datastore;
-
-import java.net.URL;
-import java.nio.charset.Charset;
-
-import javax.annotation.Nonnull;
-
-import net.sf.qualitycheck.Check;
-import net.sf.uadetector.datareader.DataReader;
-import net.sf.uadetector.internal.data.Data;
-import net.sf.uadetector.internal.util.UrlUtil;
-
-/**
- * The abstract implementation to store UAS data only in the heap space.
- *
- * A store must always have an usable instance of {@link Data}. It is recommended to initialize it with the supplied UAS
- * file in the uadetector-resources module.
- *
- * @author André Rouél
- */
-public abstract class AbstractDataStore implements DataStore {
-
- /**
- * Runtime check that the passed instance of {@link Data} is not empty (respectively {@link Data#EMPTY}).
- *
- * @param data
- * instance of {@code Data}
- * @throws IllegalStateException
- * if the passed instance is empty
- */
- private static Data checkData(final Data data) {
- if (Data.EMPTY.equals(data)) {
- throw new IllegalStateException("Argument 'data' must not be empty.");
- }
- return data;
- }
-
- /**
- * This method reads the given {@link URL} by using an {@link DataReader}. The new created instance of {@link Data}
- * will be returned.
- *
- * @param reader
- * data reader to read the given {@code dataUrl}
- * @param url
- * URL to UAS data
- * @param charset
- * the character set in which the data should be read
- * @return an instance of {@code Data} or {@link Data#EMPTY} if an error occurred, but never {@code null}
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if the given argument is {@code null}
- */
- protected static final Data readData(@Nonnull final DataReader reader, @Nonnull final URL url, @Nonnull final Charset charset) {
- Check.notNull(reader, "reader");
- Check.notNull(url, "url");
- Check.notNull(charset, "charset");
-
- return reader.read(url, charset);
- }
-
- /**
- * Current the character set in which the UAS data will be read
- */
- private final Charset charset;
-
- /**
- * Current UAS data
- */
- private final Data data;
-
- /**
- * The {@code URL} to get UAS data
- */
- private final URL dataUrl;
-
- /**
- * The data reader to read in UAS data
- */
- private final DataReader reader;
-
- /**
- * The {@code URL} to get the latest version information of UAS data
- */
- private final URL versionUrl;
-
- /**
- * Constructs an new instance of {@link AbstractDataStore}.
- *
- * @param data
- * first UAS data which will be available in the store
- * @param reader
- * data reader to read the given {@code dataUrl}
- * @param dataUrl
- * URL to UAS data
- * @param versionUrl
- * URL to version information about the given UAS data
- * @param charset
- * the character set in which the data should be read
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if one of the given arguments is {@code null}
- */
- protected AbstractDataStore(@Nonnull final Data data, @Nonnull final DataReader reader, @Nonnull final URL dataUrl,
- @Nonnull final URL versionUrl, @Nonnull final Charset charset) {
- Check.notNull(data, "data");
- Check.notNull(reader, "reader");
- Check.notNull(charset, "charset");
- Check.notNull(dataUrl, "dataUrl");
- Check.notNull(versionUrl, "versionUrl");
-
- this.data = checkData(data);
- this.reader = reader;
- this.dataUrl = dataUrl;
- this.versionUrl = versionUrl;
- this.charset = charset;
- }
-
- /**
- * Constructs an {@code AbstractDataStore} by reading the given {@code dataUrl} as UAS data.
- *
- * @param reader
- * data reader to read the given {@code dataUrl}
- * @param dataUrl
- * URL to UAS data
- * @param versionUrl
- * URL to version information about the given UAS data
- * @param charset
- * the character set in which the data should be read
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if one of the given arguments is {@code null}
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if the given strings are not valid URLs
- */
- protected AbstractDataStore(final DataReader reader, final String dataUrl, final String versionUrl, final Charset charset) {
- this(reader, UrlUtil.build(dataUrl), UrlUtil.build(versionUrl), charset);
- }
-
- /**
- * Constructs an {@code AbstractDataStore} by reading the given {@code dataUrl} as UAS data.
- *
- * @param reader
- * data reader to read the given {@code dataUrl}
- * @param dataUrl
- * URL to UAS data
- * @param versionUrl
- * URL to version information about the given UAS data
- * @param charset
- * the character set in which the data should be read
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if the given argument is {@code null}
- * @throws net.sf.qualitycheck.exception.IllegalStateOfArgumentException
- * if the created instance of {@link Data} is empty
- */
- protected AbstractDataStore(final DataReader reader, final URL dataUrl, final URL versionUrl, final Charset charset) {
- this(checkData(readData(reader, dataUrl, charset)), reader, dataUrl, versionUrl, charset);
- }
-
- @Override
- public Charset getCharset() {
- return charset;
- }
-
- @Override
- public Data getData() {
- return data;
- }
-
- @Override
- public DataReader getDataReader() {
- return reader;
- }
-
- @Override
- public URL getDataUrl() {
- return dataUrl;
- }
-
- @Override
- public URL getVersionUrl() {
- return versionUrl;
- }
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/datastore/AbstractRefreshableDataStore.java b/app/src/main/java/net/sf/uadetector/datastore/AbstractRefreshableDataStore.java
deleted file mode 100644
index 7330f8f..0000000
--- a/app/src/main/java/net/sf/uadetector/datastore/AbstractRefreshableDataStore.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*******************************************************************************
- * Copyright 2013 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector.datastore;
-
-import java.net.URL;
-import java.nio.charset.Charset;
-
-import javax.annotation.Nonnull;
-
-import net.sf.qualitycheck.Check;
-import net.sf.qualitycheck.exception.IllegalStateOfArgumentException;
-import net.sf.uadetector.datareader.DataReader;
-import net.sf.uadetector.exception.CanNotOpenStreamException;
-import net.sf.uadetector.internal.data.Data;
-import net.sf.uadetector.internal.util.UrlUtil;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This abstract implementation provides basic update functionality to be able to update the UAS data in your
- * data store. During initialization the passed in fallback data store will be used and an update process will be
- * triggered. The update operation itself works as background task to avoid blocking (for example when reading data by a
- * network connection and the remote host is not available or really slow).
- * DataStore
. When this action is executed, the current data URL will be
- * read in and the DataReader
parses and builds a new Data instance. Finally, the currently set
- * Data
reference will be replaced by the new one.
- *
- *
- * Message sample: No update available. Current version is '20120301-01'.
- * First placeholder: current version
- */
- private static final String MSG_NO_UPDATE_AVAILABLE = "No update available. Current version is '%s'.";
-
- /**
- * Message for the log when an online update check is not possible.
- *
- * Message sample: Can not check for an updated version. Are you sure you have an established internet
- * connection?
- */
- private static final String MSG_NO_UPDATE_CHECK_POSSIBLE = "Can not check for an updated version. Are you sure you have an established internet connection?";
-
- /**
- * Message for the log when an exception occur during the update check.
- *
- * Message sample: Can not check for an updated version: java.net.ConnectException:
- * Connection refused
- * First placeholder: class name of exception
- * Second placeholder: exception message
- */
- private static final String MSG_NO_UPDATE_CHECK_POSSIBLE__DEBUG = "Can not check for an updated version: %s: %s";
-
- /**
- * Message for the log when an update is available.
- *
- * Message sample: An update is available. Current version is '20120301-01' and remote version is '
- * 20120401-01'.
- * First placeholder: current version
- * Second placeholder: new remote version
- */
- private static final String MSG_UPDATE_AVAILABLE = "An update is available. Current version is '%s' and remote version is '%s'.";
-
- /**
- * Pattern of a typical version of UAS data
- */
- private static final Pattern VERSION_PATTERN = Pattern.compile("\\d{8}\\-\\d{2}");
-
- /**
- * Checks a given newer version against an older one.
- *
- * @param newer
- * possible newer version
- * @param older
- * possible older version
- * @return {@code true} if the first argument is newer than the second argument, otherwise {@code false}
- */
- static boolean hasUpdate(final String newer, final String older) {
- return VERSION_PATTERN.matcher(newer).matches() && VERSION_PATTERN.matcher(older).matches() ? newer.compareTo(older) > 0 : false;
- }
-
- /**
- * Reads the current User-Agent data version from http://data.udger.com.
- *
- * @param url
- * a URL which the version information can be loaded
- * @return a version string or {@code null}
- * @throws IOException
- * if an I/O exception occurs
- */
- @Nullable
- private static String retrieveRemoteVersion(@Nonnull final URL url, @Nonnull final Charset charset) throws IOException {
- final InputStream stream = url.openStream();
- final InputStreamReader reader = new InputStreamReader(stream, charset);
- final LineNumberReader lnr = new LineNumberReader(reader);
- final String line = lnr.readLine();
- lnr.close();
- reader.close();
- stream.close();
- return line;
- }
-
- /**
- * {@link ExecutorService} to run the update operation of the UAS data in background
- */
- private final ExecutorService executorService = ExecutorServices.createBackgroundExecutor();
-
- /**
- * Time of last update check in milliseconds
- */
- private long lastUpdateCheck = 0;
-
- /**
- * The data store for instances that implements {@link net.sf.uadetector.internal.data.Data}
- */
- private final RefreshableDataStore store;
-
- public AbstractUpdateOperation(@Nonnull final RefreshableDataStore dataStore) {
- Check.notNull(dataStore, "dataStore");
- store = dataStore;
- }
-
- /**
- * Shortcut to get the current version of the UAS data in the {@link net.sf.uadetector.datastore.DataStore}.
- *
- * @return current version of UAS data
- */
- @Nonnull
- private String getCurrentVersion() {
- return store.getData().getVersion();
- }
-
- /**
- * Gets the time of the last update check in milliseconds.
- *
- * @return time of the last update check in milliseconds
- */
- @Override
- public long getLastUpdateCheck() {
- return lastUpdateCheck;
- }
-
- /**
- * Fetches the current version information over HTTP and compares it with the last version of the most recently
- * imported data.
- *
- * @return {@code true} if an update exists, otherwise {@code false}
- */
- protected boolean isUpdateAvailable() {
- boolean result = false;
- String version = EMPTY_VERSION;
- try {
- version = retrieveRemoteVersion(store.getVersionUrl(), store.getCharset());
- } catch (final IOException e) {
- LOG.info(MSG_NO_UPDATE_CHECK_POSSIBLE);
- LOG.debug(String.format(MSG_NO_UPDATE_CHECK_POSSIBLE__DEBUG, e.getClass().getName(), e.getLocalizedMessage()));
- }
- if (hasUpdate(version, getCurrentVersion())) {
- LOG.debug(String.format(MSG_UPDATE_AVAILABLE, getCurrentVersion(), version));
- result = true;
- } else {
- LOG.debug(String.format(MSG_NO_UPDATE_AVAILABLE, getCurrentVersion()));
- }
- lastUpdateCheck = System.currentTimeMillis();
- return result;
- }
-
- /**
- * Executes the update at some time in the future (as soon as possible) within a new thread.
- */
- @Override
- public void run() {
- executorService.execute(new Runnable() {
- @Override
- public void run() {
- call();
- }
- });
- }
-
- /**
- * Shuts down the corresponding background executor as soon as possible, but at the latest specified default time.
- *
- * @see ExecutorServices#shutdown(ExecutorService)
- */
- @Override
- public void shutdown() {
- ExecutorServices.shutdown(executorService);
- }
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/datastore/CachingXmlDataStore.java b/app/src/main/java/net/sf/uadetector/datastore/CachingXmlDataStore.java
deleted file mode 100644
index 1bb1f40..0000000
--- a/app/src/main/java/net/sf/uadetector/datastore/CachingXmlDataStore.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/*******************************************************************************
- * Copyright 2012 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector.datastore;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.nio.charset.Charset;
-
-import javax.annotation.Nonnull;
-
-import net.sf.qualitycheck.Check;
-import net.sf.qualitycheck.exception.IllegalStateOfArgumentException;
-import net.sf.uadetector.datareader.DataReader;
-import net.sf.uadetector.datareader.XmlDataReader;
-import net.sf.uadetector.internal.data.Data;
-import net.sf.uadetector.internal.util.FileUtil;
-import net.sf.uadetector.internal.util.UrlUtil;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Implementation of a {@link DataStore} which is able to recover UAS data in XML format from a cache file. If
- * the cache file is empty, the data will be read from the given data URL.
- *
- * You can also update the data of the store at any time if you trigger {@link CachingXmlDataStore#refresh()}.
- *
- * @author André Rouél
- */
-public final class CachingXmlDataStore extends AbstractRefreshableDataStore {
-
- /**
- * Internal data store which will be used to load previously saved UAS data from a cache file.
- */
- private static class CacheFileDataStore extends AbstractDataStore {
- protected CacheFileDataStore(final Data data, final DataReader reader, final URL dataUrl, final Charset charset) {
- super(data, reader, dataUrl, dataUrl, charset);
- }
- }
-
- /**
- * The default temporary-file directory
- */
- private static final String CACHE_DIR = System.getProperty("java.io.tmpdir");
-
- /**
- * Corresponding default logger of this class
- */
- private static final Logger LOG = LoggerFactory.getLogger(CachingXmlDataStore.class);
-
- /**
- * Message for the log if the cache file is filled
- */
- private static final String MSG_CACHE_FILE_IS_EMPTY = "The cache file is empty. The given UAS data source will be imported.";
-
- /**
- * Message for the log if the cache file is empty
- */
- private static final String MSG_CACHE_FILE_IS_FILLED = "The cache file is filled and will be imported.";
-
- /**
- * Message if the cache file contains unexpected data and must be deleted manually
- */
- private static final String MSG_CACHE_FILE_IS_DAMAGED = "The cache file '%s' is damaged and must be removed manually.";
-
- /**
- * Message if the cache file contains unexpected data and has been removed
- */
- private static final String MSG_CACHE_FILE_IS_DAMAGED_AND_DELETED = "The cache file '%s' is damaged and has been deleted.";
-
- /**
- * The prefix string to be used in generating the cache file's name; must be at least three characters long
- */
- private static final String PREFIX = "uas";
-
- /**
- * The suffix string to be used in generating the cache file's name; may be {@code null}, in which case the suffix "
- * {@code .tmp}" will be used
- */
- private static final String SUFFIX = ".xml";
-
- /**
- * Constructs a new instance of {@code CachingXmlDataStore} with the given arguments. The given {@code cacheFile}
- * can be empty or filled with previously cached data in XML format. The file must be writable otherwise an
- * exception will be thrown.
- *
- * @param dataUrl
- * URL for online version of UAS data
- * @param versionURL
- * URL for version information of online UAS data
- * @param fallback
- * UAS data as fallback in case the data on the specified resource can not be read correctly
- * @return new instance of {@link CachingXmlDataStore}
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if one of the given arguments is {@code null}
- * @throws net.sf.qualitycheck.exception.IllegalStateOfArgumentException
- * if the given cache file can not be read
- * @throws net.sf.qualitycheck.exception.IllegalStateOfArgumentException
- * if no URL can be resolved to the given given file
- */
- @Nonnull
- public static CachingXmlDataStore createCachingXmlDataStore(@Nonnull final URL dataUrl, @Nonnull final URL versionURL, @Nonnull final DataStore fallback) {
- return createCachingXmlDataStore(findOrCreateCacheFile(), dataUrl, versionURL, DEFAULT_CHARSET,
- fallback);
- }
-
- @Deprecated
- public static CachingXmlDataStore createCachingXmlDataStore(@Nonnull final DataStore fallback) {
- return createCachingXmlDataStore(findOrCreateCacheFile(), fallback);
- }
-
- /**
- * Constructs a new instance of {@code CachingXmlDataStore} with the given arguments. The given {@code cacheFile}
- * can be empty or filled with previously cached data in XML format. The file must be writable otherwise an
- * exception will be thrown.
- *
- * @param cacheFile
- * file with cached UAS data in XML format or empty file
- * @param fallback
- * UAS data as fallback in case the data on the specified resource can not be read correctly
- * @return new instance of {@link CachingXmlDataStore}
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if one of the given arguments is {@code null}
- * @throws net.sf.qualitycheck.exception.IllegalStateOfArgumentException
- * if the given cache file can not be read
- * @throws net.sf.qualitycheck.exception.IllegalStateOfArgumentException
- * if no URL can be resolved to the given given file
- */
- @Nonnull
- @Deprecated
- public static CachingXmlDataStore createCachingXmlDataStore(@Nonnull final File cacheFile, @Nonnull final DataStore fallback) {
- return createCachingXmlDataStore(cacheFile, UrlUtil.build(DEFAULT_DATA_URL), UrlUtil.build(DEFAULT_VERSION_URL), DEFAULT_CHARSET,
- fallback);
- }
-
- /**
- * Constructs a new instance of {@code CachingXmlDataStore} with the given arguments. The given {@code cacheFile}
- * can be empty or filled with previously cached data in XML format. The file must be writable otherwise an
- * exception will be thrown.
- *
- * @param cacheFile
- * file with cached UAS data in XML format or empty file
- * @param dataUrl
- * URL to UAS data
- * @param versionUrl
- * URL to version information about the given UAS data
- * @param charset
- * the character set in which the data should be read
- * @param fallback
- * UAS data as fallback in case the data on the specified resource can not be read correctly
- * @return new instance of {@link CachingXmlDataStore}
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if one of the given arguments is {@code null}
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if the given cache file can not be read
- * @throws net.sf.qualitycheck.exception.IllegalStateOfArgumentException
- * if no URL can be resolved to the given given file
- */
- @Nonnull
- public static CachingXmlDataStore createCachingXmlDataStore(@Nonnull final File cacheFile, @Nonnull final URL dataUrl,
- @Nonnull final URL versionUrl, @Nonnull final Charset charset, @Nonnull final DataStore fallback) {
- Check.notNull(cacheFile, "cacheFile");
- Check.notNull(charset, "charset");
- Check.notNull(dataUrl, "dataUrl");
- Check.notNull(fallback, "fallback");
- Check.notNull(versionUrl, "versionUrl");
-
- final DataReader reader = new XmlDataReader();
- final DataStore fallbackDataStore = readCacheFileAsFallback(reader, cacheFile, charset, fallback);
- return new CachingXmlDataStore(reader, dataUrl, versionUrl, charset, cacheFile, fallbackDataStore);
- }
-
- /**
- * Constructs a new instance of {@code CachingXmlDataStore} with the given arguments. The file used to cache the
- * read in UAS data will be called from {@link CachingXmlDataStore#findOrCreateCacheFile()}. This file may
- * be empty or filled with previously cached data in XML format. The file must be writable otherwise an exception
- * will be thrown.
- *
- * @param dataUrl
- * URL to UAS data
- * @param versionUrl
- * URL to version information about the given UAS data
- * @param charset
- * the character set in which the data should be read
- * @param fallback
- * UAS data as fallback in case the data on the specified resource can not be read correctly
- * @return new instance of {@link CachingXmlDataStore}
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if one of the given arguments is {@code null}
- * @throws net.sf.qualitycheck.exception.IllegalStateOfArgumentException
- * if the given cache file can not be read
- */
- @Nonnull
- public static CachingXmlDataStore createCachingXmlDataStore(@Nonnull final URL dataUrl, @Nonnull final URL versionUrl,
- @Nonnull final Charset charset, @Nonnull final DataStore fallback) {
- return createCachingXmlDataStore(findOrCreateCacheFile(), dataUrl, versionUrl, charset, fallback);
- }
-
- /**
- * Removes the given cache file because it contains damaged content.
- *
- * @param cacheFile
- * cache file to delete
- */
- private static void deleteCacheFile(final File cacheFile) {
- try {
- if (cacheFile.delete()) {
- LOG.warn(String.format(MSG_CACHE_FILE_IS_DAMAGED_AND_DELETED, cacheFile.getPath()));
- } else {
- LOG.warn(String.format(MSG_CACHE_FILE_IS_DAMAGED, cacheFile.getPath()));
- }
- } catch (final Exception e) {
- LOG.warn(String.format(MSG_CACHE_FILE_IS_DAMAGED, cacheFile.getPath()));
- }
- }
-
- /**
- * Gets the cache file for UAS data in the default temporary-file directory. If no cache file exists, a new
- * empty file in the default temporary-file directory will be created, using the default prefix and suffix to
- * generate its name.
- *
- * @return file to cache read in UAS data
- * @throws net.sf.qualitycheck.exception.IllegalStateOfArgumentException
- * if the cache file can not be created
- */
- @Nonnull
- public static File findOrCreateCacheFile() {
- final File file = new File(CACHE_DIR, PREFIX + SUFFIX);
- if (!file.exists()) {
- try {
- file.createNewFile();
- } catch (final IOException e) {
- throw new IllegalStateOfArgumentException("Can not create a cache file.", e);
- }
- }
- return file;
- }
-
- /**
- * Checks if the given file is empty.
- *
- * @param file
- * the file that could be empty
- * @return {@code true} when the file is accessible and empty otherwise {@code false}
- * @throws net.sf.qualitycheck.exception.IllegalStateOfArgumentException
- * if an I/O error occurs
- */
- private static boolean isEmpty(@Nonnull final File file, @Nonnull final Charset charset) {
- try {
- return FileUtil.isEmpty(file, charset);
- } catch (final IOException e) {
- throw new IllegalStateOfArgumentException("The given file could not be read.", e);
- }
- }
-
- /**
- * Tries to read the content of specified cache file and returns them as fallback data store. If the cache file
- * contains unexpected data the given fallback data store will be returned instead.
- *
- * @param reader
- * data reader to read the given {@code dataUrl}
- * @param cacheFile
- * file with cached UAS data in XML format or empty file
- * @param versionUrl
- * URL to version information about the given UAS data
- * @param charset
- * the character set in which the data should be read
- * @param fallback
- * UAS data as fallback in case the data on the specified resource can not be read correctly
- * @return a fallback data store
- */
- private static DataStore readCacheFileAsFallback(@Nonnull final DataReader reader, @Nonnull final File cacheFile,
- @Nonnull final Charset charset, @Nonnull final DataStore fallback) {
- DataStore fallbackDataStore;
- if (!isEmpty(cacheFile, charset)) {
- final URL cacheFileUrl = UrlUtil.toUrl(cacheFile);
- try {
- fallbackDataStore = new CacheFileDataStore(reader.read(cacheFileUrl, charset), reader, cacheFileUrl, charset);
- LOG.debug(MSG_CACHE_FILE_IS_FILLED);
- } catch (final RuntimeException e) {
- fallbackDataStore = fallback;
- deleteCacheFile(cacheFile);
- }
- } else {
- fallbackDataStore = fallback;
- LOG.debug(MSG_CACHE_FILE_IS_EMPTY);
- }
- return fallbackDataStore;
- }
-
- /**
- * Constructs an {@code CachingXmlDataStore} with the given arguments.
- *
- * @param data
- * first UAS data which will be available in the store
- * @param reader
- * data reader to read the given {@code dataUrl}
- * @param dataUrl
- * URL to UAS data
- * @param versionUrl
- * URL to version information about the given UAS data
- * @param charset
- * the character set in which the data should be read
- * @param cacheFile
- * file with cached UAS data in XML format or an empty file
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if one of the given arguments is {@code null}
- */
- private CachingXmlDataStore(@Nonnull final DataReader reader, @Nonnull final URL dataUrl, @Nonnull final URL versionUrl,
- @Nonnull final Charset charset, @Nonnull final File cacheFile, @Nonnull final DataStore fallback) {
- super(reader, dataUrl, versionUrl, charset, fallback);
- setUpdateOperation(new UpdateOperationWithCacheFileTask(this, cacheFile));
- }
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/datastore/DataStore.java b/app/src/main/java/net/sf/uadetector/datastore/DataStore.java
deleted file mode 100644
index 169a36d..0000000
--- a/app/src/main/java/net/sf/uadetector/datastore/DataStore.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright 2012 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector.datastore;
-
-import java.net.URL;
-import java.nio.charset.Charset;
-
-import javax.annotation.Nonnull;
-
-import net.sf.uadetector.datareader.DataReader;
-import net.sf.uadetector.internal.data.Data;
-
-/**
- * Defines an interface to store UAS data where ever you want.
- *
- * @author André Rouél
- */
-public interface DataStore {
-
- /**
- * Default character set to read UAS data
- */
- Charset DEFAULT_CHARSET = Charset.forName("UTF-8");
-
- /**
- * URL to retrieve the current UAS data as XML
- */
- @Deprecated
- String DEFAULT_DATA_URL = "http://user-agent-string.info/rpc/get_data.php?key=free&format=xml";
-
- /**
- * URL to retrieve the current version of the UAS data
- */
- @Deprecated
- String DEFAULT_VERSION_URL = "http://user-agent-string.info/rpc/get_data.php?key=free&format=ini&ver=y";
-
- /**
- * Gets the character set in which the UAS data will be read.
- *
- * @return current UAS data
- */
- @Nonnull
- Charset getCharset();
-
- /**
- * Gets the UAS data which are currently set.
- *
- * @return current UAS data
- */
- @Nonnull
- Data getData();
-
- /**
- * Gets the data reader to read in UAS data.
- *
- * @return the data reader to read in UAS data
- */
- @Nonnull
- DataReader getDataReader();
-
- /**
- * Gets the URL from which the UAS data can be read.
- *
- * @return URL to UAS data
- */
- @Nonnull
- URL getDataUrl();
-
- /**
- * Gets the URL from which version information about the UAS data can be read.
- *
- * @return URL to version information of UAS data
- */
- @Nonnull
- URL getVersionUrl();
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/datastore/OnlineXmlDataStore.java b/app/src/main/java/net/sf/uadetector/datastore/OnlineXmlDataStore.java
deleted file mode 100644
index 181996d..0000000
--- a/app/src/main/java/net/sf/uadetector/datastore/OnlineXmlDataStore.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright 2012 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector.datastore;
-
-import java.net.URL;
-
-import net.sf.uadetector.datareader.DataReader;
-import net.sf.uadetector.datareader.XmlDataReader;
-
-/**
- * This is the simplest implementation of a {@link RefreshableDataStore}. It initialize the store by reading the
- * UAS data online via {@link DataStore#DEFAULT_DATA_URL} and store it only in the Java heap space.
- *
- *
- * This exception is intended to tunnel the checked exception {@link java.io.IOException} during the call
- * {@link java.net.URL#openStream()}.
- *
- * @author André Rouél
- */
-public class CanNotOpenStreamException extends RuntimeException {
-
- private static final long serialVersionUID = 8381680536297450770L;
-
- protected static final String DEFAULT_MESSAGE = "Can not open stream to the given URL.";
-
- protected static final String MESSAGE_WITH_URL = "Can not open stream to the given URL: %s";
-
- private static String format(final String url) {
- return String.format(MESSAGE_WITH_URL, url);
- }
-
- /**
- * Constructs an {@code CanNotOpenStreamException} with the default message
- * {@link CanNotOpenStreamException#DEFAULT_MESSAGE}.
- */
- public CanNotOpenStreamException() {
- super(DEFAULT_MESSAGE);
- }
-
- /**
- * Constructs an {@code CanNotOpenStreamException} with the message
- * {@link CanNotOpenStreamException#MESSAGE_WITH_URL} including the given URL as string representation.
- *
- * @param url
- * the URL to which no stream can be established
- */
- public CanNotOpenStreamException(final String url) {
- super(format(url));
- }
-
- /**
- * Constructs a new exception with the message {@link CanNotOpenStreamException#MESSAGE_WITH_URL} including the
- * given URL as string representation and cause.
- *
- * @param url
- * the URL to which no stream can be established
- * @param cause
- * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A
- * {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
- */
- public CanNotOpenStreamException(final String url, final Throwable cause) {
- super(format(url), cause);
- }
-
- /**
- * Constructs a new exception with the default message {@link CanNotOpenStreamException#DEFAULT_MESSAGE}.
- *
- * @param cause
- * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A
- * {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
- */
- public CanNotOpenStreamException(final Throwable cause) {
- super(DEFAULT_MESSAGE, cause);
- }
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/exception/CannotCloseException.java b/app/src/main/java/net/sf/uadetector/exception/CannotCloseException.java
deleted file mode 100644
index d5abc95..0000000
--- a/app/src/main/java/net/sf/uadetector/exception/CannotCloseException.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright 2012 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector.exception;
-
-/**
- * Thrown to indicate that a {@link java.io.Closeable} cannot be closed.
- *
- * This exception is intended to tunnel the checked exception {@link java.io.IOException} during the call
- * {@link java.io.Closeable#close()}.
- *
- * @author André Rouél
- */
-public class CannotCloseException extends RuntimeException {
-
- private static final long serialVersionUID = -8641033043995976022L;
-
- protected static final String DEFAULT_MESSAGE = "Cannot close the given Closeable.";
-
- protected static final String MESSAGE_WITH_INFO = "Cannot close the given Closeable: %s";
-
- private static String format(final String url) {
- return String.format(MESSAGE_WITH_INFO, url);
- }
-
- /**
- * Constructs an {@code CannotCloseException} with the default message {@link CannotCloseException#DEFAULT_MESSAGE}.
- */
- public CannotCloseException() {
- super(DEFAULT_MESSAGE);
- }
-
- /**
- * Constructs an {@code CannotCloseException} with the message {@link CannotCloseException#MESSAGE_WITH_INFO}
- * including additional information.
- *
- * @param info
- * additional information why a {@link java.io.Closeable} cannot be closed
- */
- public CannotCloseException(final String info) {
- super(format(info));
- }
-
- /**
- * Constructs a new exception with the message {@link CannotCloseException#MESSAGE_WITH_INFO} including additional
- * information.
- *
- * @param info
- * additional information why a {@link java.io.Closeable} cannot be closed
- * @param cause
- * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A
- * {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
- */
- public CannotCloseException(final String info, final Throwable cause) {
- super(format(info), cause);
- }
-
- /**
- * Constructs a new exception with the default message {@link CannotCloseException#DEFAULT_MESSAGE}.
- *
- * @param cause
- * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A
- * {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
- */
- public CannotCloseException(final Throwable cause) {
- super(DEFAULT_MESSAGE, cause);
- }
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/exception/package-info.java b/app/src/main/java/net/sf/uadetector/exception/package-info.java
deleted file mode 100644
index 3a9659a..0000000
--- a/app/src/main/java/net/sf/uadetector/exception/package-info.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright 2012 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-@javax.annotation.ParametersAreNonnullByDefault
-package net.sf.uadetector.exception;
diff --git a/app/src/main/java/net/sf/uadetector/internal/data/BrowserOperatingSystemMappingComparator.java b/app/src/main/java/net/sf/uadetector/internal/data/BrowserOperatingSystemMappingComparator.java
deleted file mode 100644
index 3f9b536..0000000
--- a/app/src/main/java/net/sf/uadetector/internal/data/BrowserOperatingSystemMappingComparator.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package net.sf.uadetector.internal.data;
-
-import javax.annotation.concurrent.ThreadSafe;
-
-import net.sf.uadetector.internal.data.domain.BrowserOperatingSystemMapping;
-import net.sf.uadetector.internal.util.CompareNullSafe;
-
-@ThreadSafe
-public final class BrowserOperatingSystemMappingComparator extends CompareNullSafeUserAgentInfo.Builder
.
- */
- public void copyTo(@Nonnull final UserAgent.Builder builder) {
- builder.setFamily(family);
- builder.setIcon(icon);
- builder.setName(familyName);
- builder.setProducer(producer);
- builder.setProducerUrl(producerUrl);
- builder.setTypeName(type.getName());
- builder.setUrl(url);
- if (operatingSystem != null) {
- operatingSystem.copyTo(builder);
- }
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final Browser other = (Browser) obj;
- if (id != other.id) {
- return false;
- }
- if (!family.equals(other.family)) {
- return false;
- }
- if (!familyName.equals(other.familyName)) {
- return false;
- }
- if (!patterns.equals(other.patterns)) {
- return false;
- }
- if (!type.equals(other.type)) {
- return false;
- }
- if (operatingSystem == null) {
- if (other.operatingSystem != null) {
- return false;
- }
- } else if (!operatingSystem.equals(other.operatingSystem)) {
- return false;
- }
- if (!icon.equals(other.icon)) {
- return false;
- }
- if (!infoUrl.equals(other.infoUrl)) {
- return false;
- }
- if (!producer.equals(other.producer)) {
- return false;
- }
- if (!producerUrl.equals(other.producerUrl)) {
- return false;
- }
- if (!url.equals(other.url)) {
- return false;
- }
- return true;
- }
-
- @Nonnull
- public UserAgentFamily getFamily() {
- return family;
- }
-
- @Nonnull
- public String getFamilyName() {
- return familyName;
- }
-
- @Nonnull
- public String getIcon() {
- return icon;
- }
-
- @Override
- @Nonnegative
- public int getId() {
- return id;
- }
-
- @Nonnull
- public String getInfoUrl() {
- return infoUrl;
- }
-
- @Nullable
- public OperatingSystem getOperatingSystem() {
- return operatingSystem;
- }
-
- @Nonnull
- public SortedSet
- *
- * A {@code BrowserPattern} object is immutable, their values cannot be changed after creation.
- *
- * @author André Rouél
- */
-@Immutable
-public final class BrowserPattern implements Identifiable, OrderedPattern
- *
- * A {@code BrowserType} object is immutable, their values cannot be changed after creation.
- *
- * @author André Rouél
- */
-@Immutable
-public final class BrowserType implements Identifiable, Serializable {
-
- @NotThreadSafe
- public static final class Builder {
-
- /**
- * Identification number (ID) of a browser type entry
- */
- private int id = Integer.MIN_VALUE;
-
- /**
- * Name of a browser type entry
- */
- private String name;
-
- /**
- * Builds a new instance of {@code BrowserType} and returns it.
- *
- * @return a new instance of {@code BrowserType}
- * @throws net.sf.qualitycheck.exception.IllegalNegativeArgumentException
- * if one of the needed arguments to build an instance of {@code BrowserType} is invalid
- * @throws net.sf.qualitycheck.exception.IllegalNullArgumentException
- * if one of the needed arguments to build an instance of {@code BrowserType} is invalid
- */
- @Nonnull
- public BrowserType build() {
- return new BrowserType(id, name);
- }
-
- /**
- * Sets the identification number (ID).
- *
- * @param id
- * ID of browser type
- */
- @Nonnull
- public Builder setId(@Nonnegative final int id) {
- Check.notNegative(id, "id");
-
- this.id = id;
- return this;
- }
-
- /**
- * Sets the identification number via a string.
- *
- * An opening and closing Square brackets at the end of a string will be filtered. If the string can not be
- * parsed as a long, a {@code NumberFormatException} will be thrown.
- *
- * @param id
- * ID of browser type
- */
- @Nonnull
- public Builder setId(@Nonnull final String id) {
- Check.notNull(id, "id");
-
- this.setId(Integer.parseInt(id.trim()));
- return this;
- }
-
- /**
- * Sets the name.
- *
- * @param name
- * name of the browser type
- */
- @Nonnull
- public Builder setName(@Nonnull final String name) {
- Check.notNull(name, "name");
-
- this.name = name;
- return this;
- }
-
- }
-
- private static final long serialVersionUID = 2643535063309729806L;
-
- @Nonnegative
- private final int id;
-
- @Nonnull
- private final String name;
-
- public BrowserType(@Nonnegative final int id, @Nonnull final String name) {
- Check.notNegative(id, "id");
- Check.notNull(name, "name");
-
- this.id = id;
- this.name = name;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final BrowserType other = (BrowserType) obj;
- if (id != other.id) {
- return false;
- }
- if (!name.equals(other.name)) {
- return false;
- }
- return true;
- }
-
- /**
- * Gets the identification number (ID) of a browser type.
- *
- * @return identification number (ID) of a browser type
- */
- @Override
- public int getId() {
- return id;
- }
-
- public String getName() {
- return name;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + id;
- result = prime * result + name.hashCode();
- return result;
- }
-
- @Override
- public String toString() {
- final StringBuilder builder = new StringBuilder();
- builder.append("BrowserType [id=");
- builder.append(id);
- builder.append(", name=");
- builder.append(name);
- builder.append("]");
- return builder.toString();
- }
-
-}
diff --git a/app/src/main/java/net/sf/uadetector/internal/data/domain/Device.java b/app/src/main/java/net/sf/uadetector/internal/data/domain/Device.java
deleted file mode 100644
index cd4cd47..0000000
--- a/app/src/main/java/net/sf/uadetector/internal/data/domain/Device.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*******************************************************************************
- * Copyright 2013 André Rouél
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package net.sf.uadetector.internal.data.domain;
-
-import java.io.Serializable;
-import java.util.Collections;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import javax.annotation.Nonnegative;
-import javax.annotation.Nonnull;
-import javax.annotation.concurrent.Immutable;
-import javax.annotation.concurrent.NotThreadSafe;
-
-import net.sf.qualitycheck.Check;
-import net.sf.uadetector.ReadableDeviceCategory.Category;
-
-@Immutable
-public final class Device implements Identifiable, Serializable {
-
- @NotThreadSafe
- public static final class Builder {
-
- private static final String EMPTY = "";
-
- @Nonnull
- private String icon = EMPTY;
-
- private int id = Integer.MIN_VALUE;
-
- @Nonnull
- private String infoUrl = EMPTY;
-
- private String name;
-
- @Nonnull
- private SortedSet
- *
- * A {@code DevicePattern} object is immutable, their values cannot be changed after creation.
- *
- * @author André Rouél
- */
-@Immutable
-public final class DevicePattern implements Identifiable, OrderedPattern
- *
- * A {@code OperatingSystemPattern} object is immutable, their values cannot be changed after creation.
- *
- * @author André Rouél
- */
-@Immutable
-public final class OperatingSystemPattern implements Identifiable, OrderedPattern