MediaWiki API result

This is the HTML representation of the JSON format. HTML is good for debugging, but is unsuitable for application use.

Specify the format parameter to change the output format. To see the non-HTML representation of the JSON format, set format=json.

See the complete documentation, or the API help for more information.

{
    "warnings": {
        "query": {
            "*": "Formatting of continuation data has changed. To receive raw query-continue data, use the 'rawcontinue' parameter. To silence this warning, pass an empty string for 'continue' in the initial query."
        }
    },
    "batchcomplete": "",
    "continue": {
        "gapcontinue": "Screenshot_of_account_settings.",
        "continue": "gapcontinue||"
    },
    "query": {
        "pages": {
            "100": {
                "pageid": 100,
                "ns": 0,
                "title": "SOAP API",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "== Welcome to 4shared SOAP API documentation! ==\n\n'''Dear developer!'''\n\nWe 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. \n\nYou 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.\n\n4shared 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.\n\nEvery month we will pick best app with 4shared API (the more inserted key 4shared functions, the better) and award developer \nfor $5,000! We pay $5,000/month for best app.\n\n__TOC__\n\n== Sources ==\n\n'''4shared Project at google''' \n[http://code.google.com/p/4shared-api code.google.com]\n\nWSDL can be obtained from [http://api.4shared.com/jax2/DesktopApp?wsdl here] or please check [https://api.4shared.com/jax2/DesktopApp?wsdl here] for more secure SOAPing.\n\nYou 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.\n\n== Quick start guide ==\n\nTo 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.\n\n1. Get sources from google.code.com:\n  hg clone https://4shared-api.googlecode.com/hg/ 4shared-api\n2. Go to created folder and build project:\n  ant\n3. Try to use some of provided examples:\n  cd dist/demo\n  ./signup <username> <password>\n  ./createfolder <username> <password> <foldername>\n  ./upload <username> <password> <path to file>\n  ./browse <login> <password>\n4. Learn how this demos have been written. All demo sources are situated in demo/com/pmstation/shared/soap/demo\n\n5. Write your own fresh and brilliant application\n\n6.''' Important! You must include the following into the app''':\n\n'''Check the simple example:'''\n\nlet's have the user app_name_test have password 1,\n\nwhere app_name - is the name of your application.\n\nuser enters his credentials as: \n\n'''login:''' \"app_name_test \"\n\n'''password:''' \"1\"\n\nYou should silently add designator for your to user provided password.\n\nSo, you will send:\n\nlogin: \"app_name_test \"\n\npassword: \"!!!app_name!!:1\"\n\nfor any function, which needs password.\n\n== Samples ==\n\n'''Java:'''\n\n[http://4shared-api.googlecode.com/svn/trunk/java/demo/src/com/pmstation/api/demo/CreateFolderDemo.java CreateFolderDemo.java]\n\n[http://4shared-api.googlecode.com/svn/trunk/java/demo/src/com/pmstation/api/demo/DeleteFileDemo.java DeleteFileDemo.java]\n\n[http://4shared-api.googlecode.com/svn/trunk/java/demo/src/com/pmstation/api/demo/Demo.java Demo.java]\n\n[http://4shared-api.googlecode.com/svn/trunk/java/demo/src/com/pmstation/api/demo/DownloadDemo.java DownloadDemo.java]\n\n[http://4shared-api.googlecode.com/svn/trunk/java/demo/src/com/pmstation/api/demo/EnumerateItemsDemo.java EnumerateItemsDemo.java]\n\n[http://4shared-api.googlecode.com/svn/trunk/java/demo/src/com/pmstation/api/demo/EnumerateItemsDemo2.java EnumerateItemsDemo2.java]\n\n[http://4shared-api.googlecode.com/svn/trunk/java/demo/src/com/pmstation/api/demo/LoginDemo.java LoginDemo.java]\n\n[http://4shared-api.googlecode.com/svn/trunk/java/demo/src/com/pmstation/api/demo/RecycleBinDemo.java RecycleBinDemo.java]\n\n[http://4shared-api.googlecode.com/svn/trunk/java/demo/src/com/pmstation/api/demo/RenameDemo.java RenameDemo.java]\n\n[http://4shared-api.googlecode.com/svn/trunk/java/demo/src/com/pmstation/api/demo/SignupDemo.java SignupDemo.java] \n\n[http://4shared-api.googlecode.com/svn/trunk/java/demo/src/com/pmstation/api/demo/StringUtils.java StringUtils.java]\n\n[http://4shared-api.googlecode.com/svn/trunk/java/demo/src/com/pmstation/api/demo/UploadDemo.java UploadDemo.java]\n---- \n=== iOS ===\n\n----\n\nEvery application in iOS can use 4shared service. The client can interact with 4shared server via SOAP protocol, by means of calling up 4shared API functions. These functions may be used to request for the content of your account, get the necessary links to files, and edit the file structure and the directory properties on the server. The full description of the api is provided here (link to http://help.4shared.com/index.php/SOAP_API). The SOAP-protocol may be checked here (link to http://en.wikipedia.org/wiki/SOAP).\n\nTo call up 4shared api-function, it\u2019s necessary to send the XML-message to server http://api.4shared.com/jax2/DesktopApp SOAP. \n\n'''The common template for the message is the following:''' \n\n<pre>\n|<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" <br>xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n\t<soapenv:Body>\n\n\t\t<function xmlns=\"http://api.soap.shared.pmstation.com/\">\n\t\t\t<arg0 xmlns=\"\">login</arg0>\n\t\t\t<arg1 xmlns=\"\">password</arg1>\n\t\t\t<arg2 xmlns=\"\">arg1</arg2>\n\t\t\t...\n\t\t</function>\n\t</soapenv:Body>\n</soapenv:Envelope>\" ,where \u201cfunction\u201d is the name of the called function.\n</pre>\n\nHaving indicated the function, one should enlist its arguments. There\u2019re only 2 arguments in almost all 4shared api-functions \u2013 these are login and password.\n \nIn response to the call, 4shared server will return the results of the function, '''the SOAP-message in XML-format''':\n\n<pre><S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\n\t<S:Body>\n\t\t<ns2:functionResponse xmlns:ns2=\"http://api.soap.shared.pmstation.com/\">\n\t\t\t<return>\n\t\t\t\tresult\n\t\t\t</return>\n\t\t</ns2: functionResponse>\n\t</S:Body>\n</S:Envelope> , where \u201cresult\u201d is the result of calling up the \u201cfunction\u201d.</pre>\n\nAs an example, we need to get the content of the directory. \nTo do this, we need to call the function \u201cgetItems\u201d (link to http://help.4shared.com/index.php/SOAP_API#getItems).\n\nIts first 2 arguments are, as usual, login and password. The 3rd one is the ID of the requested directory. \n\nThe '''body of the relative SOAP-message''' will be as follows:\n\n<pre><getItems xmlns=\"http://api.soap.shared.pmstation.com/\">\n\t<arg0 xmlns=\"\">username@server.com</arg0>\n\t<arg1 xmlns=\"\">*********</arg1>\n\t<arg2 xmlns=\"\">123456789</arg2>\n</getItems>\n</pre>\n\nIn response, 4shared server will return '''the array with the elements of directory''': \n<pre>\n<item>\n\t<date>(date of file creation)</date>\n\t<directory>(true \u2013 if file is a directory, otherwise - false)</directory>\n\t<downloadCount>(the number of file downloads)</downloadCount>\n\t<downloadLink>(link for the file-download from 4shared-server)</downloadLink>\n\t<id>(file ID)</id>\n\t<md5>(md5-hash)</md5>\n\t<name>(name)</name>\n\t<parentId>(parent directory ID)</parentId>\n\t<size>(size)</size>\n\t\u2026\n</item>\n</pre>\n\nLet\u2019s consider the example of the simple application, which allows the user to browse the content of his/her account. \n\nThe 1st thing, which should be done, when starting the program, is to authorize (login) on 4shared server by means of calling up the function \u201clogin\u201d (link to http://help.4shared.com/index.php/SOAP_API#login ). \n\nIf authorization is passed successfully, the next step will be the request for the root account directory by means of calling up the function \u201cgetRoot\u201d (link to http://help.4shared.com/index.php/SOAP_API#getRoot). The calling result will be the structure \u201citem\u201d, described above.\n\nTo store received information, I\u2019ve created '''subclass File''':\n\n<pre>\n@interface File : NSObject\n{\n\tNSUInteger _id;\n\tNSUInteger _parentId;\n\tNSString *_name;\n\tNSUInteger _size;\n\tNSString *_link;\n\tBOOL _dir;\n    \n\tNSArray *_content;\n}\n\n\u2026\n\n@end\n</pre>\n\nNow that we have the root directory ID, we can use the function \u201cgetItems\u201d, to get its content, and then the content of any subdirectory. \n\nTo create the XML-formatted message and the parsing of received result, it\u2019s possible to use any XML \u2013 parser. \nIn the demo-sample, I\u2019ve used GDataXML-parser from Google Data APIs Objective-C Client Library\nhttp://code.google.com/p/gdata-objectivec-client/). \n\n'''The function to generate the message''' may be as follows: \n<pre>\n+ (NSURLRequest*)soapRequestWithFunction:(NSString*)function andParams:(NSArray*)params\n{\n   \tGDataXMLElement *xmlFunction = [GDataXMLNode elementWithName:function];\n\tGDataXMLNode *xmlNS = [GDataXMLNode namespaceWithName:nil stringValue:@\"http://api.soap.shared.pmstation.com/\"];\n\t[xmlFunction addNamespace:xmlNS];\n\t\n\tfor (NSUInteger i = 0; i < [params count]; i++)\n\t{\n\t\tNSString *elementName = [NSString stringWithFormat:@\"arg%lu\", i];\n\t\tGDataXMLElement *arg = [GDataXMLNode elementWithName:elementName];\n\t\tNSString *param = (NSString*)[params objectAtIndex:i];\n\t\t[arg setStringValue:(NSString*) param];\n\t\tGDataXMLNode *attrib = [GDataXMLNode attributeWithName:@\"xmlns\" stringValue:@\"\"];\n\t\t[arg addAttribute:attrib];\n\t\t[xmlFunction addChild:arg];\n\t}\n    \n\tGDataXMLElement *body = [GDataXMLNode elementWithName:@\"soapenv:Body\"];\n\t[body addChild:xmlFunction];\n\t\n\tGDataXMLElement *soapEnvelope = [GDataXMLNode elementWithName:@\"soapenv:Envelope\"];\n\tGDataXMLNode *soapNS1 = [GDataXMLNode namespaceWithName:@\"soapenv\" stringValue:@\"http://schemas.xmlsoap.org/soap/envelope/\"];\n\tGDataXMLNode *soapNS2 = [GDataXMLNode namespaceWithName:@\"xsd\" stringValue:@\"http://www.w3.org/2001/XMLSchema\"];\n\tGDataXMLNode *soapNS3 = [GDataXMLNode namespaceWithName:@\"xsi\" stringValue:@\"http://www.w3.org/2001/XMLSchema-instance\"];\n\t[soapEnvelope setNamespaces:[NSArray arrayWithObjects:soapNS1, soapNS2, soapNS3, nil]];\n\t[soapEnvelope addChild:body];\n\t\n\tGDataXMLDocument *doc = [[GDataXMLDocument alloc] initWithRootElement:soapEnvelope];\n\t[doc setVersion:@\"1.0\"];\n\t[doc setCharacterEncoding:@\"UTF-8\"];\n\tNSData *data = [doc XMLData];\n\t[doc release];\n\tNSString *dataLen = [NSString stringWithFormat:@\"%lu\", [data length]];\n\t\n\tNSURL *url = [NSURL URLWithString:@\"http://api.4shared.com/jax2/DesktopApp\"];\n\tNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];\n\t[request addValue:@\"text/xml; charset=utf-8\" forHTTPHeaderField:@\"Content-Type\"];\n\t[request addValue:@\"\" forHTTPHeaderField:@\"SOAPAction\"];\n\t[request addValue:dataLen forHTTPHeaderField:@\"Content-Length\"];\n\t[request setHTTPMethod:@\"POST\"];\n\t[request setHTTPBody: data];\n\t\n\treturn request;\n}\n</pre>\n\nThe content of the directory is shown in the table (class FilesViewController). \nI show its '''name and size in the cell''', related to the file accordingly:\n\n<pre>\n- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath\n{\n\t\u2026\n\tcell.accessoryType = file.isDir ? UITableViewCellAccessoryDisclosureIndicator : UITableViewCellAccessoryNone;\n\tcell.imageView.image = file.isDir ? [UIImage imageNamed:@\"dir.png\"] : nil;\n\tcell.textLabel.text = file.name;\n\tcell.detailTextLabel.text = file.isFile ? [NSString stringWithFormat:@\"%.2f Kb\", (CGFloat) file.size / 1024.0] : nil;\n\t\u2026\n}\n</pre>\n\nAll content is opened via tap in the cell with directory. \nThe page with the following link is opened in the browser via tap on the file: \n\n<pre>\n- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath\n{\n\t\u2026\n\tif (file.isDir)\n\t{\n\t\tFilesViewController *fvc = [[FilesViewController alloc] initWithFile:file];\n\t        [self.navigationController pushViewController:fvc animated:YES];\n        \t[fvc release];\n\t}\n\telse\n\t{\n        \t[[UIApplication sharedApplication] openURL:[NSURL URLWithString:file.link]];\n\t}\n\t\u2026\n}\n\n</pre>\n\nThe demo-sample can be downloaded here (http://dc243.4shared.com/download/ecV5Tw4I/ios_samples.zip). \n\nTo start the sample application, enter demo-Prefix.pch in the file, enter your login and password from the site 4shared (macros LOGIN and PASSWORD).\n----\n\n=== Symbian (QT) ===\n\n----\n\nEvery application can interact with 4shared server via SOAP protocol, by means of calling up 4shared API functions. \n\nThese functions may be used to request for the content of your account, get the necessary links to files, and edit the file structure and the directory properties on the server. \n\n'''The full description of the api is provided here''' (link to http://help.4shared.com/index.php/SOAP_API). \n\n'''The SOAP-protocol may be checked here''' (link to http://en.wikipedia.org/wiki/SOAP).\n\nAs an SDK for creating applications for mobile devices, let\u2019s take \"Nokia Qt SDK 1.0\", which can be got here (http://www.forum.nokia.com/Develop/Qt/). This package also includes IDE \"Qt Creator\", which we will use.\n\nIn the beginning, let\u2019s create the new project with type \u201c'''Mobile application Qt'''\u201d and name it 4shared. \nIn the visual editor we\u2019ll add \u201cList widget\u201d in the main window, which will include the elements of the root catalogue, downloaded from 4shared server. In the class MainWindow constructor, in a line\n\n-\nsetCentralWidget(ui->listWidget);\n-\nstretch listWidget to the full screen.\n\n\nTo work with SOAP protocol in a more convenient way, we\u2019ll take initial codes from the library QtSOAP and insert them into the project, as this library isn\u2019t included into mobile version. \n\nIn addition to that, in order to make the application work with network in Symbian devices, it\u2019s necessary to '''add the following line in the file 4shared.pro''' in the part, devoted to the specific Symbian settings:\n<pre>\n-\nSymbian {\n\t...\n\tTARGET.CAPABILITY += NetworkServices\n\t...\n}\n-\n</pre>\n\nThen, we\u2019ll '''add and initialize members in class MainWindow'''''':\n<pre>\n-\nclass MainWindow : public QMainWindow\n{\n\t...\n    QNetworkAccessManager nam;\n    QtSoapHttpTransport http;\n\t...\n};\n\nMainWindow::MainWindow(QWidget *parent) :\n\t...\n    nam(this),\n    http(this),\n\t...\n{\n\t...\n    connect(&http, SIGNAL(responseReady()), SLOT(getResponse()));\n\n    http.setNetworkAccessManager(&nam);\n    http.setAction(\"\");\n    http.setHost(\"api.4shared.com\", 80);\n\t...\n}\n-\n,which realize (implement) the transfer of our future requests. \n</pre>\n\nThe slot getResponse() will be invoked, when the answers to our requests are received. \n\n\n'''To download the list of files and subdirectories''' of the root directory, it\u2019s necessary to perform 3 requests in series:\n\n1. isExistsLoginPassword - authentication\n\n2. getRoot \u2013 receipt of information about the root directory \n\n3. getItems \u2013 receipt of the list of elements in the defined directory (in our case \u2013 root directory )\n<pre>\n-\nclass MainWindow : public QMainWindow\n{\n\t...\nprivate slots:\n    void getResponse();\n\nprivate:\n    QtSoapMessage initStdSoapMessage(const QString &methodName);\n\n    void authorize();\n    void authorizeHandler(const QtSoapType &res);\n\n    void getRoot();\n    void getRootHandler(const QtSoapType &res);\n\n    void getItems(long id);\n    void getItemsHandler(const QtSoapType &res);\n\n    enum Operation {unknown, authorize_op, getRoot_op, getItems_op};\n\nprivate:\n\t...\n\n    Operation operation;\n\n    QString login, password;\n\n    long rootId;\n};\n\nvoid MainWindow::getResponse()\n{\n    Operation op = operation;\n    operation = unknown;\n\n    // Get the response, check for error.\n    const QtSoapMessage &resp = http.getResponse();\n    if(resp.isFault()) {\n        QMessageBox::warning(NULL, \"Warning\", \"SOAP: query failed (\" + resp.faultString().value().toString() + \")\");\n        return;\n    }\n\n    // Extract the return value from this method response, check for errors.\n    const QtSoapType &res = resp.returnValue();\n    if(!res.isValid()) {\n        QMessageBox::warning(NULL, \"Warning\", \"SOAP: invalid return value\");\n        return;\n    }\n\n    switch(op)\n    {\n    case authorize_op:\n        authorizeHandler(res);\n        break;\n    case getRoot_op:\n        getRootHandler(res);\n        break;\n    case getItems_op:\n        getItemsHandler(res);\n        break;\n    case unknown:\n        break;\n    }\n}\n\nQtSoapMessage MainWindow::initStdSoapMessage(const QString &methodName)\n{\n    QtSoapMessage request;\n    request.setMethod(QtSoapQName(methodName, \"http://api.soap.shared.pmstation.com/\"));\n    request.addMethodArgument(\"arg0\", \"\", login);\n    request.addMethodArgument(\"arg1\", \"\", password);\n    return request;\n}\n\nvoid MainWindow::authorize()\n{\n    QtSoapMessage request = initStdSoapMessage(\"isExistsLoginPassword\");\n    operation = authorize_op;\n    http.submitRequest(request, \"/jax2/DesktopApp\");\n}\n\nvoid MainWindow::authorizeHandler(const QtSoapType &res)\n{\n    bool auth = res.value().toBool();\n    if(auth)\n    {\n       // QMessageBox::information(NULL, \"Authorization\", \"Authorized\");\n        getRoot();\n    }\n    else\n        QMessageBox::warning(NULL, \"Warning\", \"Invalid user name or password\");\n}\n\nvoid MainWindow::getRoot()\n{\n    QtSoapMessage request = initStdSoapMessage(\"getRoot\");\n    operation = getRoot_op;\n    http.submitRequest(request, \"/jax2/DesktopApp\");\n}\n\nvoid MainWindow::getRootHandler(const QtSoapType &res)\n{\n    rootId = res[\"id\"].toInt();\n    getItems(rootId);\n}\n\nvoid MainWindow::getItems(long id)\n{\n    QtSoapMessage request = initStdSoapMessage(\"getItems\");\n    request.addMethodArgument(\"arg2\", \"\", id);\n    operation = getItems_op;\n    http.submitRequest(request, \"/jax2/DesktopApp\");\n}\n\nvoid MainWindow::getItemsHandler(const QtSoapType &res)\n{\n    for(int i=0; i<res.count(); i++)\n    {\n        const QtSoapType &item = res[i];\n\n        if(item[\"removed\"].toBool())\n            continue;\n\n        QString name;\n        if(item[\"directory\"].toBool())\n            name = \" <dir> \";\n        name += item[\"name\"].toString();\n\n        QListWidgetItem *itm = new QListWidgetItem(name);\n        itm->setSizeHint(QSize(0, 50));\n        ui->listWidget->addItem(itm);\n    }\n}\n-\n\n</pre>\n\nDemo-sample can be downloaded here (http://dc243.4shared.com/download/bFbwuFVS/symbian_Qt_example.zip). \n\n'''To start the sample application''', insert your login and password from 4shared in the file MainWindow.cpp (variable login and password).\n\n----\n\n=== Android ===\n\n----\n\n\n1. '''4shared API.''' \n\n\nService 4shared is a usual web-service, '''WSDL description''' of which is here: https://api.4shared.com/jax2/DesktopApp?wsdl. \n\nYou can '''read more about web-services and WSDL'''''' here: http://ru.wikipedia.org/wiki/%D0%92%D0%B5%D0%B1-%D1%81%D0%BB%D1%83%D0%B6%D0%B1%D0%B0, http://ru.wikipedia.org/wiki/WSDL. \n\n'''Short description of API functions''' can found here:  http://help.4shared.com/index.php/SOAP_API. \n\nTo work with SOAP API, you can use direct SOAP-calling, but it\u2019s more convenient to use another library for request parsing. \nFor instance, you can use '''free library''': (http://code.google.com/p/ksoap2-android/).\n\n\n'''2. Tools for Development.'''\n\n\nDevelopment of applications for Android is possible on any platform, which allows Andrid SDK setup. \n'''System requirements''' can be checked here: http://developer.android.com/sdk/requirements.html.\n\nYou can '''download Android SDK''' here: http://developer.android.com/sdk/index.html, setup instructions are available here: http://developer.android.com/sdk/installing.html.\n\nThe recommended '''environment for development''' is Eclipse (http://www.eclipse.org/downloads/) with the plugin for Android (http://developer.android.com/sdk/eclipse-adt.html). \nAny device with OS Android, or an emulator of the device, included into Android SDK, is suitable for starting the developed application. \n\n'''Detailed instruction for beginners''' in app development can be found here: http://developer.android.com/guide/developing/index.html.\n\n\n'''3. Step-by-Step Instruction.'''\n\n\nResource http://developer.android.com comprises''' all necessary information''' for developers. \n\n'''The most essential (fundamental) notions''' are described in the article: http://developer.android.com/guide/topics/fundamentals.html.\n\n'''Step-by-step instruction''' of the simple app for 4shared is displayed below. \n\n1) Install a Platform (http://developer.android.com/resources/tutorials/hello-world.html)\n\n2) Create an AVD (http://developer.android.com/resources/tutorials/hello-world.html)\n\n3) Create a New Android Project (http://developer.android.com/resources/tutorials/hello-world.html)\n\n[[Image:Image1.png]]\n\n4) To insert changes, needed to make the minimum 4shared-application work \n\nTo link the ksoap2 library to the project, it\u2019s necessary to create subcatalog libs in the catalogue Hello4shared and place jar-archive of this library there. Then, choose Project > Options in menu Eclipse, and after that select subsection Java Build Path and tab Libraries. Press the button '''Add JARs''' and display the path to the library. \n     \n[[Image:Image2.png]]\n\nWith the help of menu File > New > Class, let\u2019s''' create 2 subclasses''': '''AccountItem''', representing the user\u2019s file or catalogue on 4shared server, and '''ForSharedService''', with the help of which 4shared API remote methods are called up.\n\n'''AccountItem''' is used to desereal data from the network and provides convenient methods to receive information about the file/catalogue, for example, '''getName()''' and  '''getDownloadLink()''' return the filename and the download link accordingly. \n\n<pre>\n    package com.example.hello4shared;\n\n    import org.ksoap2.serialization.SoapPrimitive;\n\n    /**\n     * 4shared account item, representing a file or a directory description data.\n     * Implementation includes network serialization functionality.\n     */\n    public class AccountItem {\n\tprivate long id;\n\tprivate String name;\n\tprivate boolean directory;\n\n\tpublic AccountItem() {\n\t}\n\n\tpublic long getId() {\n\t    return id;\n\t}\n\n\tpublic String getName() {\n\t    return name;\n\t}\n\n\tpublic boolean isDirectory() {\n\t    return directory;\n\t}\n\n\tpublic String toString() {\n\t    return directory ? \"[\" + name + \"]\" : name;\n\t}\n\n\tpublic void setProperty(String propName, Object value) {\n\t    if (value == null) {\n\t\treturn;\n\t    }\n\t    if (value instanceof SoapPrimitive) {\n\t\tvalue = ((SoapPrimitive) value).toString();\n\t    }\n\n\t    if (propName.equals(\"id\")) {\n\t\tif (value instanceof Long)\n\t\t    id = ((Long) value).longValue();\n\t\telse\n\t\t    id = Long.parseLong(value.toString());\n\t    }\n\t    if (propName.equals(\"directory\")) {\n\t\tdirectory = convertBoolean(value);\n\t    }\n\t    else if (propName.equals(\"name\")) {\n\t\tname = convertString(value);\n\t    }\n\t}\n\n\tprivate boolean convertBoolean(Object val) {\n\t    if (val == null)\n\t\treturn false;\n\n\t    if (val.toString().toLowerCase().equals(\"true\"))\n\t\treturn true;\n\t    else\n\t\treturn false;\n\t}\n\n\tprivate String convertString(Object str) {\n\t    if (!(str instanceof String))\n\t\treturn null;\n\n\t    if (((String) str).equals(\"String{}\"))\n\t\treturn \"\";\n\t    else\n\t\treturn (String) str;\n\t}\n    }\n</pre>\n\n'''ForSharedService''' is the interlayer for the convenient call of remote methods and hides the code of interaction with technology SOAP. \n\n<pre>\n    package com.example.hello4shared;\n\n    import org.ksoap2.SoapEnvelope;\n    import org.ksoap2.serialization.PropertyInfo;\n    import org.ksoap2.serialization.SoapObject;\n    import org.ksoap2.serialization.SoapSerializationEnvelope;\n    import org.ksoap2.transport.AndroidHttpTransport;\n    import org.ksoap2.transport.Transport;\n\n    import java.util.Hashtable;\n    import java.util.Vector;\n\n    /**\n     * 4shared API local layer\n     */\n    public class ForSharedService {\n\tprivate String mUsername;\n\tprivate String mPassword;\n\tprivate static final String SERVICE_URL = \"http://api.4shared.com/jax2/DesktopApp\";\n\tprivate static final String SERVICE_NAMESPACE = \"http://api.soap.shared.pmstation.com/\";\n\n\t/**\n\t * Constructs this object for an account\n\t * @param username Username of the account\n\t * @param password Password of the account\n\t */\n\tpublic ForSharedService(String username, String password) {\n\t    mUsername = username;\n\t    mPassword = password;\n\t}\n\n\t/**\n\t * Login with current account\n\t */\n\tpublic void login() throws Exception {\n\t    String methodName = \"login\";\n\t    SoapObject rpc = getRpc(methodName);\n\t    SoapSerializationEnvelope envelope = getEnvelope(rpc);\n\t    Transport ht = getHttpTransport();\n\n\t    String result;\n\n\t    ht.call(SERVICE_URL + \"/\" + methodName, envelope);\n\t    result = (envelope.getResponse()).toString();\n\n\t    if (!isEmptyString(result))\n\t\tthrow new Exception(result);\n\t}\n\n\t/**\n\t * Get account's root folder\n\t * @return Item representing the root directory\n\t */\n\tpublic AccountItem getRoot() throws Exception {\n\t    String soapAction = SERVICE_URL + \"/getRoot\";\n\n\t    SoapObject rpc = getRpc(\"getRoot\");\n\t    SoapSerializationEnvelope envelope = getEnvelope(rpc);\n\t    Transport ht = getHttpTransport();\n\n\t    ht.call(soapAction, envelope);\n\t    return getAccountItem((SoapObject) envelope.getResponse());\n\t}\n\n\t/**\n\t * Get contents of a directory\n\t * @param dirId Directory's identifier\n\t * @return Array of items representing contents of the directory\n\t */\n\tpublic AccountItem[] getItems(long dirId) throws Exception {\n\t    String methodName = \"getItems\";\n\n\t    SoapObject rpc = getRpc(methodName);\n\t    rpc.addProperty(\"arg2\", new Long(dirId));\n\t    SoapSerializationEnvelope envelope = getEnvelope(rpc);\n\n\t    Transport ht = getHttpTransport();\n\n\t    ht.call(SERVICE_URL + \"/\" + methodName, envelope);\n\t    Object result = envelope.getResponse();\n\n\t    return getAccountItems(result);\n\t}\n\n\tprivate Transport getHttpTransport() {\n\t    Transport ht = new AndroidHttpTransport(SERVICE_URL);\n\t    ht.setXmlVersionTag(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\");\n\t    ht.debug = true;\n\n\t    return ht;\n\t}\n\n\tprivate SoapObject getRpc(String methodName) {\n\t    SoapObject rpc = new SoapObject(SERVICE_NAMESPACE, methodName);\n\t    rpc.addProperty(\"arg0\", mUsername);\n\t    rpc.addProperty(\"arg1\", mPassword);\n\n\t    return rpc;\n\t}\n\n\tprivate SoapSerializationEnvelope getEnvelope(SoapObject rpc) {\n\t    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);\n\n\t    envelope.bodyOut = rpc;\n\t    envelope.encodingStyle = SoapSerializationEnvelope.XSD;\n\n\t    return envelope;\n\t}\n\n\tprivate AccountItem getAccountItem(SoapObject item) {\n\t    return deserialize(new AccountItem(), item);\n\t}\n\n\t@SuppressWarnings(\"unchecked\")\n\tprivate AccountItem[] getAccountItems(Object response) {\n\t    if (response == null)\n\t\treturn null;\n\n\t    if (!(response instanceof SoapObject))\n\t\treturn null;\n\n\t    Vector items = new Vector();\n\n\t    for (int i = 0; i < ((SoapObject) response).getPropertyCount(); i++) {\n\t\tObject item = ((SoapObject) response).getProperty(i);\n\t\tif (item instanceof SoapObject) {\n\t\t    items.addElement(deserialize(new AccountItem(), (SoapObject) item));\n\t\t}\n\t    }\n\n\t    AccountItem[] accountItems = new AccountItem[items.size()];\n\t    items.copyInto(accountItems);\n\n\t    return accountItems;\n\t}\n\n\t@SuppressWarnings( {\n\t\t\"unchecked\", \"deprecation\"\n\t})\n\tprivate AccountItem deserialize(AccountItem newItem, SoapObject item) {\n\t    Hashtable ht = new Hashtable();\n\t    PropertyInfo propInfo = new PropertyInfo();\n\t    for (int n = 0; n < item.getPropertyCount(); n++) {\n\t\titem.getPropertyInfo(n, ht, propInfo);\n\t\tnewItem.setProperty(propInfo.name, item.getProperty(n));\n\t    }\n\n\t    return newItem;\n\t}\n\n\tprivate static boolean isEmptyString(String string) {\n\t    return (string == null || string.equals(\"\")\n\t\t   || string.toLowerCase().equals(\"string{}\")\n\t\t   || string.toLowerCase().equals(\"anytype{}\"));\n\t}\n    }\n\n</pre>\n\nThe classes '''SoapObject, SoapSerializationEnvelope, AndroidHttpTransport''' \u2013 are included into the library ksoap2. \n\n'''SoapObject, SoapSerializationEnvelope''' serve to parse soap-requests, whereas '''AndroidHttpTransport''' provides transport to call up the requests. \n\nThe call up of the function itself is realized by the method '''call ()''', of the class AndroidHttpTransport. \n\nThe service\u2019s answer can be received by means of calling up the method '''getResponse()''' of the class SoapSerializationEnvelope. \n\nThe functions, transferred to the service, are defined by calling up the method '''addProperty''' of the class SoapObject as a pair \u201cparameter name - value\u201d.\n\nLet\u2019s create a window (activity) to display the list of user\u2019s files and catalogues from 4shared server. \n\nTo do that, let\u2019s create the new class (File > New > Class), derivative from ListActivity, in Eclipse environment, and call it AccountContents.\n       \n\nLet\u2019s '''edit AccountContents.java''', by redefining the method '''onCreate''', called up by means of initializing the window (activity).\n\n<pre>\n\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        \n        // Use a ListAdapter that will map an array of account's root folder items to TextViews\n        setListAdapter(new ArrayAdapter<AccountItem>(this,\n                android.R.layout.simple_list_item_1, Hello4shared.rootContents));\n    }\n</pre>\n\nThe class '''ArrayAdapter''' establishes accordance (correspondence) between the list elements of the user\u2019s interface and the list of files and catalogues on 4shared server, which will be uploaded into the static variable rootContents of the class Hello4shared.\n\nIn the method '''onCreate''' of the main window (activity) of the application, the code of which is in the file Hello4shared.java, let\u2019s '''create the elements of the user\u2019s interface''' for insertion and transfer of the user\u2019s name (login) and 4shared account password to the server.\n\n<pre>\n    public void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        \n        // Prepare vertical linear layout\n        LinearLayout mainLayout = new LinearLayout(this);\n        mainLayout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));\n        mainLayout.setOrientation(LinearLayout.VERTICAL);\n        \n        // Create views\n        TextView loginView = new TextView(this);\n        loginView.setText(\"login:\");\n        TextView passwordView = new TextView(this);\n        passwordView.setText(\"password:\");\n        \n        final EditText loginEdit = new EditText(this);\n        final EditText passwordEdit = new EditText(this);\n        passwordEdit.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);\n        \n        Button loginButton = new Button(this);\n        loginButton.setText(\"Submit\");\n        loginButton.setOnClickListener(new OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                String username = loginEdit.getText().toString();\n                String password = passwordEdit.getText().toString();\n                \n                // If username and password entered correctly\n                if (username.length() != 0 && password.length() != 0) {\n                    // Start login procedure\n                    login(username, password);\n                }\n            }\n        });\n        \n        // Add views to layout\n        mainLayout.addView(loginView);\n        mainLayout.addView(loginEdit);\n        mainLayout.addView(passwordView);\n        mainLayout.addView(passwordEdit);\n        mainLayout.addView(loginButton);\n        \n        // Set the layout as activity main layout\n        setContentView(mainLayout);\n    }\n\n</pre>\n\nThe handler of the press-button '''loginButton''' checks the properness of inserted data and, if succeeds, calls up the method '''login ()''', which starts the process of checking the user\u2019s data on 4shared server, and also '''requests the list of files and catalogues''' of the account root catalogue. \n\n<pre>\n\n    private void login(final String username, final String password) {\n        mProgressDialog = ProgressDialog.show(this, \"\", \"Please wait...\", true);\n        mProgressDialog.setCancelable(false);\n        \n        // We should call network calls on separate thread not to freeze the application UI\n        new Thread() {\n            @Override\n            public void run() {\n                // Create 4shared API local layer to call remote methods\n                ForSharedService fss = new ForSharedService(username, password);\n                try {\n                    // Call login procedure\n                    fss.login();\n                    // Get account's root folder\n                    AccountItem rootItem = fss.getRoot();\n                    // Request contents of the root folder\n                    rootContents = fss.getItems(rootItem.getId());\n                    \n                    // If we are here, this means all the operations succeeded\n                    loginSucceeded();\n                } catch (Exception e) {\n                    // One of the operations has failed\n                    loginFailed(e.getMessage());\n                }\n            }\n        }.start();\n    }\n\n</pre>\n\nIf the name (login) and password correspond to the account in 4shared database, and network connection has been set successfully, the call up of the method '''loginSucceeded ()''' opens the window (en. activity), which '''displays the list of user\u2019s files and catalogues''', which has been stored into the static variable rootContents.\n\n<pre>\n\n    private void loginSucceeded() {\n        // Application UI transitions should be performed on the main thread\n        mHandler.post(new Runnable() {\n            @Override\n            public void run() {\n                mProgressDialog.dismiss();\n                // Move to next activity to show list of account's root folder contents\n                Intent intent = new Intent(Hello4shared.this, AccountContents.class);\n                startActivity(intent);\n            }\n        });        \n    }\n\n</pre>\n\nThe last thing, which should be changed is '''the configuration of the project in the file AndroidManifest.xml'''. \n\nIn the section <manifest> let\u2019s '''request the permit to get the access of the application to the Internet''':\n\n<pre>\n\n                <uses-permission android:name=\"android.permission.INTERNET\"></uses-permission>\n       In the section <application>, let\u2019s add the window(activity) AccountContents:\n       \t\t<activity android:name=\".AccountContents\"\n\t\t          android:label=\"@string/app_name\">\n\t\t</activity>\n       and define the portrait orientation for the window (activity) Hello4shared:\n       \t        android:configChanges=\"keyboardHidden|orientation\"\n                android:screenOrientation=\"portrait\"\n\n</pre>\n\nThe full code of the demo-application is attached (http://dc243.4shared.com/download/l8R381Nw/androidsamples.zip).\n\n\n5. '''Run the Application''' (http://developer.android.com/resources/tutorials/hello-world.html)\n\n[[Image:Image3.png]]\n\n\n----\n\n=== Blackberry ===\n\n----\n\n\n'''System requirements:'''\n \n\n- 32-bit Windows\u00ae XP, Windows Vista\u00ae or Windows 7 (64-bit versions require 32-bit Java\u00ae \u0438 Eclipse)\n\n- Eclipse 3.6 Helios\n\n- PC  with processor Intel\u00ae Pentium\u00ae 4  or higher (2.5 GHz or higher, 2 GB RAM, 1.5 GB free space on hard drive)\n\n- Java SE Development Kit (JDK) 6,  update 10 or newer.\n\n\n'''Setup:'''\n\n\n-Download and install 32-bit version of JAVA  (http://www.java.com/ru/download/)\n\n-Download and install 32-bit version of Eclipse (http://www.eclipse.org/downloads/packages/eclipse-classic-362/heliossr2)\n\n-Download and install Blackberry plugin for Eclipse (http://us.blackberry.com/developers/javaappdev/javaplugin.jsp)\n\n-Install Blackberry SDK.  \nTo do this, to start Eclipse and check menu Help - Install New Software\u2026 In a line with the software address to insert http://www.blackberry.com/go/eclipseUpdate/3.6/java. \n\n\n'''1. Description of 4shared Service'''\n\n\nService 4shared is a usual web-service, '''WSDL description''' of which is here: https://api.4shared.com/jax2/DesktopApp?wsdl. \n\nYou can '''read more about web-services and WSDL''' here: http://ru.wikipedia.org/wiki/%D0%92%D0%B5%D0%B1-%D1%81%D0%BB%D1%83%D0%B6%D0%B1%D0%B0, http://ru.wikipedia.org/wiki/WSDL. \n\n'''Short description of API functions''' can found here:  http://help.4shared.com/index.php/SOAP_API. \n\nTo work with SOAP API, you can use direct SOAP-calling, but it\u2019s more convenient to use another library for request parsing. \nFor instance, you can use '''free library''': (http://code.google.com/p/ksoap2-android/), which uses Java Microedition, working on Blackberry OS).\n\n\n'''2. Demo Application'''\n\n\nIn the beginning, it\u2019s necessary to''' create the new project in Eclipse''' (menu File-New-Project, in the list of project types \u2013 select Blackberry Project) and call it Hello4Shared. \n\nIn addition to that, for the right setup on the device of library ksoap2, you should create the 2nd project, where to place the library. You should define the type of the 2nd project Library and add the link to this project in the main application. \n\nTo work with the service, it\u2019s necessary to add ''' subclass ForSharedService'''. \n\nThe s'''tandard call of the function 4shared API''' will be the following:\n\n<pre>\n\nprotected static final String SERVICE_URL = \"http://api.4shared.com/jax2/DesktopApp\";        \n    protected static final String SERVICE_NAMESPACE = \"http://api.soap.shared.pmstation.com/\";\n \n/**\n* Enter check of the already existing user \n* @param username \u2013 user name\n* @param password - password\n* @throws Exception\n*/\n public void login(String username, String password) throws Exception\n {\n \tString methodName = \"login\";\n      SoapObject rpc = new SoapObject(SERVICE_NAMESPACE, methodName);\n      rpc.addProperty(\"arg0\", userName);\n      rpc.addProperty(\"arg1\", password);\n\nSoapSerializationEnvelope envelope = new    SoapSerializationEnvelope(SoapEnvelope.VER11);\n\n      envelope.bodyOut = rpc;        \n      envelope.encodingStyle = SoapSerializationEnvelope.XSD;\n\n      HttpTransport ht = new HttpTransport(SERVICE_URL);\n\tht.setXmlVersionTag(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\");\n\tht.debug = true;\n\n        \n      String result;\n\n      ht.call(SERVICE_URL + \"/\" + methodName, envelope);\n\tresult = (envelope.getResponse()).toString();         \n        \n      if (!isEmptyString(result))\n      \tthrow new Exception(result);\n}\n\n</pre>\n\nThe classes '''SoapObject, SoapSerializationEnvelope, HttpTransport''' \u2013 are included in the library ksoap2. \n\n'''SoapObject, SoapSerializationEnvelope''' serve to parse soap-requests, whereas '''HttpTransport''' provides transport for the call of requests. The call of service functions itself is established by the method), of the class HttpTransport. The service answer can be received by means of calling the method getResponse() of the class SoapSerializationEnvelope. The parameters of functions, transferred to the service, are defined by calling up the method addProperty of the class SoapObject as a pair \u00abparameter name - value\u00bb.\nNow, let\u2019s add the class of the main screen into the app, where we will place 2 text fields to enter the user\u2019s name (login) and password, and the button to call up the method login of service, used to enter: \npublic class MainAppScreen extends MainScreen implements FieldChangeListener\n\n<pre>\n{\n\t/**\n\t * Window Title\n\t */\n\tprivate LabelField _title;\n\t\n\t/**\n\t * Enter-Login Field\n\t */\n\tprivate EmailAddressEditField _userNameField;\n\t\n\t/**\n\t * Enter-Password Field\n\t */\n\tprivate PasswordEditField _passwordField;\n\t\n\t/**\n\t * Enter Button\n\t */\n\tprivate ButtonField _loginButton;\n\n\t/**\n\t * Constructor\n\t */\n\tpublic MainAppScreen()\n\t{\n\t\tsuper();\n\n\t\t_title = new LabelField(\"Hello4Shared\");\n\t\tsetTitle(_title);\n\t\t\n\t\t_userNameField = new EmailAddressEditField(\"Login or email: \", \"\");\n\t\tadd(_userNameField);\n        _passwordField = new PasswordEditField(\"Password: \", \"\");\n\t\tadd(_passwordField);\n\n\t\t_loginButton = new ButtonField(\"Login\", Field.FOCUSABLE);\n\t\t_loginButton.setChangeListener(this);\n\t\tadd(_loginButton);\n\t}\n\t\n}\n\n</pre>\n\nAfter that, let\u2019s '''add the handler''' of the press-button in the following way: \n\n<pre>\n\n/* \n * The Handler of the Press-Button\n*/\npublic void fieldChanged(Field field, int context)\n{\n\tif (field == _loginButton)\n\t{\n\t\tlogin();\n\t}\n}\n\n</pre>\n\nAnd the '''exact request to 4shared service''' in the method login, by means of using the class ForSharedService, described above:\n\n<pre>\n\nprivate void login(){\nForSharedService service = new ForSharedService(_userNameField.getText(), _passwordField.getText());\n\t\t\n\t// Logging into account\n\ttry\n\t{\n\t\tservice.login();\n\t}catch (Exception e)\n\t{\n\t\tDialog.alert(e.getMessage());\n\t}\n}\n\n</pre>\n\nIn case of invalid login or password, the user will receive the error report.\n\nThe '''full code''' of the demo-application is attached (http://dc315.4shared.com/download/bjixhTFj/blackberrysamples.zip).\n\n\n__NOTOC__\n\n== '''Method Summary''' ==\n\n=== addToFavorites ===\nlong addToFavorites(java.lang.String login, java.lang.String password, long fileId) \nAdds file to user favorites.\n\n=== addToMyAccount ===\njava.lang.String addToMyAccount(java.lang.String login, java.lang.String password, long dirId, java.lang.String link) \nAdds file or folder identified by supplied link to user's account in folder identified by dirId\n\n=== checkSharedDirAccess ===\nint checkSharedDirAccess(java.lang.String login, java.lang.String password, long dirID, java.lang.String dirPassword, java.lang.String userDirPassword) \nChecks if directory can be accessed by specified user with specified passwords\n \n=== createNewFolder ===\nlong createNewFolder(java.lang.String login, java.lang.String password, long dirID, java.lang.String folderName) \nCreates new folder as dirId subfolder\n \n=== createUploadSessionKey ===\njava.lang.String createUploadSessionKey(java.lang.String login, java.lang.String password, long dirID) \nCreates session key for uploading file\n\n=== decodeId ===\njava.lang.String decodeId(java.lang.String login, java.lang.String password, java.lang.String encodedId) \nturns 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})/.*\n\n=== decodeLink ===\nlong decodeLink(java.lang.String login, java.lang.String password, java.lang.String link) \nUsed to get item id from item link.\n\n=== deleteFile ===\nvoid deleteFile(java.lang.String login, java.lang.String password, long fileID) \nRemoves file to recycle bin\n\n=== deleteFileFinal ===\nvoid deleteFileFinal(java.lang.String login, java.lang.String password, long fileID) \nRemove file once and for all.\n\n=== deleteFolder ===\nvoid deleteFolder(java.lang.String login, java.lang.String password, long dirID) \nCompletely removes folder and puts all of it contents to recycle bin\n\n=== deleteFolderFinal ===\nvoid deleteFolderFinal(java.lang.String login, java.lang.String password, long dirID) \nRemoves files and subfolders from recycle bin.\n\n=== downloadFinished ===\nvoid downloadFinished(java.lang.String login, java.lang.String password, long fileId) \nHave to be called after full file download\n\n=== emptyRecycleBin ===\nint emptyRecycleBin(java.lang.String login, java.lang.String password) \nEmpties recycle bean for specified user.\n\n=== getAllFolders ===\nAccountItem[] getAllFolders(java.lang.String login, java.lang.String password) \nReturns all of the folders in user's root directory\n \n=== getAllItems ===\nAccountItem[] getAllItems(java.lang.String login, java.lang.String password) \nReturns info about all items in user's root folder\n\n=== getDirDescription ===\njava.lang.String getDirDescription(java.lang.String login, java.lang.String password, long dirId) \nReturns folder description\n\n=== getDirectLink ===\njava.lang.String getDirectLink(java.lang.String login, java.lang.String password, java.lang.String link) \nReturns link to start immediate downloading.\n\n=== getDirInfo ===\nAccountItem getDirInfo(java.lang.String login, java.lang.String password, long dirID) \nReturn info about specified folder\n\n=== getExifFileInf ===\nExifInfo getExifFileInfo(java.lang.String login, java.lang.String password, java.lang.String fileLink) \nReturn image info for specified file link if any\n\n=== getExifFileInfos ===\nExifInfo[] getExifFileInfos(java.lang.String login, java.lang.String password, long dirId) \nReturns @see ExifInfo for all image files in specified folder\n\n=== getFavorites ===\nAccountItem[] getFavorites(java.lang.String login, java.lang.String password) \nReturns user favored files.\n\n=== getFileDescription ===\njava.lang.String[] getFileDescription(java.lang.String login, java.lang.String password, long fileId) \nReturns file title, tags and description if any\n\n=== getFileDownloadLink ===\njava.lang.String getFileDownloadLink(java.lang.String login, java.lang.String password, long fileID) \nReturns download link for user owned file\n\n=== getFileInfo === \nAccountItem getFileInfo(java.lang.String login, java.lang.String password, long fileID) \nReturns info about file\n\n=== getFiles ===\nAccountItem[] getFiles(java.lang.String login, java.lang.String password, long[] fileIds) \nReturns account items for file ids.\n\n=== getFreeSpace ===\nlong getFreeSpace(java.lang.String login, java.lang.String password) \nGets free space left for user\n\n=== getItemInfo ===\nAccountItem getItemInfo(java.lang.String login, java.lang.String password, long itemID, boolean dir) \nCommon method for DesktopApp.getFileInfo(String, String, long) and DesktopApp.getDirInfo(String, String, long) distinguished by value of dir parameter\n\n=== getItems ===\nAccountItem[] getItems(java.lang.String login, java.lang.String password, long dirID) \nReturns array of infos about contents of specified dir.\n\n=== getSharedDirItems ===\n\nAccountItem[] getDirLinkItems(String dirLink, String userDirPassword). \nReturns array of infos about contents of specified dir accepting the folder link.\n\n=== getItemsCount ===\nlong getItemsCount(java.lang.String login, java.lang.String password, long dirID) \nReturns item count for dirId (-1 for root folder)\n\n=== getItemsPartial ===\nAccountItem[] getItemsPartial(java.lang.String login, java.lang.String password, long dirId, int startIndex, int count) \nGet specified count folders' items ordered by name, folders first starting from startIndex\n\n=== getMaxFileSize ===\nlong getMaxFileSize(java.lang.String login, java.lang.String password) \nReturn maximum allowed file size for specified user\n\n=== getMp3FileInfo ===\nMp3Info getMp3FileInfo(java.lang.String login, java.lang.String password, java.lang.String fileLink) \nReturn audio info for specified file link if any\n\n=== getMp3FileInfos ===\nMp3Info[] getMp3FileInfos(java.lang.String login, java.lang.String password, long dirId) \nReturns audio info for all audio files in folder\n \n=== getNewFileDataCenter ===\nlong getNewFileDataCenter(java.lang.String login, java.lang.String password) \nReturns datacenter id to upload files to\n\n=== getNotOwnedSizeLimit ===\nlong getNotOwnedSizeLimit() \nMax file size which can be downloaded without speed limit\n\n=== getPreviewLink ===\njava.lang.String getPreviewLink(java.lang.String login, java.lang.String password, long fileId) \nReturn link to small preview image, or to flv preview for video files\n\n=== getRecycleBinItems ===\nAccountItem[] getRecycleBinItems(java.lang.String login, java.lang.String password) \nReturns info about files in recycle bin\n\n=== getRoot ===\nAccountItem getRoot(java.lang.String login, java.lang.String password) \nReturns account item for user's root directory\n\n=== getSharedDirItems ===\nAccountItem[] getSharedDirItems(java.lang.String login, java.lang.String password, long dirID, java.lang.String dirPassword, java.lang.String userDirPassword) \nReturn content of possibly not owned shared folder\n\n=== getSpaceLimit ===\nlong getSpaceLimit(java.lang.String login, java.lang.String password) \nReturns user space limit\n\n=== getUploadFormUrl ===\njava.lang.String getUploadFormUrl(int dataCenterID, java.lang.String sessionKey) \nReturns url to upload file to.\n\n=== hasRightUpload ===\nboolean\thasRightUpload() \nWhether upload feature is on.\n\n=== isAccountActive ===\nboolean\tisAccountActive(java.lang.String login, java.lang.String password) \nChecks account active status\n\n=== isAccountBanned ===\nboolean\tisAccountBanned(java.lang.String login, java.lang.String password) \nChecks if user account is banned\n\n=== isAccountPremium ===\nboolean isAccountPremium(java.lang.String login, java.lang.String password) \nChecks if user account is premium\n\n=== isExistsLoginPassword ===\nboolean isExistsLoginPassword(java.lang.String login, java.lang.String password) \ntrue-false version of login.\n\n=== login ===\njava.lang.String login(java.lang.String login, java.lang.String password) \nLogin version with diagnostic message.\n\n=== pasteFilesDirs ===\njava.lang.String pasteFilesDirs(java.lang.String login, java.lang.String password, long toFolderId, boolean makeCopy, long[] fileIds, long[] dirIds) \nCopy-pastes or cut-pastes a group of files and dirs.\n\n=== removeFromFavorites ===\nlong removeFromFavorites(java.lang.String login, java.lang.String password, long fileId) \nRemoves file from user's favorites.\n\n=== renameFile ===\nlong renameFile(java.lang.String login, java.lang.String password, long fileID, java.lang.String newName) \nRenames specified file\n\n=== renameFolder ===\nlong renameFolder(java.lang.String login, java.lang.String password, long dirID, java.lang.String newName) \nRenames specified folder\n\n=== restoreFile ===\nvoid restoreFile(java.lang.String login, java.lang.String password, long fileID) \nRestores file from Recycle Bin.\n\n=== restoreFiles ===\nvoid restoreFiles(java.lang.String login, java.lang.String password, long[] fileIDs) \nRestores group of files from Recycle Bin.\n\n=== setDirDescription ===\njava.lang.String setDirDescription(java.lang.String login, java.lang.String password, long dirId, java.lang.String newDescription, boolean setAsDefault, boolean applyToAll) \nSets folder description for dedicated folder or account as a whole\n\n=== setFileDescription ===\njava.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) \nSets file title, tags and description for dedicated file or account as a whole\n\n=== signup ===\njava.lang.String signup(java.lang.String login, java.lang.String password) \nCreates new User with specified login(email) and password and sends confirmation email.\n\n=== signupUsername ===\njava.lang.String signupUsername(java.lang.String login, java.lang.String password, java.lang.String username) \nCreates new User with specified login(email), short username for easing login and password and sends confirmation email.\n\n=== uploadCancelFile ===\nvoid uploadCancelFile(java.lang.String login, java.lang.String password, long fileId) \nCall if upload was canceled\n\n=== uploadFinishFile ===\njava.lang.String uploadFinishFile(java.lang.String login, java.lang.String password, long fileId, java.lang.String md5) \nComplete resumable upload\n\n=== uploadStartedFileExists ===\nboolean\tuploadStartedFileExists(java.lang.String login, java.lang.String password, long fileId) \nChecks if file was partially uploaded\n\n=== uploadStartFile ===\nlong uploadStartFile(java.lang.String login, java.lang.String password, long dirID, java.lang.String name, long fullSize)\nResumable upload - start\n\n=== uploadStartFileUpdate ===\nlong uploadStartFileUpdate(java.lang.String login, java.lang.String password, long updateFileId, java.lang.String name, long fullSize) \nUpdate file\n\n== '''Method Detail''' ==\n\n\n=== Upload HOW TO ===\n\nFirst of all you should check if you have '''enough free space in user\u2019s account''':\n  function long getFreeSpace(String login, String password);\n(returned value \u2013 free space in bytes)\n\nAnd what is '''upload limit for user''' (per file):\n  function long getMaxFileSize(String login, String password);\n(returned value \u2013 maximum file size in bytes)\n\nPlease, check if t'''arget file corresponds the mentioned conditions''', if it does, then:\n\n'''Get session:''' \n function String createUploadSessionKey(String login, String password, long dirID);\n\nSet \u2018-1\u2019 as DirId parameter. In this case file will be uploaded to the root directory. \n\nOr read full API description to learn how to browse user's directory for subdirectories' ids. \n\nReturn session key if everything is ok and empty or null string if you can't upload to the specified dir. \n\n'''Get datacenter:'''\n  function int getNewFileDataCenter(String login, String password);\n\nIf returned datacenter is less or equal then 0 - something goes wrong.\n\nThen '''get URL for upload''' using session and datacenter:\n\n  function String getUploadFormUrl(int dataCenterID, String sessionKey);\n\nReturned string is only valid if it starts with http, otherwise, you can't upload file; \n\n'''To reserve fileId for yor upload call function''':\n\n  function long uploadStartFile(String login, String password, long dirID, String name, long fullSize);\n\nAgain, fileId can be only positive.\n\nThen '''use received URL and fileId to upload by executing POST query multipart/form-data with fields'''\n \n1) resumableFileId (file ID received via previous method) \n\n2) resumableFirstByte (index of the first byte of current part. If the file is uploaded as single unit \u2013 then pass 0. If the file is divided into parts and is uploaded by parts \u2013 then pass index of the byte every part starts from)\n\n'''Attach the file to the query''' as a parameter FilePart.\n \nwhere last parameter is file md5 digest. If the file is successfully uploaded \u2013 function returns null or empty line, if not \u2013 you will get an error message. If the file was uploaded by parts, this function unites them into one. \n\n'''You are done!'''\n\n=== Search files on 4shared ===\n\nTo search files on 4shared.com you should use the following url\n\nhttp://search.4shared.com/network/searchXml.jsp\n\nParameters:\n        q - keyword\nExample: q=funny cats\n\n        searchExtention - type of file (extension)\n        \n        searchCategory - category\n        \nIf you need extension just use searchExtention=mid. \nRemember, if you are using parameter searchExtention you should also use searchmode=3\n\n\n'''For searching in category use the following:'''\n\n        searchCategory=music/audio\n        searchCategory=video\n        searchCategory=photo\n        searchCategory=archive\n        searchCategory=office/books_office/document/books\n        searchCategory=program\n        searchCategory=web \n        searchCategory=mobile/mobile_palm\n        searchCategory=game\n\n'''Example:''' use searchCategory=audio - if you are searching only for music.\n\nRemember, if you are using parameter searchCategory you should also use searchmode=3\n\n        sortType - type of sorting\n\n          1 - sort by downloads;\n          2 - sort by upload date;\n          3 - sort by size;\n          4 - sort by name;\n\n        sortOrder - sorting order(Ascending -1, Descending 1)\n\n        start - offset, is used for pagination\nstart value should be divisible by 10\n\n\n'''Usage example:'''\n\n http://search.4shared.com/network/searchXml.jsp?q=somebody&searchExtention=mid&sortType=3&sortOrder=1&searchmode=3&start=10\n\n'''Response:'''\n\n <search-result>\n <query>somebody</query> - keyword\n <total-files>24</total-files> - number of found files\n <page-number>2</page-number> - page number\n <pages-total>2</pages-total> - total amount of pages\n <start>10</start> - offset\n <files-per-page>10</files-per-page> - amount of files per page\n <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>\n <result-files>\n <file>\n <name>somebody_to_shove.mid</name> - filename\n <description/> - description\n <downloads-count>8</downloads-count> - number of downloads\n <upload-date-format>hh:mm dd-MM-yyyy</upload-date-format> - upload date format\n <upload-date>04:19 19-05-2009</upload-date> - upload date\n <url>http://www.4shared.com/audio/qVaKdItF/somebody_to_shove.htm</url> - download page url\n <preview-url/> - preview url if exist\n <flash-preview-url/>- flash preview url if exist\n <user>wym</user> - username\n <size>39 KB</size> - file size\n </file>\n <file>\n ...\n </file>\n </result-files>\n </search-result>\n\n=== checkSharedDirAccess ===\n\n  public int checkSharedDirAccess(java.lang.String login,\n                                java.lang.String password,\n                                long dirID,\n                                java.lang.String dirPassword,\n                                java.lang.String userDirPassword)\n\nChecks if directory can be accessed by specified user with specified passwords\n\n'''Parameters:'''\n\n        login - is user login\n        password - is user password\n        dirID - id of the directory to be accessed\n        dirPassword - generated password to view contents of not owned folders\n        userDirPassword - user specified password \n\n'''Returns:'''\n\n Status.\n 0 \tok\n 1 \tno such dir\n 2 \towner inactive\n 3 \tabused dir\n 4 \tincorrect dirPassword\n 5 \tdir is not shared\n 6 \towner is banned\n 8 \tincorrect userDirPassword\n\n=== checkSubdomain ===\n\n\n  public java.lang.String checkSubdomain(java.lang.String login,\n                                       java.lang.String password,\n                                       long dirId,\n                                       java.lang.String subdomainName)\n\nChecks if subdomain can be set for specified folder\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  dirId - id of the directory\n  subdomainName - name to be set \n\n'''Returns:'''\n\n  Empty string or null if everything is ok and error message otherwise\n\n=== createNewFolder ===\n\n  public long createNewFolder(java.lang.String login,\n                            java.lang.String password,\n                            long dirID,\n                            java.lang.String folderName)\n\nCreates new folder as dirId subfolder\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  dirID - id of the directory to create folder in\n  folderName - new folder name \n\n'''Returns:'''\n\n  0 - if creation denied, newly created dir ID otherwise \n  -1 - already exists \n  -2 - attempt to create folder in removed parent\n\n=== createUploadSessionKey ===\n\n  public java.lang.String createUploadSessionKey(java.lang.String login,\n                                               java.lang.String password,\n                                               long dirID)\n\nCreates session key for uploading file\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  dirID - id of the directory to upload to \n'''Returns:'''\n\n  session key\n\n=== deleteFile ===\n\n  public void deleteFile(java.lang.String login,\n                       java.lang.String password,\n                       long fileID)\n\nRemoves file to recycle bin or from recycle bin if it is already there\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  fileID - id of the file to be removed\n\n=== deleteFolder ===\n\n  public void deleteFolder(java.lang.String login,\n                         java.lang.String password,\n                         long dirID)\n\nCompletely removes folder and puts all of it contents to recycle bin\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  dirID - id of the directory to be removed\n\n=== downloadFinished ===\n\n  public void downloadFinished(java.lang.String login,\n                             java.lang.String password,\n                             long fileId)\n\nHave to be called after full file download\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  fileId - id of the file which was downloaded\n\n=== getAllFolders ===\n\n  public com.pmstation.shared.soap.api.AccountItem[] getAllFolders(java.lang.String login,\n                                                                 java.lang.String password)\n\nReturns all of the folders in user's root directory\n\n'''Parameters:'''\n\n  login - user login\n  password - user password \n\n'''Returns:'''\n\n  Array of info records about user's root folder subfolders\n\n=== getAllItems ===\n\n  public com.pmstation.shared.soap.api.AccountItem[] getAllItems(java.lang.String login,\n                                                               java.lang.String password)\n\nReturns info about all items in user's root folder\n\n'''Parameters:'''\n\n  login - user login\n  password - user password \n\n'''Returns:'''\n\n  Array of info records about user's root folder content\n\n=== getCurrentUploaderVersion ===\n\n  public long getCurrentUploaderVersion()\n\nReturns 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.\n\n'''Returns:'''\n\n  Uploader version\n\n=== getDirectLink ===\n\n  public java.lang.String getDirectLink(java.lang.String login,\n                                      java.lang.String password,\n                                      java.lang.String link)\n\nReturns link to start immediate downloading. Not always possible however, because we are ads-supported mostly. Returns link starting with \"http\" if ok.\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  link - indirect download link\n\n=== getDirInfo ===\n\n  public com.pmstation.shared.soap.api.AccountItem getDirInfo(java.lang.String login,\n                                                            java.lang.String password,\n                                                            long dirID)\n\nReturn info about specified folder\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  dirID - id of the folder \n\n'''Returns:'''\n\n  folder info\n\n=== getFileDownloadLink ===\n\n  public java.lang.String getFileDownloadLink(java.lang.String login,\n                                            java.lang.String password,\n                                            long fileID)\n\nReturns download link for user owned file\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  fileID - id of file to be downloaded \n\n'''Returns:'''\n\n  Download link or empty string if some errors occurs.\n\n=== getFileInfo ===\n\n  public com.pmstation.shared.soap.api.AccountItem getFileInfo(java.lang.String login,\n                                                             java.lang.String password,\n                                                             long fileID)\n\nReturns info about file\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  fileID - id of file to get info about \n\n'''Returns:'''\n\n  file info\n\n=== getFolderSharingProperties ===\n\n  public com.pmstation.shared.soap.api.SharedFolderProperties[] getFolderSharingProperties(java.lang.String login,\n                                                                                         java.lang.String password,\n                                                                                         long dirId)\n\nReturns 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.\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  dirId - id of the folder to properties for\n \n'''Returns:'''\n\n  folder sharing properties\n\n=== getFreeSpace ===\n\n  public long getFreeSpace(java.lang.String login,\n                         java.lang.String password)\n\nGets free space left for user\n\n'''Parameters:'''\n\n  login - user login\n  password - user password \n\n'''Returns:'''\n\n  free space left for user in bytes\n\n=== getHistory ===\n\n  public com.pmstation.shared.soap.api.DirHistoryDTO[] getHistory(java.lang.String login,\n                                                                java.lang.String password,\n                                                                long dirId)\n\nReturns history of operations in specified folder and subfolders. For operation field meanings see getOperationDescriptions()\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  dirId - id of folder \n\n'''Returns:'''\n\n  Array of folder changes. May be null or empty\n\n=== getHistoryFromId ===\n\n  public com.pmstation.shared.soap.api.DirHistoryDTO[] getHistoryFromId(java.lang.String login,\n                                                                      java.lang.String password,\n                                                                      long dirId,\n                                                                      long fromId)\n\nReturns history of operations which occurs in specified folder and subfolders with history id more then specified. For operation field meanings see getOperationDescriptions()\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  dirId - id of folder to take history for\n  fromId - id floor of history \n\n'''Returns:'''\n\n  Array of folder changes. May be null or empty\n\n=== getItemInfo ===\n\n  public com.pmstation.shared.soap.api.AccountItem getItemInfo(java.lang.String login,\n                                                             java.lang.String password,\n                                                             long itemID,\n                                                             boolean dir)\n\nCommon method for getFileInfo(String, String, long) and getDirInfo(String, String, long) distinguished by value of dir parameter\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  itemID - id of element\n  dir - if true then supplied Id is folder and file otherwise \n\n'''Returns:'''\n\n=== getItems ===\n\n  public com.pmstation.shared.soap.api.AccountItem[] getItems(java.lang.String login,\n                                                            java.lang.String password,\n                                                            long dirID)\n\nReturns array of infos about contents of specified dir.\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  dirID - id of folder to list (-1 for root)\n\n'''Returns:'''\n\n  Array of info items\n\n=== getMaxFileSize ===\n\n  public long getMaxFileSize(java.lang.String login,\n                           java.lang.String password)\n\nReturn maximum allowed file size for specified user\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n \n'''Returns:'''\n\n  maximum allowed file size in bytes\n\n=== getNewFileDataCenter ===\n\n  public long getNewFileDataCenter(java.lang.String login,\n                                 java.lang.String password)\n\nReturns datacenter id to upload files to\n\n'''Parameters:'''\n\n  login - user login\n  password - user password \n\n'''Returns:'''\n\n  datacenter id to upload new files to\n\n=== getNotOwnedSizeLimit ===\n\n  public long getNotOwnedSizeLimit()\n\nMax file size which can be downloaded without speed limit\n\n'''Returns:'''\n\n  max file size which can be downloaded without speed limit\n\n=== getOperationDescriptions ===\n\npublic java.lang.String[] getOperationDescriptions()\n\nReturns array of OperationEnum names. Array index corresponds to values which can be returned as DirHistoryDTO.getOperation(). Array is supposed to be zero-based.\n\n'''Returns:'''\n\n  array of OperationEnum names\n\n=== getRecycleBinItems ===\n\n  public com.pmstation.shared.soap.api.AccountItem[] getRecycleBinItems(java.lang.String login,\n                                                                      java.lang.String password)\n\nReturns info about files in recycle bin\n\n'''Parameters:'''\n\n  login - user login\n  password - user password \n\n'''Returns:'''\n\n  Array of recycle bin content info items\n\n=== getSharedDirItems ===\n\n  public com.pmstation.shared.soap.api.AccountItem[] getSharedDirItems(java.lang.String login,\n                                                                     java.lang.String password,\n                                                                     long dirID,\n                                                                     java.lang.String dirPassword,\n                                                                     java.lang.String userDirPassword)\n\nReturn content of possibly not owned shared folder\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  dirID - id of folder to view\n  dirPassword - 4shared generated dir password\n  userDirPassword - user set dir password if needed \n\n'''Returns:'''\n\n  content of specified shared folder or null\n\n=== getSpaceLimit ===\n\n  public long getSpaceLimit(java.lang.String login,\n                          java.lang.String password)\n\nReturns user space limit\n\n'''Parameters:'''\n\n  login - user login\n  password - user password \n\n'''Returns:'''\n\n  space limit\n\n=== getUploadFormUrl ===\n\npublic java.lang.String getUploadFormUrl(int dataCenterID,\n                                         java.lang.String sessionKey)\n\nReturns url to upload file to.\n\n'''Parameters:'''\n\n  dataCenterID - id of datacenter to upload to\n  sessionKey - upload session key\n\n=== hasRightUpload ===\n\n  public boolean hasRightUpload()\n\nWhether upload feature is on.\n\n'''Returns:'''\n\n  whether upload feature is on.\n\n=== isAccountActive ===\n\n  public boolean isAccountActive(java.lang.String login,\n                               java.lang.String password)\n\nChecks account availability\n\n'''Parameters:'''\n\n  login - user login\n  password - user password \n\n'''Returns:'''\n\n  true if account is active\n\n=== isAccountBanned ===\n\n  public boolean isAccountBanned(java.lang.String login,\n                               java.lang.String password)\n\nChecks if user account is banned\n\n'''Parameters:'''\n\n  login - user login\n  password - user password \n\n'''Returns:'''\n\n  true if user accont is banned\n\n=== isAccountPremium ===\n\n  public boolean isAccountPremium(java.lang.String login,\n                                java.lang.String password)\n\nChecks if user account is premium\n\n'''Parameters:'''\n\n  login - user login\n  password - user password \n\n'''Returns:'''\n\n  true of user has premium account\n\n=== isExistsLoginPassword ===\n\n  public boolean isExistsLoginPassword(java.lang.String login,\n                                     java.lang.String password)\n\ntrue-false version of login\n\n'''Parameters:'''\n\n  login - user login\n  password - user password \n\n'''Returns:'''\n\n  true if login was successful\n\n=== login ===\n\n  public java.lang.String login(java.lang.String login,\n                              java.lang.String password)\n\nLogin\n\n'''Parameters:'''\n\n  login - user login\n  password - user password \n\n'''Returns:'''\n\n  Empty string if all ok, diagnostic message otherwise\n\n=== markSynchronized ===\n\n  public void markSynchronized(java.lang.String login,\n                             java.lang.String password,\n                             long dirId)\n\nInforms 4shared to write folder and subfolders usage history\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  dirId - id of folder to write history for\n\n=== pasteFilesDirs ===\n\n  public java.lang.String pasteFilesDirs(java.lang.String login,\n                                       java.lang.String password,\n                                       long toFolderId,\n                                       boolean makeCopy,\n                                       long[] fileIds,\n                                       long[] dirIds)\n\nCopy-pastes or cut-pastes a group of files and dirs. Use this to copy or move a group of files to another directory.\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  toFolderId - target folder id\n  makeCopy - - exec copy+paste if true, exec cut+paste if false\n  fileIds - ids of file to be moved/copied\n  dirIds - ids of folders to be moved/copied \n\n'''Returns:'''\n\n  diagnostic message or empty string if all ok\n\n=== renameFile ===\n\n  public long renameFile(java.lang.String login,\n                       java.lang.String password,\n                       long fileID,\n                       java.lang.String newName)\n\nRenames specified file\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  fileID - id of file to be renamed\n  newName - new name of file \nReturns:\n  -1 if file exists, \n  0 in case of other failures, \n  fileID if rename was successful\n\n=== renameFolder ===\n\n  public long renameFolder(java.lang.String login,\n                         java.lang.String password,\n                         long dirID,\n                         java.lang.String newName)\n\nRenames specified folder\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  dirID - id of folder to be renamed\n  newName - new name of folder \n\n'''Returns:'''\n\n  -1 if file exists, \n  0 in case of other failures, \n  dirID if rename was successful\n\n=== restoreFile ===\n\n  public void restoreFile(java.lang.String login,\n                        java.lang.String password,\n                        long fileID)\n\nRestores 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.\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  fileID - id of file to be restored\n\n=== restoreFiles ===\n\n  public void restoreFiles(java.lang.String login,\n                         java.lang.String password,\n                         long[] fileIDs)\n\nRestores 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.\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  fileIDs - Array of file ids to be restored\n\n=== setFolderSharingProperties ===\n\n  public java.lang.String setFolderSharingProperties(java.lang.String login,\n                                                   java.lang.String password,\n                                                   long dirId,\n                                                   com.pmstation.shared.soap.api.SharedFolderProperties folderProperties)\n\nSets folder sharing properties\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  dirId - id of folder to set properties for\n  folderProperties - new properties values \n\n'''Returns:'''\n\n  Diagnostic message or empty string if all is ok\n\n=== signup ===\n\n  public java.lang.String signup(java.lang.String login,\n                               java.lang.String password)\n\nCreates new User and sends confirmation email.\n\n'''Parameters:'''\n\n  login - desired login\n  password - password \n\n'''Returns:'''\n\n  error message if any. Empty string if all ok.\n\n=== syncFinished ===\n\n  public void syncFinished(java.lang.String login,\n                         java.lang.String password,\n                         long fileId)\n\nShould be called in the end of each sync operation\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  fileId - which file was synced. -1 if not applicable\n\n=== uploadCancelFile ===\n\n  public void uploadCancelFile(java.lang.String login,\n                             java.lang.String password,\n                             long fileId)\n\nCall if upload was canceled\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  fileId - id of file which upload is canceling\n\n=== uploadFinishFile ===\n\n  public java.lang.String uploadFinishFile(java.lang.String login,\n                                         java.lang.String password,\n                                         long fileId,\n                                         java.lang.String md5)\n\nComplete resumable upload\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  fileId - returned from initial call to uploadStartFile() - existing file in 'being uploaded by parts' state\n  md5 - original file MD5 to verify file consistency at server side \n\n'''Returns:'''\n\n  empty string if success or error message\n\n=== uploadStartedFileExists ===\n\n  public boolean uploadStartedFileExists(java.lang.String login,\n                                       java.lang.String password,\n                                       long fileId)\n\nChecks if file was partially uploaded\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  fileId - id of file to be checked \n\n'''Returns:'''\n\n  true if there is part of file already uploaded.\n\n=== uploadStartFile ===\n\n  public long uploadStartFile(java.lang.String login,\n                            java.lang.String password,\n                            long dirID,\n                            java.lang.String name,\n                            long fullSize)\n\nResumable upload - start\n\n'''Parameters:'''\n\n  dirID - (-1) means upload to user's root dir \n\n'''Returns:'''\n\n  fileId to pass as parameter in all subsequent partial uploads\n\n=== uploadStartFileUpdate ===\n\n  public long uploadStartFileUpdate(java.lang.String login,\n                                  java.lang.String password,\n                                  long updateFileId,\n                                  java.lang.String name,\n                                  long fullSize)\n\nUpdate file\n\n'''Parameters:'''\n\n  login - user login\n  password - user password\n  updateFileId - it of original file to be updated\n  name - empty string means don't change existing name\n  fullSize - \n\n'''Returns:'''\n\n  id of temporary file uploading of which will cause update of original file"
                    }
                ]
            },
            "131": {
                "pageid": 131,
                "ns": 0,
                "title": "SOAP Quick start guide",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "First of all you should discover if you have enough free space is in user\u2019s account:\n  function long getFreeSpace(String login, String password);\n(returned value \u2013 free space in bytes)\n\nAnd how much user can upload in one file:\n  function long getMaxFileSize(String login, String password);\n(returned value \u2013 maximally permissible file size in bytes)\n\nPlease, check if target file corresponds to the mentioned conditions, if it does then:\n\nGet session:\n  function String createUploadSessionKey(String login, String password, long dirID);\nSet \u2018-1\u2019 as DirId parameter. In this case file will be uploaded to the root directory. Or read full API description to discover how to browse user's directory for subdirectories' ids. Return session key if all is ok and empty or null string if you can't upload to specified dir.\n\nGet datacenter:\n  function int getNewFileDataCenter(String login, String password);\nIf returned datacenter is less or equal then 0 - something goes wrong.\n\nThen get URL for upload using session and datacenter:\n  function String getUploadFormUrl(int dataCenterID, String sessionKey);\nReturned string is valid only if starts from http in other cases you can't upload file;\n\nTo reserve fileId for yor upload call function:\n  function long uploadStartFile(String login, String password, long dirID, String name, long fullSize);\nAgain fileId can be only positive.\n\nThen use received URL and fileId to upload by executing POST query multipart/form-data with fields\n\n1) resumableFileId (file ID received via previous method)\n\n2) resumableFirstByte (index of the first byte of current piece. If a file is uploaded as single unit \u2013 then pass 0. If the file is separated on pieces and is uploaded by pieces \u2013 then pass index of the byte, from which every piece starts)\n\nAttach the file to the query as a parameter FilePart.\n\nWhen all pieces are uploaded call function:\n  function String uploadFinishFile(String login, String password, long fileId, String md5);\nwhere last parameter is file\u2019s md5 digest. If the file is successfully uploaded \u2013 function returns null or empty line, if not \u2013 text of error. If the file was uploaded by pieces, this function unites them into one.\n\nYou are done!"
                    }
                ]
            }
        }
    }
}