<commit_before># Kloudless API Java Bindings

You can sign up for a Kloudless Developer account at https://kloudless.com.

# Requirements

Java 1.8 and later.

# Installation

### Maven

Add this dependency to your project's POM:

```xml
<dependency>
    <groupId>com.kloudless</groupId>
    <artifactId>kloudless-java</artifactId>
    <version>1.1.0</version>
</dependency>
```

### Gradle

Add this dependency to your project's build file:

```groovy
compile 'com.kloudless:kloudless-java:1.1.0'
```

### Others

You'll need to manually install the Kloudless JAR, either by compiling it or
downloading it from the [Releases page](https://github.com/Kloudless/kloudless-java/releases/)

# Usage


See [KloudlessTest.java](https://github.com/Kloudless/kloudless-java/blob/master/test/com/kloudless/KloudlessTest.java)
for more examples.

User Impersonation can be seen found in KloudlessTest.java or the example below:

```java
HashMap<String, String> customHeaders = new HashMap<String, String>();
customHeaders.put("X-Kloudless-As-User", "<USER ID>");
Kloudless.addCustomHeaders(customHeaders);
```

## Instantiating a Kloudless Client

The 1.1.0 version of the Kloudless Java SDK includes the KClient class, which
allows you to instantiate a client with a specific bearer token and account id.

It is fairly basic to instantiate:

```java
// Instantiation
KClient storageClient = new KClient("token1<PASSWORD>", "accountID12345", null);

// Retrieve contents of Folder with id "root"
storageClient.contents(null, Folder.class, "root");
```

If you want to add user impersonation, the 3rd argument is for any additional
headers that will be added to all requests.

See [KloudlessClientTest.java](https://github.com/Kloudless/kloudless-java/blob/master/test/com/kloudless/KloudlessClientTest.java) for more examples.


# Building


* You can create the jar, skipping tests, with `mvn install -DskipTests`.
* You can create a jar that includes dependencies with `mvn compile assembly:single`.
* You can gather dependencies for easy installation/deployment with `mvn dependency:copy-dependencies`.
  They will be located in `target/dependencies`.

# Testing

You must have Maven installed. To run the tests, simply run `mvn test`.
Before tests, the API key or bearer token can be specified by using environment 
variables, program arguments, or the property file. The property file is required
for tests.<commit_msg>fix source code links in README<commit_after># Kloudless API Java Bindings

You can sign up for a Kloudless Developer account at https://kloudless.com.

# Requirements

Java 1.8 and later.

# Installation

### Maven

Add this dependency to your project's POM:

```xml
<dependency>
    <groupId>com.kloudless</groupId>
    <artifactId>kloudless-java</artifactId>
    <version>1.1.0</version>
</dependency>
```

### Gradle

Add this dependency to your project's build file:

```groovy
compile 'com.kloudless:kloudless-java:1.1.0'
```

### Others

You'll need to manually install the Kloudless JAR, either by compiling it or
downloading it from the [Releases page](https://github.com/Kloudless/kloudless-java/releases/)

# Usage


See [KloudlessTest.java](https://github.com/Kloudless/kloudless-java/blob/master/src/test/java/com/kloudless/KloudlessTest.java)
for more examples.

User Impersonation can be seen found in KloudlessTest.java or the example below:

```java
HashMap<String, String> customHeaders = new HashMap<String, String>();
customHeaders.put("X-Kloudless-As-User", "<USER ID>");
Kloudless.addCustomHeaders(customHeaders);
```

## Instantiating a Kloudless Client

The 1.1.0 version of the Kloudless Java SDK includes the KClient class, which
allows you to instantiate a client with a specific bearer token and account id.

It is fairly basic to instantiate:

```java
// Instantiation
KClient storageClient = new KClient("token<PASSWORD>", "accountID12345", null);

// Retrieve contents of Folder with id "root"
storageClient.contents(null, Folder.class, "root");
```

If you want to add user impersonation, the 3rd argument is for any additional
headers that will be added to all requests.

See [KloudlessClientTest.java](https://github.com/Kloudless/kloudless-java/blob/master/src/test/java/com/kloudless/KloudlessClientTest.java) for more examples.


# Building


* You can create the jar, skipping tests, with `mvn install -DskipTests`.
* You can create a jar that includes dependencies with `mvn compile assembly:single`.
* You can gather dependencies for easy installation/deployment with `mvn dependency:copy-dependencies`.
  They will be located in `target/dependencies`.

# Testing

You must have Maven installed. To run the tests, simply run `mvn test`.
Before tests, the API key or bearer token can be specified by using environment 
variables, program arguments, or the property file. The property file is required
for tests.
{'fraction_non_alphanumeric': 0.09907502569373072, 'fraction_numerical': 0.007194244604316547, 'mean_word_length': 4.8768115942028984, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3559571', 'n_tokens_mistral': 1537, 'n_tokens_neox': 1428, 'n_words': 526}