Difference between revisions of "SOAP API"

From 4shared wiki
Jump to: navigation, search
Line 72: Line 72:
  
 
__NOTOC__
 
__NOTOC__
 +
 +
== '''Method Summary''' ==
 +
 +
== addToFavorites ==
 +
long addToFavorites(java.lang.String login, java.lang.String password, long fileId)
 +
Adds file to user favorites.
 +
 +
== addToMyAccount ==
 +
java.lang.String addToMyAccount(java.lang.String login, java.lang.String password, long dirId, java.lang.String link)
 +
Adds file or folder identified by supplied link to user's account in folder identified by dirId
 +
 +
== checkSharedDirAccess ==
 +
int checkSharedDirAccess(java.lang.String login, java.lang.String password, long dirID, java.lang.String dirPassword, java.lang.String userDirPassword)
 +
Checks if directory can be accessed by specified user with specified passwords
 +
 +
== createNewFolder ==
 +
long createNewFolder(java.lang.String login, java.lang.String password, long dirID, java.lang.String folderName)
 +
Creates new folder as dirId subfolder
 +
 +
== createUploadSessionKey ==
 +
java.lang.String createUploadSessionKey(java.lang.String login, java.lang.String password, long dirID)
 +
Creates session key for uploading file
 +
 +
== decodeId ==
 +
java.lang.String decodeId(java.lang.String login, java.lang.String password, java.lang.String encodedId)
 +
turns new encoded folder id into form id+"/"+4shared_password for shared folder browsing encoded folder id can be found as 8-symbol group of folder url right after /dir/ regexp: http://www.4shared.com/dir/(.{8,8})/.*
 +
 +
== decodeLink ==
 +
long decodeLink(java.lang.String login, java.lang.String password, java.lang.String link)
 +
Used to get item id from item link.
 +
 +
== deleteFile ==
 +
void deleteFile(java.lang.String login, java.lang.String password, long fileID)
 +
Removes file to recycle bin
 +
 +
==deleteFileFinal==
 +
void deleteFileFinal(java.lang.String login, java.lang.String password, long fileID)
 +
Remove file once and for all.
 +
 +
== deleteFolder ==
 +
void deleteFolder(java.lang.String login, java.lang.String password, long dirID)
 +
Completely removes folder and puts all of it contents to recycle bin
 +
 +
== deleteFolderFinal ==
 +
void deleteFolderFinal(java.lang.String login, java.lang.String password, long dirID)
 +
Removes files and subfolders from recycle bin.
 +
 +
== downloadFinished ==
 +
void downloadFinished(java.lang.String login, java.lang.String password, long fileId)
 +
Have to be called after full file download
 +
 +
== emptyRecycleBin ==
 +
int emptyRecycleBin(java.lang.String login, java.lang.String password)
 +
Empties recycle bean for specified user.
 +
 +
== getAllFolders ==
 +
AccountItem[] getAllFolders(java.lang.String login, java.lang.String password)
 +
Returns all of the folders in user's root directory
 +
 +
== getAllItems ==
 +
AccountItem[] getAllItems(java.lang.String login, java.lang.String password)
 +
Returns info about all items in user's root folder
 +
 +
== getDirDescription ==
 +
java.lang.String getDirDescription(java.lang.String login, java.lang.String password, long dirId)
 +
Returns folder description
 +
 +
== getDirectLink ==
 +
java.lang.String getDirectLink(java.lang.String login, java.lang.String password, java.lang.String link)
 +
Returns link to start immediate downloading.
 +
 +
== getDirInfo ==
 +
AccountItem getDirInfo(java.lang.String login, java.lang.String password, long dirID)
 +
Return info about specified folder
 +
 +
== getExifFileInfo ==
 +
ExifInfo getExifFileInfo(java.lang.String login, java.lang.String password, java.lang.String fileLink)
 +
Return image info for specified file link if any
 +
 +
 +
== getExifFileInfos ==
 +
ExifInfo[] getExifFileInfos(java.lang.String login, java.lang.String password, long dirId)
 +
Returns @see ExifInfo for all image files in specified folder
 +
 +
==getFavorites==
 +
AccountItem[] getFavorites(java.lang.String login, java.lang.String password)
 +
Returns user favored files.
 +
 +
== getFileDescription ==
 +
java.lang.String[] getFileDescription(java.lang.String login, java.lang.String password, long fileId)
 +
Returns file title, tags and description if any
 +
 +
== getFileDownloadLink ==
 +
java.lang.String getFileDownloadLink(java.lang.String login, java.lang.String password, long fileID)
 +
Returns download link for user owned file
 +
 +
== getFileInfo ==
 +
AccountItem getFileInfo(java.lang.String login, java.lang.String password, long fileID)
 +
Returns info about file
 +
 +
== getFiles ==
 +
AccountItem[] getFiles(java.lang.String login, java.lang.String password, long[] fileIds)
 +
Returns account items for file ids.
 +
 +
== getFreeSpace ==
 +
long getFreeSpace(java.lang.String login, java.lang.String password)
 +
Gets free space left for user
 +
 +
== getItemInfo ==
 +
AccountItem getItemInfo(java.lang.String login, java.lang.String password, long itemID, boolean dir)
 +
Common method for DesktopApp.getFileInfo(String, String, long) and DesktopApp.getDirInfo(String, String, long) distinguished by value of dir parameter
 +
 +
== getItems ==
 +
AccountItem[] getItems(java.lang.String login, java.lang.String password, long dirID)
 +
Returns array of infos about contents of specified dir.
 +
 +
== getItemsCount ==
 +
long getItemsCount(java.lang.String login, java.lang.String password, long dirID)
 +
Returns item count for dirId (-1 for root folder)
 +
 +
== getItemsPartial ==
 +
AccountItem[] getItemsPartial(java.lang.String login, java.lang.String password, long dirId, int startIndex, int count)
 +
Get specified count folders' items ordered by name, folders first starting from startIndex
 +
 +
== getMaxFileSize ==
 +
long getMaxFileSize(java.lang.String login, java.lang.String password)
 +
Return maximum allowed file size for specified user
 +
 +
== getMp3FileInfo ==
 +
Mp3Info getMp3FileInfo(java.lang.String login, java.lang.String password, java.lang.String fileLink)
 +
Return audio info for specified file link if any
 +
 +
== getMp3FileInfos ==
 +
Mp3Info[] getMp3FileInfos(java.lang.String login, java.lang.String password, long dirId)
 +
Returns audio info for all audio files in folder
 +
 +
== getNewFileDataCenter ==
 +
long getNewFileDataCenter(java.lang.String login, java.lang.String password)
 +
