anderix.otcs
Class OtcsClient

java.lang.Object
  extended by anderix.otcs.OtcsClient

public class OtcsClient
extends java.lang.Object


Constructor Summary
OtcsClient()
           
OtcsClient(java.lang.String contentServerUrl)
           
OtcsClient(java.lang.String contentServerUrl, java.lang.String username)
           
OtcsClient(java.lang.String contentServerUrl, java.lang.String username, java.lang.String password)
           
 
Method Summary
 java.lang.String connect()
           
 java.lang.String createFolder(long parentId, java.lang.String name)
           
 long createFolderAndGetId(long parentId, java.lang.String name)
           
 java.lang.String createNode(long nodeType, long parentId, java.lang.String name)
           
 long createNodeAndGetId(long nodeType, long parentId, java.lang.String name)
           
 java.lang.String deleteNode(long nodeId)
           
 void downloadDocument(long nodeId, java.lang.String localFilePath)
           
 void downloadFolderContents(long nodeId, java.lang.String localFolderPath)
           
 OtcsNode[] getChildren(long nodeId)
           
 java.lang.String getChildrenJson(long nodeId)
           
 java.lang.String getContentServerUrl()
           
 OtcsNode[] getEnterpriseChildren()
           
 java.lang.String getEnterpriseChildrenJson()
           
 long getNodeIdFromJson(java.lang.String json)
           
 OtcsPermissions[] getPermissions(long nodeId)
           
 java.lang.String getPermissionsJson(long nodeId)
           
 java.lang.String getToken()
           
 java.lang.String getUsername()
           
 java.lang.String moveNode(long nodeId, long newParent)
           
 java.lang.String removePublicAccess(long nodeId)
           
 java.lang.String renameNode(long nodeId, java.lang.String newName)
           
 java.lang.String restDelete(java.lang.String url)
           
 java.lang.String restGet(java.lang.String url)
           
 java.lang.String restGet(java.lang.String url, java.util.Hashtable querystring)
           
 java.lang.String restPost(java.lang.String url, java.util.Hashtable formValues)
           
 java.lang.String restPut(java.lang.String url, java.util.Hashtable formValues)
           
 void setContentServerUrl(java.lang.String contentServerUrl)
           
 void setPassword(java.lang.String password)
           
 void setUsername(java.lang.String username)
           
 java.lang.String uploadDocument(long folderId, java.lang.String filename, java.io.File file)
           
 java.lang.String uploadDocument(long folderId, java.lang.String filename, java.lang.String filepath)
           
 long uploadDocumentAndGetId(long folderId, java.lang.String filename, java.io.File file)
           
 long uploadDocumentAndGetId(long folderId, java.lang.String filename, java.lang.String filepath)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OtcsClient

public OtcsClient()

OtcsClient

public OtcsClient(java.lang.String contentServerUrl)

OtcsClient

public OtcsClient(java.lang.String contentServerUrl,
                  java.lang.String username)

OtcsClient

public OtcsClient(java.lang.String contentServerUrl,
                  java.lang.String username,
                  java.lang.String password)
           throws java.net.MalformedURLException,
                  java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException
Method Detail

getToken

public java.lang.String getToken()

getContentServerUrl

public java.lang.String getContentServerUrl()

setContentServerUrl

public void setContentServerUrl(java.lang.String contentServerUrl)

getUsername

public java.lang.String getUsername()

setUsername

public void setUsername(java.lang.String username)

setPassword

public void setPassword(java.lang.String password)

connect

public java.lang.String connect()
                         throws java.net.MalformedURLException,
                                java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

restGet

public java.lang.String restGet(java.lang.String url)
                         throws java.net.MalformedURLException,
                                java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

restGet

public java.lang.String restGet(java.lang.String url,
                                java.util.Hashtable querystring)
                         throws java.net.MalformedURLException,
                                java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

restPost

public java.lang.String restPost(java.lang.String url,
                                 java.util.Hashtable formValues)
                          throws java.net.MalformedURLException,
                                 java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

restPut

public java.lang.String restPut(java.lang.String url,
                                java.util.Hashtable formValues)
                         throws java.net.MalformedURLException,
                                java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

restDelete

public java.lang.String restDelete(java.lang.String url)
                            throws java.net.MalformedURLException,
                                   java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

getNodeIdFromJson

public long getNodeIdFromJson(java.lang.String json)

createNodeAndGetId

public long createNodeAndGetId(long nodeType,
                               long parentId,
                               java.lang.String name)
                        throws java.net.MalformedURLException,
                               java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

createNode

public java.lang.String createNode(long nodeType,
                                   long parentId,
                                   java.lang.String name)
                            throws java.net.MalformedURLException,
                                   java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

createFolderAndGetId

public long createFolderAndGetId(long parentId,
                                 java.lang.String name)
                          throws java.net.MalformedURLException,
                                 java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

createFolder

public java.lang.String createFolder(long parentId,
                                     java.lang.String name)
                              throws java.net.MalformedURLException,
                                     java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

uploadDocumentAndGetId

public long uploadDocumentAndGetId(long folderId,
                                   java.lang.String filename,
                                   java.lang.String filepath)
                            throws java.net.MalformedURLException,
                                   java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

uploadDocumentAndGetId

public long uploadDocumentAndGetId(long folderId,
                                   java.lang.String filename,
                                   java.io.File file)
                            throws java.net.MalformedURLException,
                                   java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

uploadDocument

public java.lang.String uploadDocument(long folderId,
                                       java.lang.String filename,
                                       java.lang.String filepath)
                                throws java.net.MalformedURLException,
                                       java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

uploadDocument

public java.lang.String uploadDocument(long folderId,
                                       java.lang.String filename,
                                       java.io.File file)
                                throws java.net.MalformedURLException,
                                       java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

downloadDocument

public void downloadDocument(long nodeId,
                             java.lang.String localFilePath)
                      throws java.net.MalformedURLException,
                             java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

downloadFolderContents

public void downloadFolderContents(long nodeId,
                                   java.lang.String localFolderPath)
                            throws java.net.MalformedURLException,
                                   java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

renameNode

public java.lang.String renameNode(long nodeId,
                                   java.lang.String newName)
                            throws java.net.MalformedURLException,
                                   java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

moveNode

public java.lang.String moveNode(long nodeId,
                                 long newParent)
                          throws java.net.MalformedURLException,
                                 java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

deleteNode

public java.lang.String deleteNode(long nodeId)
                            throws java.net.MalformedURLException,
                                   java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

removePublicAccess

public java.lang.String removePublicAccess(long nodeId)
                                    throws java.net.MalformedURLException,
                                           java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

getEnterpriseChildrenJson

public java.lang.String getEnterpriseChildrenJson()
                                           throws java.net.MalformedURLException,
                                                  java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

getEnterpriseChildren

public OtcsNode[] getEnterpriseChildren()
                                 throws java.net.MalformedURLException,
                                        java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

getChildrenJson

public java.lang.String getChildrenJson(long nodeId)
                                 throws java.net.MalformedURLException,
                                        java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

getChildren

public OtcsNode[] getChildren(long nodeId)
                       throws java.net.MalformedURLException,
                              java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

getPermissionsJson

public java.lang.String getPermissionsJson(long nodeId)
                                    throws java.net.MalformedURLException,
                                           java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

getPermissions

public OtcsPermissions[] getPermissions(long nodeId)
                                 throws java.net.MalformedURLException,
                                        java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException