Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Commit

Permalink
documentation update, renamed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Synapticloop authored and Synapticloop committed Mar 11, 2016
1 parent 6400c8e commit 937ebc6
Show file tree
Hide file tree
Showing 7 changed files with 110 additions and 30 deletions.
120 changes: 97 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/synapticloop/backblaze-b2-java-api.svg?branch=master)](https://travis-ci.org/synapticloop/backblaze-b2-java-api)[![Download](https://api.bintray.com/packages/synapticloop/maven/backblaze-b2-java-api/images/download.svg)](https://bintray.com/synapticloop/maven/backblaze-b2-java-api/_latestVersion)[![GitHub Release](https://img.shields.io/github/release/synapticloop/backblaze-b2-java-api.svg)](https://github.com/synapticloop/backblaze-b2-java-api/releases)
[![Build Status](https://travis-ci.org/synapticloop/backblaze-b2-java-api.svg?branch=master)](https://travis-ci.org/synapticloop/backblaze-b2-java-api) [![Download](https://api.bintray.com/packages/synapticloop/maven/backblaze-b2-java-api/images/download.svg)](https://bintray.com/synapticloop/maven/backblaze-b2-java-api/_latestVersion) [![GitHub Release](https://img.shields.io/github/release/synapticloop/backblaze-b2-java-api.svg)](https://github.com/synapticloop/backblaze-b2-java-api/releases)

# backblaze-b2-java-api

Expand All @@ -10,6 +10,13 @@
# Usage

```
// import the API Client
import synapticloop.b2.B2ApiClient;
import synapticloop.b2.exception.B2ApiException;
import synapticloop.b2.request.*;
import synapticloop.b2.response.*;
String b2AccountId = ""; // your b2 account ID
String b2ApplicationKey = ""; // your b2 application Key
Expand Down Expand Up @@ -99,6 +106,8 @@ uploadFile(String, String, File, String)
uploadFile(String, String, File, String, Map<String, String>)
```



# Building the Package

## *NIX/Mac OS X
Expand Down Expand Up @@ -155,12 +164,58 @@ export B2_ACCOUNT_ID="your-account-id"
export B2_APPLICATION_KEY="your-application-key"
```

# Logging
# Logging - slf4j

slf4j is the logging framework used for this project. In order to use a logging framework with this project, sample configurations are below:
slf4j is the logging framework used for this project. In order to set up a logging framework with this project, sample configurations are below:

## Log4j


You will need to include dependencies for this - note that the versions may need to be updated.

### Maven

```
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.5</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.5</version>
<scope>runtime</scope>
</dependency>
```

### Gradle &lt; 2.1

```
dependencies {
...
runtime(group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.5', ext: 'jar')
runtime(group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.5', ext: 'jar')
...
}
```
### Gradle &gt;= 2.1

```
dependencies {
...
runtime 'org.apache.logging.log4j:log4j-slf4j-impl:2.5'
runtime 'org.apache.logging.log4j:log4j-core:2.5'
...
}
```


### Setting up the logging:

A sample `log4j2.xml` is below:

```
Expand Down Expand Up @@ -190,7 +245,7 @@ As such, this is not a repository, but a location to download files from.

This project publishes artefacts to [Maven Central](https://search.maven.org/)

> Note that the latest version can be found [mvn central](http://search.maven.org/#artifactdetails|synapticloop|backblaze-b2-java-api|1.3.0|jar)
> Note that the latest version can be found [mvn central](http://search.maven.org/#artifactdetails|synapticloop|backblaze-b2-java-api|1.3.1|jar)
## maven setup

Expand All @@ -210,19 +265,19 @@ repositories {

```
dependencies {
runtime(group: 'synapticloop', name: 'backblaze-b2-java-api', version: '1.3.0', ext: 'jar')
runtime(group: 'synapticloop', name: 'backblaze-b2-java-api', version: '1.3.1', ext: 'jar')
compile(group: 'synapticloop', name: 'backblaze-b2-java-api', version: '1.3.0', ext: 'jar')
compile(group: 'synapticloop', name: 'backblaze-b2-java-api', version: '1.3.1', ext: 'jar')
}
```

or, more simply for versions of gradle greater than 2.4
or, more simply for versions of gradle greater than 2.1

```
dependencies {
runtime 'synapticloop:backblaze-b2-java-api:1.3.0'
runtime 'synapticloop:backblaze-b2-java-api:1.3.1'
compile 'synapticloop:backblaze-b2-java-api:1.3.0'
compile 'synapticloop:backblaze-b2-java-api:1.3.1'
}
```

Expand All @@ -232,36 +287,55 @@ dependencies {
<dependency>
<groupId>synapticloop</groupId>
<artifactId>backblaze-b2-java-api</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<type>jar</type>
</dependency>
```

## Other packages
## Dependencies - Downloads


You may either download the files from [https://bintray.com/synapticloop/maven/backblaze-b2-java-api/](https://bintray.com/synapticloop/maven/backblaze-b2-java-api/) or from [https://github.com/synapticloop/backblaze-b2-java-api/releases](https://github.com/synapticloop/backblaze-b2-java-api/releases)
You will also need to download the following dependencies:

You will also need the dependencies:

### runtime dependencies

- org.apache.httpcomponents, httpclient, 4.5.1: (It may be available on one of: [bintray](https://bintray.com/org.apache.httpcomponents/maven/httpclient/4.5.1/view#files/org.apache.httpcomponents/httpclient/4.5.1) [mvn central](http://search.maven.org/#artifactdetails|org.apache.httpcomponents|httpclient|4.5.1|jar) [mvn repository](http://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient/4.5.1) )
- commons-io, commons-io, 2.4: (It may be available on one of: [bintray](https://bintray.com/commons-io/maven/commons-io/2.4/view#files/commons-io/commons-io/2.4) [mvn central](http://search.maven.org/#artifactdetails|commons-io|commons-io|2.4|jar) [mvn repository](http://mvnrepository.com/artifact/commons-io/commons-io/2.4) )
- org.json, json, 20160212: (It may be available on one of: [bintray](https://bintray.com/org.json/maven/json/20160212/view#files/org.json/json/20160212) [mvn central](http://search.maven.org/#artifactdetails|org.json|json|20160212|jar) [mvn repository](http://mvnrepository.com/artifact/org.json/json/20160212) )
- org.slf4j, slf4j-api, 1.7.13: (It may be available on one of: [bintray](https://bintray.com/org.slf4j/maven/slf4j-api/1.7.13/view#files/org.slf4j/slf4j-api/1.7.13) [mvn central](http://search.maven.org/#artifactdetails|org.slf4j|slf4j-api|1.7.13|jar) [mvn repository](http://mvnrepository.com/artifact/org.slf4j/slf4j-api/1.7.13) )
### cobertura dependencies

- net.sourceforge.cobertura:cobertura:2.1.1: (It may be available on one of: [bintray](https://bintray.com/net.sourceforge.cobertura/maven/cobertura/2.1.1/view#files/net.sourceforge.cobertura/cobertura/2.1.1) [mvn central](http://search.maven.org/#artifactdetails|net.sourceforge.cobertura|cobertura|2.1.1|jar))


### compile dependencies

- org.apache.httpcomponents, httpclient, 4.5.1: (It may be available on one of: [bintray](https://bintray.com/org.apache.httpcomponents/maven/httpclient/4.5.1/view#files/org.apache.httpcomponents/httpclient/4.5.1) [mvn central](http://search.maven.org/#artifactdetails|org.apache.httpcomponents|httpclient|4.5.1|jar) [mvn repository](http://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient/4.5.1) )
- commons-io, commons-io, 2.4: (It may be available on one of: [bintray](https://bintray.com/commons-io/maven/commons-io/2.4/view#files/commons-io/commons-io/2.4) [mvn central](http://search.maven.org/#artifactdetails|commons-io|commons-io|2.4|jar) [mvn repository](http://mvnrepository.com/artifact/commons-io/commons-io/2.4) )
- org.json, json, 20160212: (It may be available on one of: [bintray](https://bintray.com/org.json/maven/json/20160212/view#files/org.json/json/20160212) [mvn central](http://search.maven.org/#artifactdetails|org.json|json|20160212|jar) [mvn repository](http://mvnrepository.com/artifact/org.json/json/20160212) )
- org.slf4j, slf4j-api, 1.7.13: (It may be available on one of: [bintray](https://bintray.com/org.slf4j/maven/slf4j-api/1.7.13/view#files/org.slf4j/slf4j-api/1.7.13) [mvn central](http://search.maven.org/#artifactdetails|org.slf4j|slf4j-api|1.7.13|jar) [mvn repository](http://mvnrepository.com/artifact/org.slf4j/slf4j-api/1.7.13) )
- org.apache.httpcomponents:httpclient:4.5.1: (It may be available on one of: [bintray](https://bintray.com/org.apache.httpcomponents/maven/httpclient/4.5.1/view#files/org.apache.httpcomponents/httpclient/4.5.1) [mvn central](http://search.maven.org/#artifactdetails|org.apache.httpcomponents|httpclient|4.5.1|jar))
- commons-io:commons-io:2.4: (It may be available on one of: [bintray](https://bintray.com/commons-io/maven/commons-io/2.4/view#files/commons-io/commons-io/2.4) [mvn central](http://search.maven.org/#artifactdetails|commons-io|commons-io|2.4|jar))
- org.json:json:20160212: (It may be available on one of: [bintray](https://bintray.com/org.json/maven/json/20160212/view#files/org.json/json/20160212) [mvn central](http://search.maven.org/#artifactdetails|org.json|json|20160212|jar))
- org.slf4j:slf4j-api:1.7.13: (It may be available on one of: [bintray](https://bintray.com/org.slf4j/maven/slf4j-api/1.7.13/view#files/org.slf4j/slf4j-api/1.7.13) [mvn central](http://search.maven.org/#artifactdetails|org.slf4j|slf4j-api|1.7.13|jar))


### runtime dependencies

- org.apache.httpcomponents:httpclient:4.5.1: (It may be available on one of: [bintray](https://bintray.com/org.apache.httpcomponents/maven/httpclient/4.5.1/view#files/org.apache.httpcomponents/httpclient/4.5.1) [mvn central](http://search.maven.org/#artifactdetails|org.apache.httpcomponents|httpclient|4.5.1|jar))
- commons-io:commons-io:2.4: (It may be available on one of: [bintray](https://bintray.com/commons-io/maven/commons-io/2.4/view#files/commons-io/commons-io/2.4) [mvn central](http://search.maven.org/#artifactdetails|commons-io|commons-io|2.4|jar))
- org.json:json:20160212: (It may be available on one of: [bintray](https://bintray.com/org.json/maven/json/20160212/view#files/org.json/json/20160212) [mvn central](http://search.maven.org/#artifactdetails|org.json|json|20160212|jar))
- org.slf4j:slf4j-api:1.7.13: (It may be available on one of: [bintray](https://bintray.com/org.slf4j/maven/slf4j-api/1.7.13/view#files/org.slf4j/slf4j-api/1.7.13) [mvn central](http://search.maven.org/#artifactdetails|org.slf4j|slf4j-api|1.7.13|jar))


### testCompile dependencies

- junit:junit:4.12: (It may be available on one of: [bintray](https://bintray.com/junit/maven/junit/4.12/view#files/junit/junit/4.12) [mvn central](http://search.maven.org/#artifactdetails|junit|junit|4.12|jar))
- org.apache.logging.log4j:log4j-slf4j-impl:2.5: (It may be available on one of: [bintray](https://bintray.com/org.apache.logging.log4j/maven/log4j-slf4j-impl/2.5/view#files/org.apache.logging.log4j/log4j-slf4j-impl/2.5) [mvn central](http://search.maven.org/#artifactdetails|org.apache.logging.log4j|log4j-slf4j-impl|2.5|jar))
- org.apache.logging.log4j:log4j-core:2.5: (It may be available on one of: [bintray](https://bintray.com/org.apache.logging.log4j/maven/log4j-core/2.5/view#files/org.apache.logging.log4j/log4j-core/2.5) [mvn central](http://search.maven.org/#artifactdetails|org.apache.logging.log4j|log4j-core|2.5|jar))
- org.json:json:20160212: (It may be available on one of: [bintray](https://bintray.com/org.json/maven/json/20160212/view#files/org.json/json/20160212) [mvn central](http://search.maven.org/#artifactdetails|org.json|json|20160212|jar))


### testRuntime dependencies

- junit:junit:4.12: (It may be available on one of: [bintray](https://bintray.com/junit/maven/junit/4.12/view#files/junit/junit/4.12) [mvn central](http://search.maven.org/#artifactdetails|junit|junit|4.12|jar))
- org.apache.logging.log4j:log4j-slf4j-impl:2.5: (It may be available on one of: [bintray](https://bintray.com/org.apache.logging.log4j/maven/log4j-slf4j-impl/2.5/view#files/org.apache.logging.log4j/log4j-slf4j-impl/2.5) [mvn central](http://search.maven.org/#artifactdetails|org.apache.logging.log4j|log4j-slf4j-impl|2.5|jar))
- org.apache.logging.log4j:log4j-core:2.5: (It may be available on one of: [bintray](https://bintray.com/org.apache.logging.log4j/maven/log4j-core/2.5/view#files/org.apache.logging.log4j/log4j-core/2.5) [mvn central](http://search.maven.org/#artifactdetails|org.apache.logging.log4j|log4j-core|2.5|jar))
- org.json:json:20160212: (It may be available on one of: [bintray](https://bintray.com/org.json/maven/json/20160212/view#files/org.json/json/20160212) [mvn central](http://search.maven.org/#artifactdetails|org.json|json|20160212|jar))

**NOTE:** You may need to download any dependencies of the above dependencies in turn
**NOTE:** You may need to download any dependencies of the above dependencies in turn (i.e. the transitive dependencies)

# License

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ plugins {
id 'net.saliman.cobertura' version '2.3.0'
id "com.jfrog.bintray" version "1.6"
id 'co.riiid.gradle' version '0.4.2'
id 'synapticloop.documentr' version '1.1.9'
id 'synapticloop.documentr' version '1.3.4'
}

group = 'synapticloop'
archivesBaseName = 'backblaze-b2-java-api'
description = """A java api for the truly excellent backblaze b2 storage service"""

version = '1.3.0'
version = '1.3.1'

sourceCompatibility = 1.7
targetCompatibility = 1.7
Expand Down
4 changes: 2 additions & 2 deletions documentr.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
{ "type":"inbuilt", "value":"project-name" },
{ "type":"inbuilt", "value":"project-description" },

{ "type":"template", "value":"usage.md.templar" },
{ "type":"template", "value":"src/docs/usage.md.templar" },

{ "type":"inbuilt", "value":"gradle-build" },
{ "type":"inbuilt", "value":"gradle-test" },

{ "type":"inbuilt", "value":"test-warn" },
{ "type":"template", "value":"test-important.md.templar" },
{ "type":"template", "value":"src/docs/test-important.md.templar" },

{ "type":"inbuilt", "value":"logging-slf4j" },

Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions usage.md.templar → src/docs/usage.md.templar
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Usage{\n}
{\n}
```{\n}
// required imports{\n}
import synapticloop.b2.B2ApiClient;{\n}
import synapticloop.b2.exception.B2ApiException;{\n}
import synapticloop.b2.request.*;{\n}
import synapticloop.b2.response.*;{\n}
{\n}
{\n}
String b2AccountId = ""; // your b2 account ID{\n}
String b2ApplicationKey = ""; // your b2 application Key{\n}
{\n}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
import org.junit.Before;
import org.junit.Test;

import synapticloop.b2.exception.B2ApiException;
import synapticloop.b2.helper.B2TestHelper;
import synapticloop.b2.response.B2BucketResponse;

public class B2ClientTest {
public class B2ApiClientTest {
public static final String B2_ACCOUNT_ID = "B2_ACCOUNT_ID";
public static final String B2_APPLICATION_KEY = "B2_APPLICATION_KEY";
private B2ApiClient client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.junit.Test;


public class B2ExceptionTest {
public class B2ApiExceptionTest {

@Test
public void testEmptyException() {
Expand Down

0 comments on commit 937ebc6

Please sign in to comment.