Returns datacenter id to upload files to
 +
 +
== getNotOwnedSizeLimit ==
 +
long getNotOwnedSizeLimit()
 +
Max file size which can be downloaded without speed limit
 +
 +
== getPreviewLink ==
 +
java.lang.String getPreviewLink(java.lang.String login, java.lang.String password, long fileId)
 +
Return link to small preview image, or to flv preview for video files
 +
 +
== getRecycleBinItems ==
 +
AccountItem[] getRecycleBinItems(java.lang.String login, java.lang.String password)
 +
Returns info about files in recycle bin
 +
 +
== getRoot ==
 +
AccountItem getRoot(java.lang.String login, java.lang.String password)
 +
Returns account item for user's root directory
 +
 +
== getSharedDirItems ==
 +
AccountItem[] getSharedDirItems(java.lang.String login, java.lang.String password, long dirID, java.lang.String dirPassword, java.lang.String userDirPassword)
 +
Return content of possibly not owned shared folder
 +
 +
== getSpaceLimit ==
 +
long getSpaceLimit(java.lang.String login, java.lang.String password)
 +
Returns user space limit
 +
 +
== getUploadFormUrl ==
 +
java.lang.String getUploadFormUrl(int dataCenterID, java.lang.String sessionKey)
 +
Returns url to upload file to.
 +
 +
== hasRightUpload ==
 +
boolean hasRightUpload()
 +
Whether upload feature is on.
 +
 +
== isAccountActive ==
 +
boolean isAccountActive(java.lang.String login, java.lang.String password)
 +
Checks account active status
 +
 +
== isAccountBanned ==
 +
boolean isAccountBanned(java.lang.String login, java.lang.String password)
 +
Checks if user account is banned
 +
 +
== isAccountPremium ==
 +
boolean isAccountPremium(java.lang.String login, java.lang.String password)
 +
Checks if user account is premium
 +
 +
== isExistsLoginPassword ==
 +
boolean isExistsLoginPassword(java.lang.String login, java.lang.String password)
 +
true-false version of login.
 +
 +
== login ==
 +
java.lang.String login(java.lang.String login, java.lang.String password)
 +
Login version with diagnostic message.
 +
 +
== pasteFilesDirs ==
 +
java.lang.String pasteFilesDirs(java.lang.String login, java.lang.String password, long toFolderId, boolean makeCopy, long[] fileIds, long[] dirIds)
 +
Copy-pastes or cut-pastes a group of files and dirs.
 +
 +
== removeFromFavorites ==
 +
long removeFromFavorites(java.lang.String login, java.lang.String password, long fileId)
 +
Removes file from user's favorites.
 +
 +
== renameFile ==
 +
long renameFile(java.lang.String login, java.lang.String password, long fileID, java.lang.String newName)
 +
Renames specified file
 +
 +
== renameFolder ==
 +
long renameFolder(java.lang.String login, java.lang.String password, long dirID, java.lang.String newName)
 +
Renames specified folder
 +
 +
== restoreFile ==
 +
void restoreFile(java.lang.String login, java.lang.String password, long fileID)
 +
Restores file from Recycle Bin.
 +
 +
== restoreFiles ==
 +
void restoreFiles(java.lang.String login, java.lang.String password, long[] fileIDs)
 +
Restores group of files from Recycle Bin.
 +
 +
== setDirDescription ==
 +
java.lang.String setDirDescription(java.lang.String login, java.lang.String password, long dirId, java.lang.String newDescription, boolean setAsDefault, boolean applyToAll)
 +
Sets folder description for dedicated folder or account as a whole
 +
 +
== setFileDescription ==
 +
java.lang.String setFileDescription(java.lang.String login, java.lang.String password, long fileId, java.lang.String title, java.lang.String tags, java.lang.String newDescription, boolean setAsDefault, boolean applyToAll)
 +
Sets file title, tags and description for dedicated file or account as a whole
 +
 +
== signup ==
 +
java.lang.String signup(java.lang.String login, java.lang.String password)
 +
Creates new User with specified login(email) and password and sends confirmation email.
 +
 +
== signupUsername ==
 +
java.lang.String signupUsername(java.lang.String login, java.lang.String password, java.lang.String username)
 +
Creates new User with specified login(email), short username for easing login and password and sends confirmation email.
 +
 +
== uploadCancelFile ==
 +
void uploadCancelFile(java.lang.String login, java.lang.String password, long fileId)
 +
Call if upload was canceled
 +
 +
== uploadFinishFile ==
 +
java.lang.String uploadFinishFile(java.lang.String login, java.lang.String password, long fileId, java.lang.String md5)
 +
Complete resumable upload
 +
 +
== uploadStartedFileExists ==
 +
boolean uploadStartedFileExists(java.lang.String login, java.lang.String password, long fileId)
 +
Checks if file was partially uploaded
 +
 +
== uploadStartFile ==
 +
long uploadStartFile(java.lang.String login, java.lang.String password, long dirID, java.lang.String name, long fullSize)
 +
Resumable upload - start
 +
 +
== uploadStartFileUpdate ==
 +
long uploadStartFileUpdate(java.lang.String login, java.lang.String password, long updateFileId, java.lang.String name, long fullSize)
 +
Update file
 +
  
 
== Upload HOW TO ==
 
== Upload HOW TO ==
Line 887: Line 1,139:
 
Returns:
 
Returns:
 
   id of temporary file uploading of which will cause update of original file
 
   id of temporary file uploading of which will cause update of original file
 
== addToFavorites ==
 
long addToFavorites(java.lang.String login, java.lang.String password, long fileId)
 
Adds file to user favorites.
 
 
== addToMyAccount ==
 
java.lang.String addToMyAccount(java.lang.String login, java.lang.String password, long dirId, java.lang.String link)
 
Adds file or folder identified by supplied link to user's account in folder identified by dirId
 
 
== checkSharedDirAccess ==
 
int checkSharedDirAccess(java.lang.String login, java.lang.String password, long dirID, java.lang.String dirPassword, java.lang.String userDirPassword)
 
Checks if directory can be accessed by specified user with specified passwords
 
 
== createNewFolder ==
 
long createNewFolder(java.lang.String login, java.lang.String password, long dirID, java.lang.String folderName)
 
Creates new folder as dirId subfolder
 
 
== createUploadSessionKey ==
 
java.lang.String createUploadSessionKey(java.lang.String login, java.lang.String password, long dirID)
 
Creates session key for uploading file
 
 
== decodeId ==
 
java.lang.String decodeId(java.lang.String login, java.lang.String password, java.lang.String encodedId)
 
