Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .github/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions .github/workflows/only-rc-into-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Only rc into main

# A pull request into the default branch must come from rc. See
# 51Degrees/common-ci .github/workflows/only-rc-into-main.yml.
on:
pull_request:

jobs:
rc:
name: Only rc into main
uses: 51Degrees/common-ci/.github/workflows/only-rc-into-main.yml@main
55 changes: 47 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
# 51Degrees Java
# 51Degrees Device Detection and IP Intelligence for Java

![51Degrees](https://51degrees.com/img/logo.png?utm_source=github&utm_medium=readme&utm_campaign=51degrees-java&utm_content=readme.md&utm_term=51degrees-java "Data rewards the curious") **Java packages for the Pipeline API, Device Detection, IP Intelligence and Location**
<img src=".github/images/logo.png" alt="51Degrees" title="Data rewards the curious" width="160">

This repository holds the 51Degrees Java packages. Each package is still
published to Maven Central under its own coordinates, and the examples show
how a project of your own uses them.
**Java packages for the Pipeline API, Device Detection, IP Intelligence and Location**

Our User-Agent parser for Java supports Device Detection, browser detection, mobile detection, and crawler detection on-premise or in the cloud. IP Intelligence adds IP geolocation, including IP to country data.

It reads User-Agent and User-Agent Client Hints, HTTP request headers that carry browser and device information. For cloud bot detection, Human Confidence reports confidence that a person is viewing the page.

## Install

Each product is a separate Maven Central package. For Device Detection, cloud or on-premise:

```xml
<!-- Make sure to select the latest version from https://mvnrepository.com/artifact/com.51degrees/pipeline.device-detection -->
<dependency>
<groupId>com.51degrees</groupId>
<artifactId>device-detection</artifactId>
<version>4.5.x</version>
</dependency>
```

The product guides below list the other packages. To build from source, see [Getting the code](#getting-the-code).

Try the [User-Agent tester](https://51degrees.com/developers/user-agent-tester?utm_source=github&utm_medium=readme&utm_campaign=51degrees-java&utm_content=readme.md&utm_term=install) and [IP tester](https://51degrees.com/developers/ip-tester?utm_source=github&utm_medium=readme&utm_campaign=51degrees-java&utm_content=readme.md&utm_term=install). For cloud use, [create a Resource Key](https://configure.51degrees.com/?utm_source=github&utm_medium=readme&utm_campaign=51degrees-java&utm_content=readme.md&utm_term=install).

Created from `pipeline-java`, `device-detection-java`, `ip-intelligence-java`, `location-java`, `device-detection-java-examples`, and `ip-intelligence-java-examples`, this repository continues their work.

| Product | Read first | Documentation |
| --- | --- | --- |
Expand Down Expand Up @@ -67,9 +88,9 @@ mvn install -DskipTests -pl device-detection -am
mvn surefire:test
```

The cloud tests need a resource key, passed as `-DTestResourceKey=<key>`. The
The cloud tests need a Resource Key, passed as `-DTestResourceKey=<key>`. The
on-premise IP Intelligence tests need the Lite or Enterprise data file, which
is not in the repository; see `ip-intelligence/README.md` for how to get it.
is not in the repository. See `ip-intelligence/README.md` for how to get it.
Tests find data files by searching from the root of this repository, so run
Maven from here rather than from inside a package folder.

Expand Down Expand Up @@ -106,6 +127,16 @@ with the plain version, such as `4.5.127`.

## History

| Earlier repository | What it held |
| --- | --- |
| [pipeline-java](https://github.com/51Degrees/pipeline-java) | The Pipeline API |
| [device-detection-java](https://github.com/51Degrees/device-detection-java) | Device Detection |
| [ip-intelligence-java](https://github.com/51Degrees/ip-intelligence-java) | IP Intelligence |
| [location-java](https://github.com/51Degrees/location-java) | Location |
| [device-detection-java-examples](https://github.com/51Degrees/device-detection-java-examples) | Device Detection examples |
| [ip-intelligence-java-examples](https://github.com/51Degrees/ip-intelligence-java-examples) | IP Intelligence examples |


The folders `pipeline`, `device-detection`, `ip-intelligence`, `location` and
the two example folders were brought in from the separate repositories
[pipeline-java](https://github.com/51Degrees/pipeline-java),
Expand All @@ -120,6 +151,14 @@ SHA. The history of a file before the import is under its old path, so read it
from the imported commit, for example `git log aff7c544 -- pom.xml` for what is
now `pipeline/pom.xml`.

## Licence
## License

[European Union Public Licence v1.2](LICENSE)

## Find out more

- [Device Detection](https://51degrees.com/device-detection?utm_source=github&utm_medium=readme&utm_campaign=51degrees-java&utm_content=readme.md&utm_term=find-out-more)
- [IP Intelligence](https://51degrees.com/ip-intelligence?utm_source=github&utm_medium=readme&utm_campaign=51degrees-java&utm_content=readme.md&utm_term=find-out-more)
- [Bots and humans](https://51degrees.com/bots-and-humans?utm_source=github&utm_medium=readme&utm_campaign=51degrees-java&utm_content=readme.md&utm_term=find-out-more)
- [Documentation](https://51degrees.com/documentation/index.html?utm_source=github&utm_medium=readme&utm_campaign=51degrees-java&utm_content=readme.md&utm_term=find-out-more)
- https://github.com/51Degrees/51degrees-cxx
2 changes: 1 addition & 1 deletion cxx
4 changes: 2 additions & 2 deletions device-detection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,14 @@ or shaded.
The names come from an `Automatic-Module-Name` manifest entry, so the jars remain
ordinary non-modular jars, build identically on every JDK from 8 upwards, and nothing
changes for consumers who stay on the classpath. See the
[pipeline-java README](https://github.com/51Degrees/pipeline-java#native-library-access)
[pipeline-java README](https://github.com/51Degrees/51degrees-java/blob/main/pipeline/README.md#native-library-access)
for the pipeline module names and for how to configure element builders when a jar is on
the module path.

## Examples

Examples can be found in
[device-detection-java-examples](https://github.com/51Degrees/device-detection-java-examples)
[device-detection-java-examples](https://github.com/51Degrees/51degrees-java/tree/main/examples/device-detection)
repository.

## Tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class Constants {
"possible, you may be able to use a different library by " +
"rebuilding the binary on the target system using the source " +
"code and instructions available on " +
"https://github.com/51degrees/device-detection-java.";
"https://github.com/51Degrees/51degrees-java/tree/main/device-detection.";

/**
* Message returned when the native library could not be loaded.
Expand Down
5 changes: 1 addition & 4 deletions device-detection/docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,6 @@ WARN_LOGFILE =

INPUT = ../device-detection/src/main \
../device-detection.cloud/src/main \
../device-detection.shell.examples/src/main \
../device-detection.hash.engine.on-premise/src/main \
../device-detection.shared/src/main \
../../examples/device-detection \
Expand Down Expand Up @@ -897,9 +896,7 @@ EXCLUDE_SYMBOLS =
# that contain example code fragments that are included (see the \include
# command).

EXAMPLE_PATH = ../device-detection.shell.examples \
../device-detection.web.examples \
../../examples/device-detection \
EXAMPLE_PATH = ../../examples/device-detection \
../../../documentation/src/snippets

# If the value of the EXAMPLE_PATH tag contains directories, you can use the
Expand Down
2 changes: 1 addition & 1 deletion examples/device-detection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,4 @@ A fat jar cannot narrow this any further, because everything inside it is part o
unnamed module. To grant native access to 51Degrees code alone you need the individual
jars, with `pipeline.engines.fiftyone` and `device-detection.hash.engine.on-premise` on
the module path - see the
[device-detection-java README](https://github.com/51Degrees/device-detection-java#native-library-access).
[device-detection-java README](https://github.com/51Degrees/51degrees-java/blob/main/device-detection/README.md#native-library-access).
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private static void analyzeEvidence(Map<String, String> evidence,
*
* @include{doc} example-getting-started-cloud.txt
*
* This example is available in full on [GitHub](https://github.com/51Degrees/device-detection-java-examples/blob/main/console/src/main/java/fiftyone/devicedetection/examples/console/GettingStartedCloud.java).
* This example is available in full on [GitHub](https://github.com/51Degrees/51degrees-java/blob/main/examples/device-detection/console/src/main/java/fiftyone/devicedetection/examples/console/GettingStartedCloud.java).
*
* @include{doc} example-require-resourcekey.txt
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,6 @@ private static void analyzeEvidence(Map<String, String> evidence,
* @example console/GettingStartedOnPrem.java
* @include{doc} example-getting-started-onpremise.txt
* <p>
* This example is available in full on [GitHub](https://github.com/51Degrees/device-detection-java-examples/blob/master/console/src/main/java/fiftyone/devicedetection/examples/console/GettingStartedOnPrem.java).
* This example is available in full on [GitHub](https://github.com/51Degrees/51degrees-java/blob/main/examples/device-detection/console/src/main/java/fiftyone/devicedetection/examples/console/GettingStartedOnPrem.java).
* @include{doc} example-require-datafile.txt
*/
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ static void run(String dataFile, List<Map<String, String>> evidenceList,
* [performance options](/documentation/4.5/_device_detection__features__performance_options.html)
* page.
* # Location
* This example is available in full on [GitHub](https://github.com/51Degrees/device-detection-java-examples/blob/master/console/src/main/java/fiftyone/devicedetection/examples/console/MatchMetrics.java).
* This example is available in full on [GitHub](https://github.com/51Degrees/51degrees-java/blob/main/examples/device-detection/console/src/main/java/fiftyone/devicedetection/examples/console/MatchMetrics.java).
*
*/

Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ private static void outputProperties(DeviceDetectionCloudEngine engine, PrintWri
* keys that, when added to the evidence collection in flow data, could have some impact on the
* result returned by device detection.
*
* This example is available in full on [GitHub](https://github.com/51Degrees/device-detection-java-examples/blob/master/console/src/main/java/fiftyone/devicedetection/examples/console/MetadataCloud.java).
* This example is available in full on [GitHub](https://github.com/51Degrees/51degrees-java/blob/main/examples/device-detection/console/src/main/java/fiftyone/devicedetection/examples/console/MetadataCloud.java).
*
* @include{doc} example-require-datafile.txt
*/
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ private static String truncateToNl(String text) {
* keys that, when added to the evidence collection in flow data, could have some impact on the
* result returned by device detection.
*
* This example is available in full on [GitHub](https://github.com/51Degrees/device-detection-java-examples/blob/main/console/src/main/java/fiftyone/devicedetection/examples/console/MetadataOnPrem.java).
* This example is available in full on [GitHub](https://github.com/51Degrees/51degrees-java/blob/main/examples/device-detection/console/src/main/java/fiftyone/devicedetection/examples/console/MetadataOnPrem.java).
*
* @include{doc} example-require-datafile.txt
*/
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static void analyseNativeModel(String nativemodel, Pipeline pipeline, PrintWrite
}
}
/*!
* @example @example console/NativeModel.java
* @example console/NativeModelCloud.java
*
* This example shows how to use the 51Degrees Cloud service to look up the details of a device
* based on a given 'native model name'. Native model name is a string of characters that are
Expand All @@ -133,5 +133,5 @@ static void analyseNativeModel(String nativemodel, Pipeline pipeline, PrintWrite
* pricing page](https://51degrees.com/pricing?utm_source=code&utm_medium=example&utm_campaign=51degrees-java&utm_content=console-src-main-java-fiftyone-devicedetection-examples-console-nativemodelcloud.java&utm_term=top). Once this is done, a resource key with the
* properties required by this example can be created at [here](https://configure.51degrees.com/QKyYH5XT?utm_source=code&utm_medium=example&utm_campaign=51degrees-java&utm_content=console-src-main-java-fiftyone-devicedetection-examples-console-nativemodelcloud.java&utm_term=top).
*
* This example is available in full on [GitHub](https://github.com/51Degrees/device-detection-java-examples/blob/master/console/src/main/java/fiftyone/devicedetection/examples/console/NativeModelCloud.java).
* This example is available in full on [GitHub](https://github.com/51Degrees/51degrees-java/blob/main/examples/device-detection/console/src/main/java/fiftyone/devicedetection/examples/console/NativeModelCloud.java).
*/
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ private static Map<String, Object> getPopulatedProperties(DeviceData data, Strin
* @example console/OfflineProcessing.java
* @include{doc} example-offline-processing-hash.txt
* <p>
* This example is available in full on [GitHub](https://github.com/51Degrees/device-detection-java-examples/blob/master/console/src/main/java/fiftyone/devicedetection/examples/console/OfflineProcessing.java).
* This example is available in full on [GitHub](https://github.com/51Degrees/51degrees-java/blob/main/examples/device-detection/console/src/main/java/fiftyone/devicedetection/examples/console/OfflineProcessing.java).
* @include{doc} example-require-datafile.txt
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ public PerformanceConfiguration(Constants.PerformanceProfiles profile,
* and [hash dataset options](/documentation/4.5/_device_detection__hash.html#DeviceDetection_Hash_DataSetProduction_Performance)
* for more information about adjusting performance.
*
* This example is available in full on [GitHub](https://github.com/51Degrees/device-detection-java-examples/blob/master/console/src/main/java/fiftyone/devicedetection/examples/console/PerformanceBenchmark.java).
* This example is available in full on [GitHub](https://github.com/51Degrees/51degrees-java/blob/main/examples/device-detection/console/src/main/java/fiftyone/devicedetection/examples/console/PerformanceBenchmark.java).
*
* @include{doc} example-require-datafile.txt
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static void analyseTac(String tac, Pipeline pipeline, PrintWriter output) throws
* [pricing page](https://51degrees.com/pricing?utm_source=code&utm_medium=example&utm_campaign=51degrees-java&utm_content=console-src-main-java-fiftyone-devicedetection-examples-console-taccloud.java&utm_term=top). Once this is done, a resource key with the
* properties required by this example can be created [here](https://configure.51degrees.com/QKyYH5XT?utm_source=code&utm_medium=example&utm_campaign=51degrees-java&utm_content=console-src-main-java-fiftyone-devicedetection-examples-console-taccloud.java&utm_term=top).
*
* This example is available in full on [GitHub](https://github.com/51Degrees/device-detection-java-examples/blob/master/console/src/main/java/fiftyone/devicedetection/examples/console/TacCloud.java).
* This example is available in full on [GitHub](https://github.com/51Degrees/51degrees-java/blob/main/examples/device-detection/console/src/main/java/fiftyone/devicedetection/examples/console/TacCloud.java).
*
* @include{doc} example-require-resourcekey.txt
*/
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
.setUpdateRandomisationMax(10*60)
* ```
* # Location
* This example is available in full on [GitHub](https://github.com/51Degrees/device-detection-java/blob/master/device-detection-java-examples/console/src/main/java/fiftyone/devicedetection/examples/console/UpdateDataFile.java).
* This example is available in full on [GitHub](https://github.com/51Degrees/51degrees-java/blob/main/examples/device-detection/console/src/main/java/fiftyone/devicedetection/examples/console/UpdateDataFile.java).
*
* @include{doc} example-require-licensekey.txt
*/
Expand Down
2 changes: 1 addition & 1 deletion examples/device-detection/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<junit.version>4.13.2</junit.version>
<maven.deploy.skip>true</maven.deploy.skip>
<snakeyaml.version>1.30</snakeyaml.version>
<device-detection.version>4.5.126</device-detection.version>
<device-detection.version>4.5.128</device-detection.version>
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>

<ossrh.baseurl>https://oss.sonatype.org</ossrh.baseurl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) {
*
* @include{doc} example-getting-started-web.txt
*
* This example is available in full on [GitHub](https://github.com/51Degrees/device-detection-java-examples/blob/master/web/getting-started.cloud/src/main/java/fiftyone/devicedetection/examples/web/GettingStartedWebCloud.java).
* This example is available in full on [GitHub](https://github.com/51Degrees/51degrees-java/blob/main/examples/device-detection/web/getting-started.cloud/src/main/java/fiftyone/devicedetection/examples/web/GettingStartedWebCloud.java).
*
* @include{doc} example-require-resourcekey.txt
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) {
*
* @include{doc} example-getting-started-web.txt
*
* This example is available in full on [GitHub](https://github.com/51Degrees/device-detection-java-examples/blob/master/web/getting-started.onprem/src/main/java/fiftyone/devicedetection/examples/web/GettingStartedWebOnPrem.java).
* This example is available in full on [GitHub](https://github.com/51Degrees/51degrees-java/blob/main/examples/device-detection/web/getting-started.onprem/src/main/java/fiftyone/devicedetection/examples/web/GettingStartedWebOnPrem.java).
*
* @include{doc} example-require-datafile.txt
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
* The output CSV file contains the input truth and the result fields for easy
* evaluation.
*
* This example is available in full on [GitHub](https://github.com/51Degrees/ip-intelligence-java-examples/blob/main/console/src/main/java/fiftyone/ipintelligence/examples/console/CompareOnPrem.java).
* This example is available in full on [GitHub](https://github.com/51Degrees/51degrees-java/blob/main/examples/ip-intelligence/console/src/main/java/fiftyone/ipintelligence/examples/console/CompareOnPrem.java).
*
* This example requires an enterprise IP Intelligence data file (.ipi).
* To obtain an enterprise data file for testing, please [contact us](https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=51degrees-java&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-compareonprem.java&utm_term=contact-us).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* 2. How to process an IP address and retrieve all available properties
* 3. How to enumerate through all the properties returned by the service
*
* This example is available in full on [GitHub](https://github.com/51Degrees/ip-intelligence-java-examples/blob/main/console/src/main/java/fiftyone/ipintelligence/examples/console/GetAllPropertiesCloud.java).
* This example is available in full on [GitHub](https://github.com/51Degrees/51degrees-java/blob/main/examples/ip-intelligence/console/src/main/java/fiftyone/ipintelligence/examples/console/GetAllPropertiesCloud.java).
*
* To run this example, you will eventually need to create a Resource Key. A Resource Key is used as
* shorthand to store the particular set of properties you are interested in as well as any
Expand Down
Loading
Loading