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

Commit be17664

Browse files
SynapticloopSynapticloop
authored andcommitted
updated documentation
1 parent 428846d commit be17664

File tree

5 files changed

+104
-10
lines changed

5 files changed

+104
-10
lines changed

README.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,100 @@ A Java API for the truly excellent backblaze B2 storage
22

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

5+
6+
# Dependency Management
7+
8+
> 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)
9+
10+
Include the dependency
11+
12+
## maven
13+
14+
this comes from the jcenter bintray, to set up your repository:
15+
16+
<?xml version="1.0" encoding="UTF-8" ?>
17+
<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'>
18+
<profiles>
19+
<profile>
20+
<repositories>
21+
<repository>
22+
<snapshots>
23+
<enabled>false</enabled>
24+
</snapshots>
25+
<id>central</id>
26+
<name>bintray</name>
27+
<url>http://jcenter.bintray.com</url>
28+
</repository>
29+
</repositories>
30+
<pluginRepositories>
31+
<pluginRepository>
32+
<snapshots>
33+
<enabled>false</enabled>
34+
</snapshots>
35+
<id>central</id>
36+
<name>bintray-plugins</name>
37+
<url>http://jcenter.bintray.com</url>
38+
</pluginRepository>
39+
</pluginRepositories>
40+
<id>bintray</id>
41+
</profile>
42+
</profiles>
43+
<activeProfiles>
44+
<activeProfile>bintray</activeProfile>
45+
</activeProfiles>
46+
</settings>
47+
48+
And now for the dependency
49+
50+
<dependency>
51+
<groupId>synapticloop</groupId>
52+
<artifactId>backblaze-b2-java-api</artifactId>
53+
<version>v1.0.0</version>
54+
<type>jar</type>
55+
</dependency>
56+
57+
58+
## gradle
59+
60+
Repository
61+
62+
repositories {
63+
maven {
64+
url "http://jcenter.bintray.com"
65+
}
66+
}
67+
68+
or just
69+
70+
repositories {
71+
jcenter()
72+
}
73+
74+
and then include the dependency:
75+
76+
runtime(group: 'synapticloop', name: 'backblaze-b2-java-api', version: 'v1.0.0', ext: 'jar')
77+
78+
compile(group: 'synapticloop', name: 'backblaze-b2-java-api', version: 'v1.0.0', ext: 'jar')
79+
80+
or
81+
82+
runtime 'synapticloop:backblaze-b2-java-api:v1.0.0'
83+
84+
compile 'synapticloop:backblaze-b2-java-api:v1.0.0'
85+
86+
## Other
87+
88+
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)
89+
90+
You will also need the dependencies:
91+
92+
- runtime 'org.apache.httpcomponents:httpclient:4.3.4'
93+
- runtime 'commons-io:commons-io:2.4'
94+
- runtime 'org.json:json:20090211'
95+
- runtime 'org.slf4j:slf4j-api:1.7.13'
96+
97+
which can be found by searching here: [http://mvnrepository.com/](http://mvnrepository.com/)
98+
599
# Running the Tests
6100

7101
`gradled --info test`

src/main/java/synapticloop/b2/B2ApiClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ public List<B2BucketResponse> listBuckets() throws B2ApiException {
137137
*
138138
* @param fileId the file ID to retrieve the information on
139139
*
140-
* @return the File Response
141-
* @throws B2ApiException
140+
* @return the File Response
141+
* @throws B2ApiException if something went wrong
142142
*/
143143
public B2FileResponse getFileInfo(String fileId) throws B2ApiException {
144144
return(new B2GetFileInfoRequest(getB2AuthorizeAccountResponse(), fileId).getResponse());

src/main/java/synapticloop/b2/exception/B2ApiException.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ public B2ApiException(String message, Throwable cause) {
5757

5858
/**
5959
* Create a new B2Api Exception with a root cause
60-
* @param cause
60+
*
61+
* @param cause The root cause of the exception
6162
*/
6263
public B2ApiException(Throwable cause) {
6364
super(cause);

src/main/java/synapticloop/b2/request/B2HeadFileByIdRequest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ public B2HeadFileByIdRequest(B2AuthorizeAccountResponse b2AuthorizeAccountRespon
2929
}
3030

3131
/**
32-
* R
32+
* Return the response for the HEAD request
3333
*
34-
* @return
35-
* @throws B2ApiException
34+
* @return the download file response - note that this does not contain any body content
35+
*
36+
* @throws B2ApiException if something went wrong
3637
*/
3738
public B2DownloadFileResponse getResponse() throws B2ApiException {
3839
return(new B2DownloadFileResponse(executeHead()));

src/main/java/synapticloop/b2/request/B2UploadFileRequest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ public B2UploadFileRequest(B2AuthorizeAccountResponse b2AuthorizeAccountResponse
6767
* @param b2GetUploadUrlResponse the upload URL for this request
6868
* @param fileName the name of the file
6969
* @param file the file to upload
70-
* @param mimeType the mimeTyp (optional, will default to 'b2/x-auto' which
71-
* backblaze will attempt to determine automatically)
7270
* @param fileInfo the file info map which are passed through as headers
7371
* prefixed by "X-Bz-Info-"
7472
*/
@@ -84,8 +82,8 @@ public B2UploadFileRequest(B2AuthorizeAccountResponse b2AuthorizeAccountResponse
8482
* @param b2GetUploadUrlResponse the upload URL for this request
8583
* @param fileName the name of the file
8684
* @param file the file to upload
87-
* @param fileInfo the file info map which are passed through as headers
88-
* prefixed by "X-Bz-Info-"
85+
* @param mimeType the mimeTyp (optional, will default to 'b2/x-auto' which
86+
* backblaze will attempt to determine automatically)
8987
*/
9088
public B2UploadFileRequest(B2AuthorizeAccountResponse b2AuthorizeAccountResponse, B2GetUploadUrlResponse b2GetUploadUrlResponse, String fileName, File file, String mimeType) {
9189
this(b2AuthorizeAccountResponse, b2GetUploadUrlResponse, fileName, file, mimeType, null);

0 commit comments

Comments
 (0)