turns new encoded folder id into form id+"/"+4shared_password for shared folder browsing encoded folder id can be found as 8-symbol group of folder url right after /dir/ regexp: http://www.4shared.com/dir/(.{8,8})/.*
 
 
== decodeLink ==
 
long decodeLink(java.lang.String login, java.lang.String password, java.lang.String link)
 
Used to get item id from item link.
 
 
== deleteFile ==
 
void deleteFile(java.lang.String login, java.lang.String password, long fileID)
 
Removes file to recycle bin
 
 
==deleteFileFinal==
 
void deleteFileFinal(java.lang.String login, java.lang.String password, long fileID)
 
Remove file once and for all.
 
 
== deleteFolder ==
 
void deleteFolder(java.lang.String login, java.lang.String password, long dirID)
 
Completely removes folder and puts all of it contents to recycle bin
 
 
== deleteFolderFinal ==
 
void deleteFolderFinal(java.lang.String login, java.lang.String password, long dirID)
 
Removes files and subfolders from recycle bin.
 
 
== downloadFinished ==
 
void downloadFinished(java.lang.String login, java.lang.String password, long fileId)
 
Have to be called after full file download
 
 
== emptyRecycleBin ==
 
int emptyRecycleBin(java.lang.String login, java.lang.String password)
 
Empties recycle bean for specified user.
 
 
== getAllFolders ==
 
AccountItem[] getAllFolders(java.lang.String login, java.lang.String password)
 
Returns all of the folders in user's root directory
 
 
== getAllItems ==
 
AccountItem[] getAllItems(java.lang.String login, java.lang.String password)
 
Returns info about all items in user's root folder
 
 
== getDirDescription ==
 
java.lang.String getDirDescription(java.lang.String login, java.lang.String password, long dirId)
 
Returns folder description
 
 
== getDirectLink ==
 
java.lang.String getDirectLink(java.lang.String login, java.lang.String password, java.lang.String link)
 
Returns link to start immediate downloading.
 
 
== getDirInfo ==
 
AccountItem getDirInfo(java.lang.String login, java.lang.String password, long dirID)
 
Return info about specified folder
 
 
== getExifFileInfo ==
 
ExifInfo getExifFileInfo(java.lang.String login, java.lang.String password, java.lang.String fileLink)
 
Return image info for specified file link if any
 
 
 
== getExifFileInfos ==
 
ExifInfo[] getExifFileInfos(java.lang.String login, java.lang.String password, long dirId)
 
Returns @see ExifInfo for all image files in specified folder
 
 
==getFavorites==
 
AccountItem[] getFavorites(java.lang.String login, java.lang.String password)
 
Returns user favored files.
 
 
== getFileDescription ==
 
java.lang.String[] getFileDescription(java.lang.String login, java.lang.String password, long fileId)
 
Returns file title, tags and description if any
 
 
== getFileDownloadLink ==
 
java.lang.String getFileDownloadLink(java.lang.String login, java.lang.String password, long fileID)
 
Returns download link for user owned file
 
 
== getFileInfo ==
 
AccountItem getFileInfo(java.lang.String login, java.lang.String password, long fileID)
 
Returns info about file
 
 
== getFiles ==
 
AccountItem[] getFiles(java.lang.String login, java.lang.String password, long[] fileIds)
 
Returns account items for file ids.
 
 
== getFreeSpace ==
 
long getFreeSpace(java.lang.String login, java.lang.String password)
 
Gets free space left for user
 
 
== getItemInfo ==
 
AccountItem getItemInfo(java.lang.String login, java.lang.String password, long itemID, boolean dir)
 
Common method for DesktopApp.getFileInfo(String, String, long) and DesktopApp.getDirInfo(String, String, long) distinguished by value of dir parameter
 
 
== getItems ==
 
AccountItem[] getItems(java.lang.String login, java.lang.String password, long dirID)
 
Returns array of infos about contents of specified dir.
 
 
== getItemsCount ==
 
long getItemsCount(java.lang.String login, java.lang.String password, long dirID)
 
Returns item count for dirId (-1 for root folder)
 
 
== getItemsPartial ==
 
AccountItem[] getItemsPartial(java.lang.String login, java.lang.String password, long dirId, int startIndex, int count)
 
Get specified count folders' items ordered by name, folders first starting from startIndex
 
 
== getMaxFileSize ==
 
long getMaxFileSize(java.lang.String login, java.lang.String password)
 
Return maximum allowed file size for specified user
 
 
== getMp3FileInfo ==
 
Mp3Info getMp3FileInfo(java.lang.String login, java.lang.String password, java.lang.String fileLink)
 
Return audio info for specified file link if any
 
 
== getMp3FileInfos ==
 
Mp3Info[] getMp3FileInfos(java.lang.String login, java.lang.String password, long dirId)
 
Returns audio info for all audio files in folder
 
 
== getNewFileDataCenter ==
 
long getNewFileDataCenter(java.lang.String login, java.lang.String password)
 
Returns datacenter id to upload files to
 
 
== getNotOwnedSizeLimit ==
 
long getNotOwnedSizeLimit()
 
Max file size which can be downloaded without speed limit
 
 
== getPreviewLink ==
 
java.lang.String getPreviewLink(java.lang.String login, java.lang.String password, long fileId)
 
Return link to small preview image, or to flv preview for video files
 
 
== getRecycleBinItems ==
 
AccountItem[] getRecycleBinItems(java.lang.String login, java.lang.String password)
 
Returns info about files in recycle bin
 
 
== getRoot ==
 
AccountItem getRoot(java.lang.String login, java.lang.String password)
 
Returns account item for user's root directory
 
 
== getSharedDirItems ==
 
AccountItem[] getSharedDirItems(java.lang.String login, java.lang.String password, long dirID, java.lang.String dirPassword, java.lang.String userDirPassword)
 
Return content of possibly not owned shared folder
 
 
== getSpaceLimit ==
 
long getSpaceLimit(java.lang.String login, java.lang.String password)
 
Returns user space limit
 
 
== getUploadFormUrl ==
 
java.lang.String getUploadFormUrl(int dataCenterID, java.lang.String sessionKey)
 
Returns url to upload file to.
 
 
== hasRightUpload ==
 
boolean hasRightUpload()
 
Whether upload feature is on.
 
 
== isAccountActive ==
 
boolean isAccountActive(java.lang.String login, java.lang.String password)
 
Checks account active status
 
 
== isAccountBanned ==
 
boolean isAccountBanned(java.lang.String login, java.lang.String password)
 
Checks if user account is banned
 
 
== isAccountPremium ==
 
boolean isAccountPremium(java.lang.String login, java.lang.String password)
 
