Get SharedLink Info using the Java SDK
Hello
I'd like to get Info of a Shared Link using its id.
Using the Java SDK I see that there is a BoxSharedLink object, but unlike other Box* objects, it doesn't have a constructor with the API connection and an Info getter.
Also, I see that there is a SharedLinkAPIConnection class, but using I see no way to retreive the BoxSharedLink representing the shared link's info.
Please assist
-
private static BoxSharedLink createSharedLink(BoxAPIConnection api, String fileId) { BoxFile file = new BoxFile(api, fileId); BoxSharedLink.Permissions permissions = new BoxSharedLink.Permissions(); permissions.setCanDownload(true); permissions.setCanPreview(true); Date date = new Date(); Calendar unshareAt = Calendar.getInstance(); unshareAt.setTime(date); unshareAt.add(Calendar.DATE, 14); BoxSharedLink sharedLink = file.createSharedLink(BoxSharedLink.Access.COMPANY, unshareAt.getTime(), permissions); logger.info("shared link: " + sharedLink.getURL()); return sharedLink; }
Please sign in to leave a comment.
Comments
2 comments