Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.box.androidsdk.content;
  
Represents the API of the bookmark endpoint on Box. This class can be used to generate request objects for each of the APIs exposed endpoints
  
 public class BoxApiBookmark extends BoxApi {

    
Constructs a BoxApiBookmark with the provided BoxSession

Parameters:
session authenticated session to use with the BoxApiBookmark
 
     public BoxApiBookmark(BoxSession session) {
         super(session);
     }

    
Gets the URL for bookmarks

Returns:
the bookmark URL
 
     protected String getBookmarksUrl() { return String.format("%s/web_links"getBaseUri()); }

    
Gets the URL for bookmark information

Parameters:
id id of the bookmark
Returns:
the bookmark information URL
 
     protected String getBookmarkInfoUrl(String id) { return String.format("%s/%s"getBookmarksUrl(), id); }

    
Gets the URL for copying a bookmark

Parameters:
id id of the bookmark
Returns:
the copy bookmark URL
 
     protected String getBookmarkCopyUrl(String id) { return String.format(getBookmarkInfoUrl(id) + "/copy"); }

    
Gets the URL for a trashed bookmark

Parameters:
id id of the bookmark
Returns:
the trashed bookmark URL
 
     protected String getTrashedBookmarkUrl(String id) { return getBookmarkInfoUrl(id) + "/trash"; }

    
Gets the URL for comments on a bookmark

Parameters:
id id of the bookmark
Returns:
the bookmark comments URL
 
     protected String getBookmarkCommentsUrl(String id) { return getBookmarkInfoUrl(id) + "/comments"; }

    
Gets the URL for posting a comment on a bookmark

Returns:
the comments URL
 
     protected String getCommentUrl() { return getBaseUri() + .; }

    
Gets a request that retrieves information on a bookmark

Parameters:
id id of bookmark to retrieve info on
Returns:
request to get a bookmarks information
 
         return request;
     }

    
Gets a request that creates a bookmark in a parent bookmark

Parameters:
parentId id of the parent bookmark to create the bookmark in
url URL of the new bookmark
Returns:
request to create a bookmark
 
     public BoxRequestsBookmark.CreateBookmark getCreateRequest(String parentIdString url) {
         BoxRequestsBookmark.CreateBookmark request = new BoxRequestsBookmark.CreateBookmark(parentIdurlgetBookmarksUrl(), );
         return request;
     }

    
Gets a request that updates a bookmark's information

Parameters:
id id of bookmark to update information on
Returns:
request to update a bookmark's information
 
         return request;
     }

    
Gets a request that copies a bookmark

Parameters:
id id of the bookmark to copy
parentId id of the parent folder to copy the bookmark into
Returns:
request to copy a bookmark
    public BoxRequestsBookmark.CopyBookmark getCopyRequest(String idString parentId) {
        BoxRequestsBookmark.CopyBookmark request = new BoxRequestsBookmark.CopyBookmark(idparentIdgetBookmarkCopyUrl(id), );
        return request;
    }

    
Gets a request that renames a bookmark

Parameters:
id id of bookmark to rename
newName id of bookmark to retrieve info on
Returns:
request to rename a bookmark
        request.setName(newName);
        return request;
    }

    
Gets a request that moves a bookmark to another folder

Parameters:
id id of bookmark to move
parentId id of parent folder to move bookmark into
Returns:
request to move a bookmark
        request.setParentId(parentId);
        return request;
    }

    
Gets a request that deletes a bookmark

Parameters:
id id of bookmark to delete
Returns:
request to delete a bookmark
        return request;
    }

    
Gets a request that creates a shared link for a bookmark

Parameters:
id id of bookmark to create shared link for
Returns:
request to create a shared link for a bookmark
                .setAccess(null);
        return request;
    }

    
Gets a request that disables a shared link for a bookmark

Parameters:
id id of bookmark to disable a shared link for
Returns:
request to create a shared link for a bookmark
                .setSharedLink(null);
        return request;
    }

    
Gets a request that adds a comment to a bookmark

Parameters:
bookmarkId id of the bookmark to add the comment to
message message for the comment that will be added
Returns:
request to add a comment to a bookmark
        BoxRequestsBookmark.AddCommentToBookmark request = new BoxRequestsBookmark.AddCommentToBookmark(bookmarkIdmessagegetCommentUrl(), );
        return request;
    }

    
Gets a request that returns a bookmark in the trash

Parameters:
id id of bookmark to get in the trash
Returns:
request to get a bookmark from the trash
        return request;
    }

    
Gets a request that permanently deletes a bookmark from the trash

Parameters:
id id of bookmark to delete from the trash
Returns:
request to permanently delete a bookmark from the trash
        return request;
    }

    
Gets a request that restores a trashed bookmark

Parameters:
id id of bookmark to restore
Returns:
request to restore a bookmark from the trash
        return request;
    }

    
Gets a request that retrieves the comments on a bookmark

Parameters:
id id of the bookmark to retrieve comments for
Returns:
request to retrieve comments on a bookmark
        return request;
    }

    
Gets a request that adds a bookmark to a collection

Parameters:
bookmarkId id of bookmark to add to collection
collectionId id of collection to add the bookmark to
Returns:
request to add a bookmark to a collection
        BoxRequestsBookmark.AddBookmarkToCollection request = new BoxRequestsBookmark.AddBookmarkToCollection(bookmarkIdcollectionIdgetBookmarkInfoUrl(bookmarkId), );
        return request;
    }

    
Gets a request that removes a bookmark from a collection

Parameters:
id id of bookmark to delete from the collection
Returns:
request to delete a bookmark from a collection
        return request;
    }
New to GrepCode? Check out our FAQ X