Class BusinessOneDrive

java.lang.Object
com.amilesend.onedrive.OneDrive
com.amilesend.onedrive.BusinessOneDrive

public class BusinessOneDrive extends OneDrive
The primary exposed object to consumers to access drives available to the authenticated user for business accounts.

While this object can be instantiated directly by consumers, it is recommended to leverage the OneDriveFactoryStateManager instead. Doing so simplifies OAUTH authentication and persists the authentication tokens for reuse. Without it, consumers are responsible for initiating the OAUTH handshake to obtain the authorization code and managing persisted refresh tokens for future instantiation without requiring the user to re-authorize the consumer application with their OneDrive account.

See Also:
  • Constructor Details

    • BusinessOneDrive

      public BusinessOneDrive(OneDriveConnection connection)
      Creates a new BusinessOneDrive.
      Parameters:
      connection - the authenticated connection
  • Method Details

    • getRootSite

      public Site getRootSite()
      Gets the root site.

      API Documentation.

      Returns:
      the root site
      See Also:
    • getSite

      public Site getSite(String siteId)
      Gets the Site for the given siteId.

      API Documentation.

      Parameters:
      siteId - the site identifier
      Returns:
      the site
      See Also:
    • getSiteForGroup

      public Site getSiteForGroup(String groupId)
      Gets the root Site for the given groupId.

      API Documentation.

      Parameters:
      groupId - the group identifier
      Returns:
      the site
    • getRootSites

      public List<Site> getRootSites()
      Gets the list of Sites in an organization.

      API Documentation.

      Returns:
      the list of sites
      See Also:
    • searchForSite

      public List<Site> searchForSite(String query)
      Searches for sites for the given query.

      API Documentation.

      Parameters:
      query - the search query
      Returns:
      the list of sites
      See Also:
    • getDefaultDriveForGroup

      public Drive getDefaultDriveForGroup(String groupId)
      Gets the default Drive for the given groupId.

      API Documentation.

      Parameters:
      groupId - the group identifier
      Returns:
      the drive
    • getDefaultDriveForSite

      public Drive getDefaultDriveForSite(String siteId)
      Gets the default Drive for the given siteId.

      API Documentation.

      Parameters:
      siteId - the site identifier
      Returns:
      the drive
    • getDrivesForSite

      public List<Drive> getDrivesForSite(String siteId)
      Gets the list of drives available to the given siteId.

      API Documentation.

      Parameters:
      siteId - the site identifier
      Returns:
      the list of drives
    • getDrivesForGroup

      public List<Drive> getDrivesForGroup(String groupId)
      Gets the list of drives available to the given groupId. Note: Business accounts only

      API Documentation.

      Parameters:
      groupId - the group identifier
      Returns:
      the list of drives
    • getDrivesForUser

      public List<Drive> getDrivesForUser(String userId)
      Gets the list of drives available to the given userId. Note: Business accounts only

      API Documentation.

      Parameters:
      userId - the user identifier
      Returns:
      the list of drives