@Test public void accountInfo() throws Exception { Account info = api.accountInfo(); assert info.country != null : "No country for account"; assert info.displayName != null : "No displayName for account"; assert info.email != null : "No email for account"; assert info.quota > 0 : "0 quota in account"; assert info.quotaNormal > 0 : "0 normal quota in account"; assert info.referralLink != null : "No referral link for account"; assert info.uid > 0 : "No uid for account"; boolean isOverQuota = info.quotaNormal + info.quotaShared > info.quota; assert info.isOverQuota() == isOverQuota : "IsOverQuota failed"; TeamInfo teamInfo = info.teamInfo; if (teamInfo != null) { assert teamInfo.name != null : "No team name for account"; assert teamInfo.teamId != null : "No team id for account"; System.out.println("User is on team " + teamInfo.name); } else { System.out.println("User is not on a team"); } assert info.locale.equals("en") : "Unexpected locale"; NameDetails nameDetails = info.nameDetails; assert nameDetails.givenName.equalsIgnoreCase(nameDetails.familiarName); assert info.displayName.equals(nameDetails.givenName + " " + nameDetails.surname); }
public Account accountInfo() throws DropboxException { assertAuthenticated(); @SuppressWarnings("unchecked") Map<String, Object> accountInfo = (Map<String, Object>) RESTUtility.request(RequestMethod.GET, session.getAPIServer(), "/account/info", VERSION, new String[] {"locale", session.getLocale().toString()}, session); return new Account(accountInfo); }
DropboxAPI { public Account accountInfo() throws DropboxException { assertAuthenticated(); @SuppressWarnings("unchecked") Map<String, Object> accountInfo = (Map<String, Object>) RESTUtility.request(RequestMethod.GET, session.getAPIServer(), "/account/info", VERSION, new String[] {"locale", session.getLocale().toString()}, session); return new Account(accountInfo); } }
DropboxAPI { public Account accountInfo() throws DropboxException { assertAuthenticated(); @SuppressWarnings("unchecked") Map<String, Object> accountInfo = (Map<String, Object>) RESTUtility.request(RequestMethod.GET, session.getAPIServer(), "/account/info", VERSION, new String[] {"locale", session.getLocale().toString()}, session); return new Account(accountInfo); } DropboxAPI(SESS_T session); }
DropboxAPI { public Account accountInfo() throws DropboxException { assertAuthenticated(); @SuppressWarnings("unchecked") Map<String, Object> accountInfo = (Map<String, Object>) RESTUtility.request(RequestMethod.GET, session.getAPIServer(), "/account/info", VERSION, new String[] {"locale", session.getLocale().toString()}, session); return new Account(accountInfo); } DropboxAPI(SESS_T session); ChunkedUploader getChunkedUploader(InputStream is); ChunkedUploader getChunkedUploader(InputStream is, long length); ChunkedUploader getChunkedUploader(InputStream is, long length, int chunkSize); ChunkedUploadRequest chunkedUploadRequest(InputStream is, long length,
                                                     ProgressListener listener,
                                                     long offset, String uploadId); SESS_T getSession(); Account accountInfo(); DropboxFileInfo getFile(String path, String rev, OutputStream os,
            ProgressListener listener); DropboxInputStream getFileStream(String path, String rev); Entry putFile(String path, InputStream is, long length,
            String parentRev, ProgressListener listener); Entry putFile(String path, InputStream is, long length,
            String parentRev, boolean autoRename, ProgressListener listener); UploadRequest putFileRequest(String path, InputStream is,
            long length, String parentRev, ProgressListener listener); UploadRequest putFileRequest(String path, InputStream is,
            long length, String parentRev, boolean autoRename, ProgressListener listener); Entry putFileOverwrite(String path, InputStream is, long length,
            ProgressListener listener); UploadRequest putFileOverwriteRequest(String path, InputStream is,
            long length, ProgressListener listener); DropboxFileInfo getThumbnail(String path, OutputStream os,
            ThumbSize size, ThumbFormat format, ProgressListener listener); DropboxInputStream getThumbnailStream(String path, ThumbSize size,
            ThumbFormat format); Entry metadata(String path, int fileLimit, String hash,
            boolean list, String rev); @SuppressWarnings("unchecked") List<Entry> revisions(String path, int revLimit); List<Entry> search(String path, String query, int fileLimit,
            boolean includeDeleted); Entry move(String fromPath, String toPath); Entry copy(String fromPath, String toPath); Entry createFolder(String path); void delete(String path); Entry restore(String path, String rev); DropboxLink media(String path, boolean ssl); DropboxLink share(String path); DeltaPage<Entry> delta(String cursor); CreatedCopyRef createCopyRef(String sourcePath); Entry addFromCopyRef(String sourceCopyRef, String targetPath); }
DropboxAPI { public Account accountInfo() throws DropboxException { assertAuthenticated(); @SuppressWarnings("unchecked") Map<String, Object> accountInfo = (Map<String, Object>) RESTUtility.request(RequestMethod.GET, session.getAPIServer(), "/account/info", VERSION, new String[] {"locale", session.getLocale().toString()}, session); return new Account(accountInfo); } DropboxAPI(SESS_T session); ChunkedUploader getChunkedUploader(InputStream is); ChunkedUploader getChunkedUploader(InputStream is, long length); ChunkedUploader getChunkedUploader(InputStream is, long length, int chunkSize); ChunkedUploadRequest chunkedUploadRequest(InputStream is, long length,
                                                     ProgressListener listener,
                                                     long offset, String uploadId); SESS_T getSession(); Account accountInfo(); DropboxFileInfo getFile(String path, String rev, OutputStream os,
            ProgressListener listener); DropboxInputStream getFileStream(String path, String rev); Entry putFile(String path, InputStream is, long length,
            String parentRev, ProgressListener listener); Entry putFile(String path, InputStream is, long length,
            String parentRev, boolean autoRename, ProgressListener listener); UploadRequest putFileRequest(String path, InputStream is,
            long length, String parentRev, ProgressListener listener); UploadRequest putFileRequest(String path, InputStream is,
            long length, String parentRev, boolean autoRename, ProgressListener listener); Entry putFileOverwrite(String path, InputStream is, long length,
            ProgressListener listener); UploadRequest putFileOverwriteRequest(String path, InputStream is,
            long length, ProgressListener listener); DropboxFileInfo getThumbnail(String path, OutputStream os,
            ThumbSize size, ThumbFormat format, ProgressListener listener); DropboxInputStream getThumbnailStream(String path, ThumbSize size,
            ThumbFormat format); Entry metadata(String path, int fileLimit, String hash,
            boolean list, String rev); @SuppressWarnings("unchecked") List<Entry> revisions(String path, int revLimit); List<Entry> search(String path, String query, int fileLimit,
            boolean includeDeleted); Entry move(String fromPath, String toPath); Entry copy(String fromPath, String toPath); Entry createFolder(String path); void delete(String path); Entry restore(String path, String rev); DropboxLink media(String path, boolean ssl); DropboxLink share(String path); DeltaPage<Entry> delta(String cursor); CreatedCopyRef createCopyRef(String sourcePath); Entry addFromCopyRef(String sourceCopyRef, String targetPath); static final int VERSION; static final String SDK_VERSION; static final long MAX_UPLOAD_SIZE; }