Web links are objects that point to URLs. These objects are also known as bookmarks within the Box web application. Web link objects are treated similarly to file objects.
Calling BoxFolder.createWebLink(String, URL, String)
will let you create a new web link with a specified name and description.
BoxFolder folder = new BoxFolder(api, id);
folder.createWebLink("name", url, "description");
Name and description params are optional, so it is possible to create web link with only one of them or with URL only: BoxFolder.createWebLink(URL)
BoxFolder folder = new BoxFolder(api, id);
BoxWebLink.Info webLinkInfo = folder.createWebLink(url);
A web link info can be retrieved by calling the getInfo(String...)
method.
Optional parameters can be used to retrieve specific fields of the Device Pin object.
BoxWebLink webLink = new BoxWebLink(api, id);
BoxWebLink.Info webLinkInfo = webLink.getInfo();
A web link can be updated by calling the updateInfo(BoxWebLink.Info)
method.
BoxWebLink webLink = new BoxWebLink(api, id);
BoxWebLink.Info webLinkInfo = webLink.new Info();
webLinkInfo.addPendingChange("name", "new name for weblink");
webLink.updateInfo(webLinkInfo);
A web link can be deleted by calling the delete()
method.
BoxWebLink webLink = new BoxWebLink(api, id);
webLink.delete();