Checks if user account is premium
 
 
== isExistsLoginPassword ==
 
boolean isExistsLoginPassword(java.lang.String login, java.lang.String password)
 
true-false version of login.
 
 
== login ==
 
java.lang.String login(java.lang.String login, java.lang.String password)
 
Login version with diagnostic message.
 
 
== pasteFilesDirs ==
 
java.lang.String pasteFilesDirs(java.lang.String login, java.lang.String password, long toFolderId, boolean makeCopy, long[] fileIds, long[] dirIds)
 
Copy-pastes or cut-pastes a group of files and dirs.
 
 
== removeFromFavorites ==
 
long removeFromFavorites(java.lang.String login, java.lang.String password, long fileId)
 
Removes file from user's favorites.
 
 
== renameFile ==
 
long renameFile(java.lang.String login, java.lang.String password, long fileID, java.lang.String newName)
 
Renames specified file
 
 
== renameFolder ==
 
long renameFolder(java.lang.String login, java.lang.String password, long dirID, java.lang.String newName)
 
Renames specified folder
 
 
== restoreFile ==
 
void restoreFile(java.lang.String login, java.lang.String password, long fileID)
 
Restores file from Recycle Bin.
 
 
== restoreFiles ==
 
void restoreFiles(java.lang.String login, java.lang.String password, long[] fileIDs)
 
Restores group of files from Recycle Bin.
 
 
== setDirDescription ==
 
java.lang.String setDirDescription(java.lang.String login, java.lang.String password, long dirId, java.lang.String newDescription, boolean setAsDefault, boolean applyToAll)
 
Sets folder description for dedicated folder or account as a whole
 
 
== setFileDescription ==
 
java.lang.String setFileDescription(java.lang.String login, java.lang.String password, long fileId, java.lang.String title, java.lang.String tags, java.lang.String newDescription, boolean setAsDefault, boolean applyToAll)
 
Sets file title, tags and description for dedicated file or account as a whole
 
 
== signup ==
 
java.lang.String signup(java.lang.String login, java.lang.String password)
 
Creates new User with specified login(email) and password and sends confirmation email.
 
 
== signupUsername ==
 
java.lang.String signupUsername(java.lang.String login, java.lang.String password, java.lang.String username)
 
Creates new User with specified login(email), short username for easing login and password and sends confirmation email.
 
 
== uploadCancelFile ==
 
void uploadCancelFile(java.lang.String login, java.lang.String password, long fileId)
 
Call if upload was canceled
 
 
== uploadFinishFile ==
 
java.lang.String uploadFinishFile(java.lang.String login, java.lang.String password, long fileId, java.lang.String md5)
 
Complete resumable upload
 
 
== uploadStartedFileExists ==
 
boolean uploadStartedFileExists(java.lang.String login, java.lang.String password, long fileId)
 
Checks if file was partially uploaded
 
 
== uploadStartFile ==
 
long uploadStartFile(java.lang.String login, java.lang.String password, long dirID, java.lang.String name, long fullSize)
 
Resumable upload - start
 
 
== uploadStartFileUpdate ==
 
long uploadStartFileUpdate(java.lang.String login, java.lang.String password, long updateFileId, java.lang.String name, long fullSize)
 
Update file
 

Revision as of 15:10, 28 February 2011

Welcome to 4shared SOAP API documentation!

Dear developer!

We are glad to introduce you official 4shared API Program. With the 4shared API, you can get started developing your application for Mobile Phones (iPhone, Android, Symbian, Blackberry, Windows mobile), Windows, Mac, iPad, and Linux today.

You may easily use more than 50 API functions to perform any actions with 4shared like - access web account, upload\download files, search files, create and delete folders, etc.

4shared API is totaly free! All required samples you may find at 4shared API documentation. Any questions regarding 4shared developer program you may discuss at our forum.

Every month we will pick best app with 4shared API and award developer for $5,000!


Contents


Sources

4shared Project at google code.google.com

WSDL can be obtained from here or please check here for more secure SOAPing.

You can browse java sources from mercurial repositories at http://code.google.com/p/4shared-api/source/browse/. Or use hg clone https://4shared-api.googlecode.com/hg/ 4shared-api to get local copy of sources.

Quick start guide

To start working with 4shared SOAP API you should have a copy of mercurial for your favorite OS, Java SDK, ant building system. Some Java IDE is also recomended.

1. Get sources from google.code.com:

 hg clone https://4shared-api.googlecode.com/hg/ 4shared-api

2. Go to created folder and build project:

 ant

3. Try to use some of provided examples:

 cd dist/demo
 ./signup <username> <password>
 ./createfolder <username> <password> <foldername>
 ./upload <username> <password> <path to file>
 ./browse <login> <password>

4. Learn how this demos have been written. All demo sources are situated in demo/com/pmstation/shared/soap/demo

5. Write your own fresh and brilliant application

Samples

Java:

CreateFolderDemo.java

DeleteFileDemo.java

Demo.java

DownloadDemo.java

EnumerateItemsDemo.java

EnumerateItemsDemo2.java

LoginDemo.java

RecycleBinDemo.java

RenameDemo.java

SignupDemo.java

StringUtils.java

UploadDemo.java



Method Summary

addToFavorites

long addToFavorites(java.lang.String login, java.lang.String password, long fileId) Adds file to user favorites.

addToMyAccount

java.lang.String addToMyAccount(java.lang.String login, java.lang.String password, long dirId, java.lang.String link) Adds file or folder identified by supplied link to user's account in folder identified by dirId

checkSharedDirAccess

int checkSharedDirAccess(java.lang.String login, java.lang.String password, long dirID, java.lang.String dirPassword, java.lang.String userDirPassword) Checks if directory can be accessed by specified user with specified passwords

createNewFolder

long createNewFolder(java.lang.String login, java.lang.String password, long dirID, java.lang.String folderName) Creates new folder as dirId subfolder

createUploadSessionKey

java.lang.String createUploadSessionKey(java.lang.String login, java.lang.String password, long dirID) Creates session key for uploading file

decodeId

java.lang.String decodeId(java.lang.String login, java.lang.String password, java.lang.String encodedId) turns new encoded folder id into form id+"/"+4shared_password for shared folder browsing encoded folder id can be found as 8-symbol group of folder url right after /dir/ regexp: http://www.4shared.com/dir/(.{8,8})/.*

decodeLink

long decodeLink(java.lang.String login, java.lang.String password, java.lang.String link) Used to get item id from item link.

deleteFile

void deleteFile(java.lang.String login, java.lang.String password, long fileID) Removes file to recycle bin

deleteFileFinal

