Skip to content

HanawaBanana/baas-sdk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

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.
StoreClient client = new StoreClient(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.StoreClient.

get upload file/string/byte[]

StoreClient client = new StoreClient(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://doc.gxb.io/gxchain/api/baas-api.html

About

baas sdk implemented in java.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%