Tabnine Logo
DbxClientV2.users
Code IndexAdd Tabnine to your IDE (free)

How to use
users
method
in
com.dropbox.core.v2.DbxClientV2

Best Java code snippets using com.dropbox.core.v2.DbxClientV2.users (Showing top 4 results out of 315)

origin: org.apache.camel/camel-dropbox

private void verifyCredentials(ResultBuilder builder, Map<String, Object> parameters) {
  String token = (String) parameters.get("accessToken");
  String clientId = (String) parameters.get("clientIdentifier");
  try {
    // Create Dropbox client
    DbxRequestConfig config = new DbxRequestConfig(clientId, Locale.getDefault().toString());
    DbxClientV2 client = new DbxClientV2(config, token);
    client.users().getCurrentAccount();
    client = null;
  } catch (Exception e) {
    builder.error(ResultErrorBuilder
        .withCodeAndDescription(VerificationError.StandardCode.AUTHENTICATION,
            "Invalid client identifier and/or access token")
        .parameterKey("accessToken").parameterKey("clientIdentifier").build());
  }
}
origin: io.syndesis.connector/connector-dropbox

private void verifyCredentials(ResultBuilder builder, Map<String, Object> parameters) {
  String token = (String) parameters.get("accessToken");
  String clientId = (String) parameters.get("clientIdentifier");
  try {
    // Create Dropbox client
    DbxRequestConfig config = new DbxRequestConfig(clientId, Locale.getDefault().toString());
    DbxClientV2 client = new DbxClientV2(config, token);
    client.users().getCurrentAccount();
  } catch (DbxException e) {
    builder.error(ResultErrorBuilder
        .withCodeAndDescription(VerificationError.StandardCode.AUTHENTICATION,
            "Invalid client identifier and/or access token")
        .parameterKey("accessToken").parameterKey("clientIdentifier").build());
  }
}
origin: sebbrudzinski/Open-LaTeX-Studio

private void displayCloudStatus() {
  String message = "Working locally.";
  String displayName;
  // Check Dropbox connection
  DbxClientV2 client = DbxUtil.getDbxClient();
  if (client != null) {  
    try {
      displayName = client.users().getCurrentAccount().getName().getDisplayName();
      message = "Connected to Dropbox account as " + displayName + ".";
      Cloud.getInstance().setStatus(Cloud.Status.DBX_CONNECTED, " (" + displayName + ")");
    } catch (DbxException ex) {
      // simply stay working locally.
      Cloud.getInstance().setStatus(Cloud.Status.DISCONNECTED);
    }
  }
  
  LOGGER.log(message);
}
 
origin: sebbrudzinski/Open-LaTeX-Studio

String additional = "";
if(client != null) {
  additional = " (" + client.users().getCurrentAccount().getName().getDisplayName() + ")";
com.dropbox.core.v2DbxClientV2users

Popular methods of DbxClientV2

  • <init>
    For internal use only. Used by other clients to provide functionality like DbxTeamClientV2.asMember(
  • files
  • auth

Popular in Java

  • Start an intent from android
  • setScale (BigDecimal)
  • scheduleAtFixedRate (Timer)
  • addToBackStack (FragmentTransaction)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now