void deleteFileFinal(java.lang.String login, java.lang.String password, long fileID) Remove file once and for all.

deleteFolder

void deleteFolder(java.lang.String login, java.lang.String password, long dirID) Completely removes folder and puts all of it contents to recycle bin

deleteFolderFinal

void deleteFolderFinal(java.lang.String login, java.lang.String password, long dirID) Removes files and subfolders from recycle bin.

downloadFinished

void downloadFinished(java.lang.String login, java.lang.String password, long fileId) Have to be called after full file download

emptyRecycleBin

int emptyRecycleBin(java.lang.String login, java.lang.String password) Empties recycle bean for specified user.

getAllFolders

AccountItem[] getAllFolders(java.lang.String login, java.lang.String password) Returns all of the folders in user's root directory

getAllItems

AccountItem[] getAllItems(java.lang.String login, java.lang.String password) Returns info about all items in user's root folder

getDirDescription

java.lang.String getDirDescription(java.lang.String login, java.lang.String password, long dirId) Returns folder description

getDirectLink

java.lang.String getDirectLink(java.lang.String login, java.lang.String password, java.lang.String link) Returns link to start immediate downloading.

getDirInfo

AccountItem getDirInfo(java.lang.String login, java.lang.String password, long dirID) Return info about specified folder

getExifFileInfo

ExifInfo getExifFileInfo(java.lang.String login, java.lang.String password, java.lang.String fileLink) Return image info for specified file link if any


getExifFileInfos

ExifInfo[] getExifFileInfos(java.lang.String login, java.lang.String password, long dirId) Returns @see ExifInfo for all image files in specified folder

getFavorites

AccountItem[] getFavorites(java.lang.String login, java.lang.String password) Returns user favored files.

getFileDescription

java.lang.String[] getFileDescription(java.lang.String login, java.lang.String password, long fileId) Returns file title, tags and description if any

getFileDownloadLink

java.lang.String getFileDownloadLink(java.lang.String login, java.lang.String password, long fileID) Returns download link for user owned file

getFileInfo

AccountItem getFileInfo(java.lang.String login, java.lang.String password, long fileID) Returns info about file

getFiles

AccountItem[] getFiles(java.lang.String login, java.lang.String password, long[] fileIds) Returns account items for file ids.

getFreeSpace

long getFreeSpace(java.lang.String login, java.lang.String password) Gets free space left for user

getItemInfo

AccountItem getItemInfo(java.lang.String login, java.lang.String password, long itemID, boolean dir) Common method for DesktopApp.getFileInfo(String, String, long) and DesktopApp.getDirInfo(String, String, long) distinguished by value of dir parameter

getItems

AccountItem[] getItems(java.lang.String login, java.lang.String password, long dirID) Returns array of infos about contents of specified dir.

getItemsCount

long getItemsCount(java.lang.String login, java.lang.String password, long dirID) Returns item count for dirId (-1 for root folder)

getItemsPartial

AccountItem[] getItemsPartial(java.lang.String login, java.lang.String password, long dirId, int startIndex, int count) Get specified count folders' items ordered by name, folders first starting from startIndex

getMaxFileSize

long getMaxFileSize(java.lang.String login, java.lang.String password) Return maximum allowed file size for specified user

getMp3FileInfo

Mp3Info getMp3FileInfo(java.lang.String login, java.lang.String password, java.lang.String fileLink) Return audio info for specified file link if any

getMp3FileInfos

Mp3Info[] getMp3FileInfos(java.lang.String login, java.lang.String password, long dirId) Returns audio info for all audio files in folder

getNewFileDataCenter

long getNewFileDataCenter(java.lang.String login, java.lang.String password) Returns datacenter id to upload files to

getNotOwnedSizeLimit

long getNotOwnedSizeLimit() Max file size which can be downloaded without speed limit

getPreviewLink

java.lang.String getPreviewLink(java.lang.String login, java.lang.String password, long fileId) Return link to small preview image, or to flv preview for video files

getRecycleBinItems

AccountItem[] getRecycleBinItems(java.lang.String login, java.lang.String password) Returns info about files in recycle bin

getRoot

AccountItem getRoot(java.lang.String login, java.lang.String password) Returns account item for user's root directory

getSharedDirItems

AccountItem[] getSharedDirItems(java.lang.String login, java.lang.String password, long dirID, java.lang.String dirPassword, java.lang.String userDirPassword) Return content of possibly not owned shared folder

getSpaceLimit

long getSpaceLimit(java.lang.String login, java.lang.String password) Returns user space limit

getUploadFormUrl

java.lang.String getUploadFormUrl(int dataCenterID, java.lang.String sessionKey) Returns url to upload file to.

hasRightUpload

boolean hasRightUpload() Whether upload feature is on.

isAccountActive

boolean isAccountActive(java.lang.String login, java.lang.String password) Checks account active status

isAccountBanned

boolean isAccountBanned(java.lang.String login, java.lang.String password) Checks if user account is banned

isAccountPremium

boolean isAccountPremium(java.lang.String login, java.lang.String password) Checks if user account is premium

isExistsLoginPassword

boolean isExistsLoginPassword(java.lang.String login, java.lang.String password) true-false version of login.

login

java.lang.String login(java.lang.String login, java.lang.String password) Login version with diagnostic message.

pasteFilesDirs

java.lang.String pasteFilesDirs(java.lang.String login, java.lang.String password, long toFolderId, boolean makeCopy, long[] fileIds, long[] dirIds) Copy-pastes or cut-pastes a group of files and dirs.

removeFromFavorites

long removeFromFavorites(java.lang.String login, java.lang.String password, long fileId) Removes file from user's favorites.

renameFile

long renameFile(java.lang.String login, java.lang.String password, long fileID, java.lang.String newName) Renames specified file

renameFolder

long renameFolder(java.lang.String login, java.lang.String password, long dirID, java.lang.String newName) Renames specified folder

restoreFile

void restoreFile(java.lang.String login, java.lang.String password, long fileID) Restores file from Recycle Bin.

restoreFiles

void restoreFiles(java.lang.String login, java.lang.String password, long[] fileIDs) Restores group of files from Recycle Bin.

setDirDescription

java.lang.String setDirDescription(java.lang.String login, java.lang.String password, long dirId, java.lang.String newDescription, boolean setAsDefault, boolean applyToAll) Sets folder description for dedicated folder or account as a whole

setFileDescription

java.lang.String setFileDescription(java.lang.String login, java.lang.String password, long fileId, java.lang.String title, java.lang.String tags, java.lang.String newDescription, boolean setAsDefault, boolean applyToAll) Sets file title, tags and description for dedicated file or account as a whole

