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

Commit

Permalink
updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Synapticloop authored and Synapticloop committed Dec 10, 2015
1 parent 428846d commit be17664
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 10 deletions.
94 changes: 94 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,100 @@ A Java API for the truly excellent backblaze B2 storage

Usable, however still a work in progress... (YMMV)


# Dependency Management

> Note that the latest version can be found [https://bintray.com/synapticloop/maven/backblaze-b2-java-api/view](https://bintray.com/synapticloop/maven/backblaze-b2-java-api/view)
Include the dependency

## maven

this comes from the jcenter bintray, to set up your repository:

<?xml version="1.0" encoding="UTF-8" ?>
<settings xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd' xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>bintray</name>
<url>http://jcenter.bintray.com</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>bintray-plugins</name>
<url>http://jcenter.bintray.com</url>
</pluginRepository>
</pluginRepositories>
<id>bintray</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>bintray</activeProfile>
</activeProfiles>
</settings>

And now for the dependency

<dependency>
<groupId>synapticloop</groupId>
<artifactId>backblaze-b2-java-api</artifactId>
<version>v1.0.0</version>
<type>jar</type>
</dependency>


## gradle

Repository

repositories {
maven {
url "http://jcenter.bintray.com"
}
}

or just

repositories {
jcenter()
}

and then include the dependency:

runtime(group: 'synapticloop', name: 'backblaze-b2-java-api', version: 'v1.0.0', ext: 'jar')

compile(group: 'synapticloop', name: 'backblaze-b2-java-api', version: 'v1.0.0', ext: 'jar')

or

runtime 'synapticloop:backblaze-b2-java-api:v1.0.0'

compile 'synapticloop:backblaze-b2-java-api:v1.0.0'

## Other

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 the dependencies:

- runtime 'org.apache.httpcomponents:httpclient:4.3.4'
- runtime 'commons-io:commons-io:2.4'
- runtime 'org.json:json:20090211'
- runtime 'org.slf4j:slf4j-api:1.7.13'

which can be found by searching here: [http://mvnrepository.com/](http://mvnrepository.com/)

# Running the Tests

`gradled --info test`
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/synapticloop/b2/B2ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ public List<B2BucketResponse> listBuckets() throws B2ApiException {
*
* @param fileId the file ID to retrieve the information on
*
* @return the File Response
* @throws B2ApiException
* @return the File Response
* @throws B2ApiException if something went wrong
*/
public B2FileResponse getFileInfo(String fileId) throws B2ApiException {
return(new B2GetFileInfoRequest(getB2AuthorizeAccountResponse(), fileId).getResponse());
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/synapticloop/b2/exception/B2ApiException.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public B2ApiException(String message, Throwable cause) {

/**
* Create a new B2Api Exception with a root cause
* @param cause
*
* @param cause The root cause of the exception
*/
public B2ApiException(Throwable cause) {
super(cause);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ public B2HeadFileByIdRequest(B2AuthorizeAccountResponse b2AuthorizeAccountRespon
}

/**
* R
* Return the response for the HEAD request
*
* @return
* @throws B2ApiException
* @return the download file response - note that this does not contain any body content
*
* @throws B2ApiException if something went wrong
*/
public B2DownloadFileResponse getResponse() throws B2ApiException {
return(new B2DownloadFileResponse(executeHead()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ public B2UploadFileRequest(B2AuthorizeAccountResponse b2AuthorizeAccountResponse
* @param b2GetUploadUrlResponse the upload URL for this request
* @param fileName the name of the file
* @param file the file to upload
* @param mimeType the mimeTyp (optional, will default to 'b2/x-auto' which
* backblaze will attempt to determine automatically)
* @param fileInfo the file info map which are passed through as headers
* prefixed by "X-Bz-Info-"
*/
Expand All @@ -84,8 +82,8 @@ public B2UploadFileRequest(B2AuthorizeAccountResponse b2AuthorizeAccountResponse
* @param b2GetUploadUrlResponse the upload URL for this request
* @param fileName the name of the file
* @param file the file to upload
* @param fileInfo the file info map which are passed through as headers
* prefixed by "X-Bz-Info-"
* @param mimeType the mimeTyp (optional, will default to 'b2/x-auto' which
* backblaze will attempt to determine automatically)
*/
public B2UploadFileRequest(B2AuthorizeAccountResponse b2AuthorizeAccountResponse, B2GetUploadUrlResponse b2GetUploadUrlResponse, String fileName, File file, String mimeType) {
this(b2AuthorizeAccountResponse, b2GetUploadUrlResponse, fileName, file, mimeType, null);
Expand Down

0 comments on commit be17664

Please sign in to comment.