synapticloop / backblaze-b2-java-api Goto Github PK
View Code? Open in Web Editor NEWJava API for the fabulous backblaze B2 API
License: MIT License
Java API for the fabulous backblaze B2 API
License: MIT License
In regard to ../b2/response/B2AuthorizeAccountResponse.java:
In v2 of the API there can now be application key pairs that have permission to only ever read specific buckets.
"Most of the API calls that deal with buckets or files use a bucketId to identify a bucket. But, when using an application key that restricts access to just one bucket, you can't use b2_list_buckets to list all the buckets.
When there is a bucket restriction, the bucketId and the bucketName for that bucket are in the response from b2_authorize_account in the allowed section. You can then use that bucketId in all of your later calls."
https://www.backblaze.com/b2/docs/application_keys.html#usingRestrictedKeys
As a result there needs to be a new attribute in the b2client object that includes a list of "Allowed" buckets. The response from Backblaze now looks like this:
"allowed": {
"bucketId": "****",
"bucketName": "AAABCC",
And add some sort of functionality like b2AuthorizeAccountResponse.getAllowedBuckets()
Similarly .../b2/request/B2ListBucketsRequest.java will need to be extended to avoid the error scenario where listing buckets results in a permission error even though the account can list specific buckets.
When uploading a file, the following warnings are logged
[WARN] 14-Oct-2018 20:22:51.223 | synapticloop.b2.response.B2AuthorizeAccountResponse - Found an unexpected key of 'allowed' in JSON that is not mapped to a field, with value '{"bucketName":null,"capabilities":["listKeys","writeKeys","deleteKeys","listBuckets","writeBuckets","deleteBuckets","listFiles","readFiles","shareFiles","writeFiles","deleteFiles"],"namePrefix":null,"bucketId":null}'.
[WARN] 14-Oct-2018 20:22:51.223 | synapticloop.b2.response.B2AuthorizeAccountResponse - Found an unexpected key of 'recommendedPartSize' in JSON that is not mapped to a field, with value '100000000'.
[WARN] 14-Oct-2018 20:22:51.224 | synapticloop.b2.response.B2AuthorizeAccountResponse - Found an unexpected key of 'absoluteMinimumPartSize' in JSON that is not mapped to a field, with value '5000000'.
Is it possible to have a setting/property not to warn on missed keys.
Any reason there is a v
prefix in the version.
When using Java 9 I get the following exception:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/adapters/HexBinaryAdapter
at synapticloop.b2.util.ChecksumHelper.calculateSha1(ChecksumHelper.java:75)
at synapticloop.b2.util.ChecksumHelper.calculateSha1(ChecksumHelper.java:44)
at synapticloop.b2.B2ApiClient.uploadFile(B2ApiClient.java:451)
at synapticloop.b2.B2ApiClient.uploadFile(B2ApiClient.java:434)
I'm currently getting past this by adding --add-modules java.xml.bind
as a VM option.
Awesome library btw!
Looks like the pull requests are failing due to missing credentials in the Travis CI environment.
Hi.
First of all, thanks for creating this project.
I tried to use the latest released jars in my Java 7 project but got a ClassNotFoundException:
Caused by: java.lang.ClassNotFoundException: java.util.Base64
java.util.Base64 was added in Java 8.
In the gradle file you specify sourceCompatibility = 1.7
I expect that you want to use the Base64 class from commons-codec lib?
My question is does this project requires Java 7 or 8?
Thanks.
Can you please clarify on the license.
How does one upload a file to a particular folder within a bucket. Using a destination file name like /myfolder/test.txt
doesn't seem to work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.