signup

java.lang.String signup(java.lang.String login, java.lang.String password) Creates new User with specified login(email) and password and sends confirmation email.

signupUsername

java.lang.String signupUsername(java.lang.String login, java.lang.String password, java.lang.String username) Creates new User with specified login(email), short username for easing login and password and sends confirmation email.

uploadCancelFile

void uploadCancelFile(java.lang.String login, java.lang.String password, long fileId) Call if upload was canceled

uploadFinishFile

java.lang.String uploadFinishFile(java.lang.String login, java.lang.String password, long fileId, java.lang.String md5) Complete resumable upload

uploadStartedFileExists

boolean uploadStartedFileExists(java.lang.String login, java.lang.String password, long fileId) Checks if file was partially uploaded

uploadStartFile

long uploadStartFile(java.lang.String login, java.lang.String password, long dirID, java.lang.String name, long fullSize) Resumable upload - start

uploadStartFileUpdate

long uploadStartFileUpdate(java.lang.String login, java.lang.String password, long updateFileId, java.lang.String name, long fullSize) Update file


Upload HOW TO

First of all you should check if you have enough free space in user’s account:

 function long getFreeSpace(String login, String password);

(returned value – free space in bytes)

And what is upload limit for user (per file):

 function long getMaxFileSize(String login, String password);

(returned value – maximum file size in bytes)

Please, check if target file corresponds the mentioned conditions, if it does, then:

Get session:

function String createUploadSessionKey(String login, String password, long dirID);

Set ‘-1’ as DirId parameter. In this case file will be uploaded to the root directory. Or read full API description to learn how to browse user's directory for subdirectories' ids. Return session key if everything is ok and empty or null string if you can't upload to the specified dir.

Get datacenter:

 function int getNewFileDataCenter(String login, String password);

If returned datacenter is less or equal then 0 - something goes wrong.

Then get URL for upload using session and datacenter:

 function String getUploadFormUrl(int dataCenterID, String sessionKey);

Returned string is only valid if it starts with http, otherwise, you can't upload file;

To reserve fileId for yor upload call function:

 function long uploadStartFile(String login, String password, long dirID, String name, long fullSize);

Again, fileId can be only positive.

Then use received URL and fileId to upload by executing POST query multipart/form-data with fields

1) resumableFileId (file ID received via previous method)

2) resumableFirstByte (index of the first byte of current part. If the file is uploaded as single unit – then pass 0. If the file is divided into parts and is uploaded by parts – then pass index of the byte every part starts from)

Attach the file to the query as a parameter FilePart.

where last parameter is file md5 digest. If the file is successfully uploaded – function returns null or empty line, if not – you will get an error message. If the file was uploaded by parts, this function unites them into one.

You are done!


Search files on 4shared

To search files on 4shared.com you should use the following url

http://search.4shared.com/network/searchXml.jsp

Parameters:

       q - keyword

Example: q=funny cats

       searchExtention - type of file (extension or category)
       

If you need extension just use searchExtention=mid. Remember, if you are using parameter searchExtention you should also use searchmode=3


For searching in direct category use the following:

       category:1 - music
       category:2 - video
       category:3 - photo
       category:4 - archive
       category:6 - program
       category:7 - web documents
       category:8 - mobile applications
       

Example: use searchExtention=category:1 - if you are searching only music.

       sortType - type of sorting
         1 - sort by downloads;
         2 - sort by upload date;
         3 - sort by size;
         4 - sort by name;
       sortOrder - sorting order(Ascending -1, Descending 1)
       start - offset, is used for pagination

start value should be divisible by 10


Usage example:

http://search.4shared.com/network/searchXml.jsp?q=somebody&searchExtention=mid&sortType=3&sortOrder=1&searchmode=3&start=10

Response:

<search-result>
<query>somebody</query> - keyword
<total-files>24</total-files> - number of found files
<page-number>2</page-number> - page number
<pages-total>2</pages-total> - total amount of pages
<start>10</start> - offset
<files-per-page>10</files-per-page> - amount of files per page
<files-approx-count>24</files-approx-count> - approximate number of files (when amount of found files is more than 1,000). If amount of found files is less than 1,000 it equals to <total-files></total-files>
<result-files>
<file>
<name>somebody_to_shove.mid</name> - filename
<description/> - description
<downloads-count>8</downloads-count> - number of downloads
<upload-date-format>hh:mm dd-MM-yyyy</upload-date-format> - upload date format
<upload-date>04:19 19-05-2009</upload-date> - upload date
<url>http://www.4shared.com/audio/qVaKdItF/somebody_to_shove.htm</url> - download page url
<preview-url/> - preview url if exist
<flash-preview-url/>- flash preview url if exist
<user>wym</user> - username
<size>39 KB</size> - file size
</file>
<file>
...
</file>
</result-files>
</search-result>




checkSharedDirAccess

 public int checkSharedDirAccess(java.lang.String login,
                               java.lang.String password,
                               long dirID,
                               java.lang.String dirPassword,
                               java.lang.String userDirPassword)

Checks if directory can be accessed by specified user with specified passwords

Parameters:

       login - is user login
       password - is user password
       dirID - id of the directory to be accessed
       dirPassword - generated password to view contents of not owned folders
       userDirPassword - user specified password 

Returns:

Status.
0 	ok
1 	no such dir
2 	owner inactive
3 	abused dir
4 	incorrect dirPassword
5 	dir is not shared
6 	owner is banned
8 	incorrect userDirPassword

checkSubdomain

 public java.lang.String checkSubdomain(java.lang.String login,
                                      java.lang.String password,
                                      long dirId,
                                      java.lang.String subdomainName)

Checks if subdomain can be set for specified folder

Parameters:

 login - user login
 password - user password
 dirId - id of the directory
 subdomainName - name to be set 

Returns:

 Empty string or null if everything is ok and error message otherwise

createNewFolder

 public long createNewFolder(java.lang.String login,
                           java.lang.String password,
                           long dirID,
                           java.lang.String folderName)

Creates new folder as dirId subfolder

Parameters:

 login - user login
 password - user password
 dirID - id of the directory to create folder in
 folderName - new folder name 

Returns:

 0 - if creation denied, newly created dir ID otherwise 
 -1 - already exists 
 -2 - attempt to create folder in removed parent

createUploadSessionKey

 public java.lang.String createUploadSessionKey(java.lang.String login,
                                              java.lang.String password,
                                              long dirID)

Creates session key for uploading file

Parameters:

 login - user login
 password - user password
 dirID - id of the directory to upload to 

Returns:

 session key

