Secure Share | Java SDK
Constructor.
ShareClient(Builder builder)Buckets
buckets()Get information on the accessible buckets.
final var response = client.buckets();
Delete
delete(DeleteRequest request)Delete object by ID.
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.
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.
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.
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.
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.
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.
var response = client.put(
new PutRequest.Builder()
.name("foobar")
.transferMethod(TransferMethod.MULTIPART)
.build(),
file
);
Request upload URL
requestUploadURL(PutRequest request)Request an upload URL.
var response = client.requestUploadURL(
new PutRequest.Builder()
.name("foobar")
.transferMethod(TransferMethod.PUT_URL)
.build()
);
Create share links
shareLinkCreate(ShareLinkCreateRequest request)Create a share link.
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()
);
Get share link
shareLinkGet(ShareLinkGetRequest request)Get a share link.
var response = client.shareLinkGet(new ShareLinkGetRequest.Builder("psl_[...]").build());
List share links
shareLinkList(ShareLinkListRequest request)Look up share links by filter options.
var response = client.shareLinkList(new ShareLinkListRequest.Builder().build());
Delete share links
shareLinkDelete(ShareLinkDeleteRequest request)Delete share links.
var response = client.shareLinkDelete(
new ShareLinkDeleteRequest.Builder(Arrays.asList("psl_[...]")).build()
);
Send share links
shareLinkSend(ShareLinkSendRequest request)Send share links.
var response = client.shareLinkSend(
new ShareLinkSendRequest.Builder(
Arrays.asList(new ShareLinkSendItem("psl_[...]", "alice@example.org")),
"bob@example.org"
).build()
);