Skip to main content

Secure Share | Java SDK

Constructor.

ShareClient(Builder builder)

required parameters

Builder

Secure Share client builder.

Response Object

void

Buckets

buckets()

Get information on the accessible buckets.

Response Object

BucketsResponse
 final var response = client.buckets();

Delete

delete(DeleteRequest request)

Delete object by ID.

required parameters

DeleteRequest

Request parameters.

Response Object

DeleteResponse
 var response = client.delete(new DeleteRequest.Builder().id("pos_[...]").build());

Create a folder

folderCreate(FolderCreateRequest request)

Create a folder, either by name or path and parent_id.

required parameters

FolderCreateRequest

Request parameters.

Response Object

FolderCreateResponse
 var response = client.folderCreate(
     new FolderCreateRequest.Builder().folder("/path/to/new/folder").build()
 );

Get an object

get(GetRequest request)

Get object. If both ID and path are supplied, the call will fail if the target object doesn't match both properties.

required parameters

GetRequest

Request parameters.

Response Object

GetResponse
 var response = client.get(
     new GetRequest.Builder()
     .id("pos_[...]")
     .transferMethod(TransferMethod.DEST_URL)
     .build()
 );

Get archive

getArchive(GetArchiveRequest request)

Get an archive file of multiple objects.

required parameters

GetArchiveRequest

Request parameters.

Response Object

GetArchiveResponse
 var response = client.getArchive(
     new GetArchiveRequest.Builder(Arrays.asList("pos_[...]"))
         .format(ArchiveFormat.TAR)
         .transferMethod(TransferMethod.DEST_URL)
         .build()
 );

Update a file

update(UpdateRequest request)

Update a file.

required parameters

UpdateRequest

Request parameters.

Response Object

UpdateResponse
 var metadata = new Metadata();
 metadata.put("key", "value");
 var response = client.update(
     new UpdateRequest.Builder("pos_[...]")
         .metadata(metadata)
         .build()
 );

List

list(ListRequest request)

List or filter/search records.

required parameters

ListRequest

Request parameters.

Response Object

ListResponse
 var filterList = new FilterList();
 filterList.folder().set("/path/to/folder");
 var response = client.list(new ListRequest.Builder().filter(filterList).build());

Upload a file

put(PutRequest request, File file)

Upload a file.

required parameters

PutRequest

Request parameters.

File

File to upload.

Response Object

PutResponse
 var response = client.put(
     new PutRequest.Builder()
         .name("foobar")
         .transferMethod(TransferMethod.MULTIPART)
         .build(),
     file
 );

Request upload URL

requestUploadURL(PutRequest request)

Request an upload URL.

required parameters

PutRequest

Request parameters.

Response Object

AcceptedResponse
 var response = client.requestUploadURL(
     new PutRequest.Builder()
     .name("foobar")
     .transferMethod(TransferMethod.PUT_URL)
     .build()
 );
shareLinkCreate(ShareLinkCreateRequest request)

Create a share link.

required parameters

ShareLinkCreateRequest

Request parameters.

Response Object

ShareLinkCreateResponse
 var authenticators = Arrays.asList(
     new Authenticator(AuthenticatorType.PASSWORD, "somepassword")
 );
 var linkList = Arrays.asList(
     new ShareLinkCreateItem.Builder()
         .targets(Arrays.asList("pos_[...]"))
         .linkType(LinkType.EDITOR)
         .maxAccessCount(3)
         .authenticators(authenticators)
         .build()
 );
 var response = client.shareLinkCreate(
     new ShareLinkCreateRequest.Builder().links(linkList).build()
 );
shareLinkGet(ShareLinkGetRequest request)

Get a share link.

required parameters

ShareLinkGetRequest

Request parameters.

Response Object

ShareLinkGetResponse
 var response = client.shareLinkGet(new ShareLinkGetRequest.Builder("psl_[...]").build());
shareLinkList(ShareLinkListRequest request)

Look up share links by filter options.

 var response = client.shareLinkList(new ShareLinkListRequest.Builder().build());
shareLinkDelete(ShareLinkDeleteRequest request)

Delete share links.

required parameters

ShareLinkDeleteRequest

Request parameters.

Response Object

ShareLinkDeleteResponse
 var response = client.shareLinkDelete(
     new ShareLinkDeleteRequest.Builder(Arrays.asList("psl_[...]")).build()
 );
shareLinkSend(ShareLinkSendRequest request)

Send share links.

required parameters

ShareLinkSendRequest

Request parameters.

Response Object

ShareLinkSendResponse
 var response = client.shareLinkSend(
     new ShareLinkSendRequest.Builder(
         Arrays.asList(new ShareLinkSendItem("psl_[...]", "alice@example.org")),
         "bob@example.org"
     ).build()
 );