deleteFile

 public void deleteFile(java.lang.String login,
                      java.lang.String password,
                      long fileID)

Removes file to recycle bin or from recycle bin if it is already there

Parameters:

 login - user login
 password - user password
 fileID - id of the file to be removed

deleteFolder

 public void deleteFolder(java.lang.String login,
                        java.lang.String password,
                        long dirID)

Completely removes folder and puts all of it contents to recycle bin

Parameters:

 login - user login
 password - user password
 dirID - id of the directory to be removed

downloadFinished

 public void downloadFinished(java.lang.String login,
                            java.lang.String password,
                            long fileId)

Have to be called after full file download

Parameters:

 login - user login
 password - user password
 fileId - id of the file which was downloaded

getAllFolders

 public com.pmstation.shared.soap.api.AccountItem[] getAllFolders(java.lang.String login,
                                                                java.lang.String password)

Returns all of the folders in user's root directory

Parameters:

 login - user login
 password - user password 

Returns:

 Array of info records about user's root folder subfolders

getAllItems

 public com.pmstation.shared.soap.api.AccountItem[] getAllItems(java.lang.String login,
                                                              java.lang.String password)

Returns info about all items in user's root folder

Parameters:

 login - user login
 password - user password 

Returns:

 Array of info records about user's root folder content

getCurrentUploaderVersion

 public long getCurrentUploaderVersion()

Returns last uploader version. If this increase you should consider to look at online api documentation to check changes. We will try to maintain backward compatibility but this is not guaranteed.

Returns:

 Uploader version

getDirectLink

 public java.lang.String getDirectLink(java.lang.String login,
                                     java.lang.String password,
                                     java.lang.String link)

Returns link to start immediate downloading. Not always possible however, because we are ads-supported mostly. Returns link starting with "http" if ok.

Parameters:

 login - user login
 password - user password
 link - indirect download link

getDirInfo

 public com.pmstation.shared.soap.api.AccountItem getDirInfo(java.lang.String login,
                                                           java.lang.String password,
                                                           long dirID)

Return info about specified folder

Parameters:

 login - user login
 password - user password
 dirID - id of the folder 

Returns:

 folder info

getFileDownloadLink

 public java.lang.String getFileDownloadLink(java.lang.String login,
                                           java.lang.String password,
                                           long fileID)

Returns download link for user owned file

Parameters:

 login - user login
 password - user password
 fileID - id of file to be downloaded 

Returns:

 Download link or empty string if some errors occurs.

getFileInfo

 public com.pmstation.shared.soap.api.AccountItem getFileInfo(java.lang.String login,
                                                            java.lang.String password,
                                                            long fileID)

Returns info about file

Parameters:

 login - user login
 password - user password
 fileID - id of file to get info about 

Returns:

 file info

getFolderSharingProperties

 public com.pmstation.shared.soap.api.SharedFolderProperties[] getFolderSharingProperties(java.lang.String login,
                                                                                        java.lang.String password,
                                                                                        long dirId)

Returns folder sharing properties. Output is two element array: res[0] - actual values. res[1] - properties which can be set for this user is marked as true.

Parameters:

 login - user login
 password - user password
 dirId - id of the folder to properties for 

Returns:

 folder sharing properties

getFreeSpace

 public long getFreeSpace(java.lang.String login,
                        java.lang.String password)

Gets free space left for user

Parameters:

 login - user login
 password - user password 

Returns:

 free space left for user in bytes

getHistory

 public com.pmstation.shared.soap.api.DirHistoryDTO[] getHistory(java.lang.String login,
                                                               java.lang.String password,
                                                               long dirId)

Returns history of operations in specified folder and subfolders. For operation field meanings see getOperationDescriptions()

Parameters:

 login - user login
 password - user password
 dirId - id of folder 

Returns:

 Array of folder changes. May be null or empty

getHistoryFromId

 public com.pmstation.shared.soap.api.DirHistoryDTO[] getHistoryFromId(java.lang.String login,
                                                                     java.lang.String password,
                                                                     long dirId,
                                                                     long fromId)

Returns history of operations which occurs in specified folder and subfolders with history id more then specified. For operation field meanings see getOperationDescriptions()

Parameters:

 login - user login
 password - user password
 dirId - id of folder to take history for
 fromId - id floor of history 

Returns:

 Array of folder changes. May be null or empty

getItemInfo

 public com.pmstation.shared.soap.api.AccountItem getItemInfo(java.lang.String login,
                                                            java.lang.String password,
                                                            long itemID,
                                                            boolean dir)

Common method for getFileInfo(String, String, long) and getDirInfo(String, String, long) distinguished by value of dir parameter

Parameters:

 login - user login
 password - user password
 itemID - id of element
 dir - if true then supplied Id is folder and file otherwise 

Returns:

getItems

 public com.pmstation.shared.soap.api.AccountItem[] getItems(java.lang.String login,
                                                           java.lang.String password,
                                                           long dirID)

Returns array of infos about contents of specified dir.

Parameters:

 login - user login
 password - user password
 dirID - id of folder to list (-1 for root)

Returns:

 Array of info items

getMaxFileSize

 public long getMaxFileSize(java.lang.String login,
                          java.lang.String password)

Return maximum allowed file size for specified user

Parameters:

 login - user login
 password - user password 

Returns:

 maximum allowed file size in bytes

getNewFileDataCenter

 public long getNewFileDataCenter(java.lang.String login,
                                java.lang.String password)

Returns datacenter id to upload files to

Parameters:

 login - user login
 password - user password 

Returns:

 datacenter id to upload new files to

getNotOwnedSizeLimit

 public long getNotOwnedSizeLimit()

Max file size which can be downloaded without speed limit

Returns:

 max file size which can be downloaded without speed limit

getOperationDescriptions

public java.lang.String[] getOperationDescriptions()

Returns array of OperationEnum names. Array index corresponds to values which can be returned as DirHistoryDTO.getOperation(). Array is supposed to be zero-based.

Returns:

 array of OperationEnum names

getRecycleBinItems

 public com.pmstation.shared.soap.api.AccountItem[] getRecycleBinItems(java.lang.String login,
                                                                     java.lang.String password)

Returns info about files in recycle bin

Parameters:

 login - user login
 password - user password 

Returns:

 Array of recycle bin content info items

getSharedDirItems

 public com.pmstation.shared.soap.api.AccountItem[] getSharedDirItems(java.lang.String login,
                                                                    java.lang.String password,
                                                                    long dirID,
                                                                    java.lang.String dirPassword,
                                                                    java.lang.String userDirPassword)

Return content of possibly not owned shared folder

