Sharing a file
Inviting a member to a shared file using the Dropbox Java library
This uses the Dropbox Java SDK to share a file at “/test.txt” with a specific user:
List<MemberSelector> newMembers = new ArrayList<MemberSelector>();
MemberSelector newMember = MemberSelector.email("<EMAIL_ADDRESS_TO_INVITE>");
newMembers.add(newMember);
List<FileMemberActionResult> fileMemberActionResults = client.sharing().addFileMember("/test.txt", newMembers);
System.out.print(fileMemberActionResults);
<EMAIL_ADDRESS_TO_INVITE>
should be replaced with the email address of the user to invite. Also, newMembers
is an array and can contain multiple users.