Start line:  
End line:  

Snippet Preview

Snippet HTML Code

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

    
Constructs a BoxApiFolder with the provided BoxSession

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

    
Gets the URL for folders

Returns:
the folder URL
 
     protected String getFoldersUrl() { return String.format("%s/folders"getBaseUri()); }

    
Gets the URL for folder information

Parameters:
id id of the folder
Returns:
the folder information URL
 
     protected String getFolderInfoUrl(String id) { return String.format("%s/%s"getFoldersUrl(), id); }

    
Gets the URL for items

Parameters:
id id of the folder
Returns:
the folder items URL
 
     protected String getFolderItemsUrl(String id) { return getFolderInfoUrl(id) + "/items"; }

    
Gets the URL for the folders collaborations

Parameters:
id id of the folder
Returns:
the folder collaborations URL
 
     protected String getFolderCollaborationsUrl(String id) { return getFolderInfoUrl(id) + "/collaborations"; }

    
Gets the URL for copying a folder

Parameters:
id id of the folder
Returns:
the copy folder URL
 
     protected String getFolderCopyUrl(String id) { return getFolderInfoUrl(id) + "/copy"; }

    
Gets the URL for a trashed folder

Parameters:
id id of the folder
Returns:
the trashed folder URL
 
     protected String getTrashedFolderUrl(String id) { return getFolderInfoUrl(id) + "/trash"; }

    
Gets the URL for items in the trash

Returns:
the trashed items URL
 
     protected String getTrashedItemsUrl() { return getFoldersUrl() + "/trash/items"; }


    
Gets a request that retrieves information on a folder

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


    
Gets a request that retrieves the items of a folder

Parameters:
id id of folder to get children on
Returns:
request to get a folders children
 
         return request;
     }


    
Gets a request that creates a folder in a parent folder

Parameters:
parentId id of the parent folder to create the folder in
name name of the new folder
Returns:
request to create a folder
    public BoxRequestsFolder.CreateFolder getCreateRequest(String parentIdString name) {
        BoxRequestsFolder.CreateFolder request = new BoxRequestsFolder.CreateFolder(parentIdnamegetFoldersUrl(), );
        return request;
    }


    
Gets a request that updates a folders information

Parameters:
id id of folder to update information on
Returns:
request to update a folders information
        return request;
    }

    
Gets a request that renames a folder

Parameters:
id id of folder to rename
newName id of folder to retrieve info on
Returns:
request to rename a folder
    public BoxRequestsFolder.UpdateFolder getRenameRequest(String idString newName) {
                .setName(newName);
        return request;
    }

    
Gets a request that moves a folder to another folder

Parameters:
id id of folder to move
parentId id of parent folder to move folder into
Returns:
request to move a folder
    public BoxRequestsFolder.UpdateFolder getMoveRequest(String idString parentId) {
                .setParentId(parentId);
        return request;
    }

    
Gets a request that copies a folder

Parameters:
id id of folder to copy
parentId id of parent folder to copy folder into
Returns:
request to copy a folder
    public BoxRequestsFolder.CopyFolder getCopyRequest(String idString parentId) {
        BoxRequestsFolder.CopyFolder request = new BoxRequestsFolder.CopyFolder(idparentIdgetFolderCopyUrl(id), );
        return request;
    }

    
Gets a request that deletes a folder

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

    
Gets a request that gets the collaborations of a folder

Parameters:
id id of folder to move
Returns:
request to move a folder
        return request;
    }

    
Gets a request that creates a shared link for a folder

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

    
Gets a request that disables a shared link for a folder

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

    
Gets a request that adds a folder to a collection

Parameters:
folderId id of folder to add to collection
collectionId id of collection to add the folder to
Returns:
request to add a folder to a collection
        BoxRequestsFolder.AddFolderToCollection request = new BoxRequestsFolder.AddFolderToCollection(folderIdcollectionIdgetFolderInfoUrl(folderId), );
        return request;
    }

    
Gets a request that removes a folder from a collection

Parameters:
id id of folder to delete from the collection
Returns:
request to delete a folder from a collection
        return request;
    }

    
Gets a request that returns the items in the trash

Returns:
request to get a folder from the trash
        return request;
    }

    
Gets a request that returns a folder in the trash

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

    
Gets a request that permanently deletes a folder from the trash

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

    
Gets a request that restores a trashed folder

Parameters:
id id of folder to restore
Returns:
request to restore a folder from the trash
        return request;
    }
New to GrepCode? Check out our FAQ X