Parameters:

 login - user login
 password - user password
 dirID - id of folder to view
 dirPassword - 4shared generated dir password
 userDirPassword - user set dir password if needed 

Returns:

 content of specified shared folder or null

getSpaceLimit

 public long getSpaceLimit(java.lang.String login,
                         java.lang.String password)

Returns user space limit

Parameters:

 login - user login
 password - user password 

Returns:

 space limit

getUploadFormUrl

public java.lang.String getUploadFormUrl(int dataCenterID,

                                        java.lang.String sessionKey)

Returns url to upload file to.

Parameters:

 dataCenterID - id of datacenter to upload to
 sessionKey - upload session key

hasRightUpload

 public boolean hasRightUpload()

Whether upload feature is on.

Returns:

 whether upload feature is on.

isAccountActive

 public boolean isAccountActive(java.lang.String login,
                              java.lang.String password)

Checks account availability

Parameters:

 login - user login
 password - user password 

Returns:

 true if account is active

isAccountBanned

 public boolean isAccountBanned(java.lang.String login,
                              java.lang.String password)

Checks if user account is banned

Parameters:

 login - user login
 password - user password 

Returns:

 true if user accont is banned

isAccountPremium

 public boolean isAccountPremium(java.lang.String login,
                               java.lang.String password)

Checks if user account is premium

Parameters:

 login - user login
 password - user password 

Returns:

 true of user has premium account

isExistsLoginPassword

 public boolean isExistsLoginPassword(java.lang.String login,
                                    java.lang.String password)

true-false version of login

Parameters:

 login - user login
 password - user password 

Returns:

 true if login was successful

login

 public java.lang.String login(java.lang.String login,
                             java.lang.String password)

Login

Parameters:

 login - user login
 password - user password 

Returns:

 Empty string if all ok, diagnostic message otherwise

markSynchronized

 public void markSynchronized(java.lang.String login,
                            java.lang.String password,
                            long dirId)

Informs 4shared to write folder and subfolders usage history

Parameters:

 login - user login
 password - user password
 dirId - id of folder to write history for

pasteFilesDirs

 public java.lang.String pasteFilesDirs(java.lang.String login,
                                      java.lang.String password,
                                      long toFolderId,
                                      boolean makeCopy,
                                      long[] fileIds,
                                      long[] dirIds)

Copy-pastes or cut-pastes a group of files and dirs. Use this to copy or move a group of files to another directory.

Parameters:

 login - user login
 password - user password
 toFolderId - target folder id
 makeCopy - - exec copy+paste if true, exec cut+paste if false
 fileIds - ids of file to be moved/copied
 dirIds - ids of folders to be moved/copied 

Returns:

 diagnostic message or empty string if all ok

renameFile

 public long renameFile(java.lang.String login,
                      java.lang.String password,
                      long fileID,
                      java.lang.String newName)

Renames specified file

Parameters:

 login - user login
 password - user password
 fileID - id of file to be renamed
 newName - new name of file 

Returns:

 -1 if file exists, 
 0 in case of other failures, 
 fileID if rename was successful

renameFolder

 public long renameFolder(java.lang.String login,
                        java.lang.String password,
                        long dirID,
                        java.lang.String newName)

Renames specified folder

Parameters:

 login - user login
 password - user password
 dirID - id of folder to be renamed
 newName - new name of folder 

Returns:

 -1 if file exists, 
 0 in case of other failures, 
 dirID if rename was successful

restoreFile

 public void restoreFile(java.lang.String login,
                       java.lang.String password,
                       long fileID)

Restores file from Recycle Bin. If folder still exists restores to it, in other cases will restore to special RESTORED FILES folder which will be created if not already exists.

Parameters:

 login - user login
 password - user password
 fileID - id of file to be restored

restoreFiles

 public void restoreFiles(java.lang.String login,
                        java.lang.String password,
                        long[] fileIDs)

Restores group of files from Recycle Bin. If folder still exists restores to it, in other cases will restore to special RESTORED FILES folder which will be created if not already exists.

Parameters:

 login - user login
 password - user password
 fileIDs - Array of file ids to be restored

setFolderSharingProperties

 public java.lang.String setFolderSharingProperties(java.lang.String login,
                                                  java.lang.String password,
                                                  long dirId,
                                                  com.pmstation.shared.soap.api.SharedFolderProperties folderProperties)

Sets folder sharing properties

Parameters:

 login - user login
 password - user password
 dirId - id of folder to set properties for
 folderProperties - new properties values 

Returns:

 Diagnostic message or empty string if all is ok

signup

 public java.lang.String signup(java.lang.String login,
                              java.lang.String password)

Creates new User and sends confirmation email.

Parameters:

 login - desired login
 password - password 

Returns:

 error message if any. Empty string if all ok.

syncFinished

 public void syncFinished(java.lang.String login,
                        java.lang.String password,
                        long fileId)

Should be called in the end of each sync operation

Parameters:

 login - user login
 password - user password
 fileId - which file was synced. -1 if not applicable

uploadCancelFile

 public void uploadCancelFile(java.lang.String login,
                            java.lang.String password,
                            long fileId)

Call if upload was canceled

Parameters:

 login - user login
 password - user password
 fileId - id of file which upload is canceling

uploadFinishFile

 public java.lang.String uploadFinishFile(java.lang.String login,
                                        java.lang.String password,
                                        long fileId,
                                        java.lang.String md5)

Complete resumable upload

Parameters:

 login - user login
 password - user password
 fileId - returned from initial call to uploadStartFile() - existing file in 'being uploaded by parts' state
 md5 - original file MD5 to verify file consistency at server side 

Returns:

 empty string if success or error message

uploadStartedFileExists

 public boolean uploadStartedFileExists(java.lang.String login,
                                      java.lang.String password,
                                      long fileId)

Checks if file was partially uploaded

Parameters:

 login - user login
 password - user password
 fileId - id of file to be checked 

Returns:

 true if there is part of file already uploaded.

uploadStartFile

 public long uploadStartFile(java.lang.String login,
                           java.lang.String password,
                           long dirID,
                           java.lang.String name,
                           long fullSize)

Resumable upload - start

Parameters:

 dirID - (-1) means upload to user's root dir 

Returns:

 fileId to pass as parameter in all subsequent partial uploads

uploadStartFileUpdate

 public long uploadStartFileUpdate(java.lang.String login,
                                 java.lang.String password,
                                 long updateFileId,
                                 java.lang.String name,
                                 long fullSize)

Update file

Parameters:

 login - user login
 password - user password
 updateFileId - it of original file to be updated
 name - empty string means don't change existing name
 fullSize - 

Returns:

 id of temporary file uploading of which will cause update of original file