baas sdk implemented in java.
Switch branches/tags
Nothing to show
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src 压缩jar包 Aug 27, 2018
README.md chore: update readme Nov 5, 2018
pom.xml 压缩jar包 Aug 27, 2018

README.md

Introduction

This is a Java project. If you just enjoy the BaaS service. you can go to BaaS API.

Storage Usage

store String/File/byte[]

// build store client
// 构建存储客户端
// EXAMPLE_ACCOUNT is your account id
// EXAMPLE_PRIVATE_KEY is your account private key
// EXAMPLE_PUBLIC_KEY is your account public key
// * Attention: Your EXAMPLE_PRIVATE_KEY and EXAMPLE_PUBLIC_KEY can not be uploaded.
StoreDataClient client = new StoreDataClient(EXAMPLE_ACCOUNT, EXAMPLE_PRIVATE_KEY, EXAMPLE_PUBLIC_KEY, false);
// response
// 获取返回
// byte[]
StoreDataResp resp = client.store("Hello GXChain!".getBytes());
// String
StoreDataResp respString = client.storeString("Hello GXChain!");
// File
StoreDataResp respFile = client.storeFile(new File(FILE_PATH));

You can get more from com.gxb.block.baas.sdk.client.api.client.StoreDataClient.

get upload file/string/byte[]

StoreDataClient client = new StoreDataClient(EXAMPLE_ACCOUNT, EXAMPLE_PRIVATE_KEY, EXAMPLE_PUBLIC_KEY, false);
// File 
File file = client.downloadFile(CID,FILE_PATH);
// String
String str = client.getRawString(CID);
// byte[]
byte[] bytes = client.getRawBytes(CID);

Dev Documents

https://docs.gxchain.org/zh/baas-api/