Overview | Package | Class | Tree | Deprecated | Index | Help
| CStockage 4.2_beta-RC-1 API Documentation
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.esupportail.portal.channels.CStockage.provider.access
Class WebdavAccessImpl

    java.lang.Object
      org.esupportail.portal.channels.CStockage.provider.access.ServerAccess
          org.esupportail.portal.channels.CStockage.provider.access.WebdavAccessImpl

public class WebdavAccessImpl
extends ServerAccess

Id: WebdavAccessImpl.java,v 1.0 14 avr. 2004
Copyright (c) 2004 Esup Portail (www.esup-portail.org)
Classes: WebdavAccessImpl
Original Author: Yohan Colmant
Implements the ServerAccess methods to access a DAV server

Constructor Summary
`WebdavAccessImpl()` Default constructor

Method Summary
`boolean` | `canPaste(Space fromSpace, java.lang.String toSpaceKey, java.lang.String clipboardPath, java.util.Vector clipboard, java.lang.String curentDirPath)` Check if we can paste here
`boolean` | `canRead(java.lang.String path)` Check if we are authorized to read this resource
`boolean` | `canRead(java.lang.String resourceName, java.lang.String path)` Check if we are authorized to read this resource
`boolean[]` | `checkPrivileges(java.lang.String path)` Check The privileges for the current user
`void` | `connect()` Connect this object to the server
`boolean` | `createDir(java.lang.String name, java.lang.String path)` Create the directory given in argument
`boolean` | `delete(java.lang.String file, java.lang.String path)` Delete the resource given in argument
`org.esupportail.portal.utils.webdav.acl.EsupPermissions` | `deny(java.lang.String path, java.lang.String principal, java.lang.String permissionType, boolean inheritable)` Add a deny permission on a resource for a user role specified
`void` | `disconnect()` Disconnection of the server
`ChannelResource` | `download(java.lang.String name, java.lang.String path)` Return the resource associated to the file to download
`boolean` | `exists(java.lang.String fullPath)` Check is the resource exists
`boolean` | `exists(java.lang.String resourceName, java.lang.String path)` Check is the resource exists
`java.io.InputStream` | `getMethodData(java.lang.String fullPath)` Return the stream from a resource
`org.esupportail.portal.utils.webdav.acl.EsupPermissions` | `getPermissions(java.lang.String path)` Get a resource permissions as an EsupPermissions object
`org.esupportail.portal.utils.webdav.acl.EsupPermissions` | `getPermissions(java.lang.String path, java.lang.String permissionType)` Get a resource permissions as an EsupPermissions object
`java.lang.String` | `getProperty(java.lang.String namespace, java.lang.String path, java.lang.String propertyName)` Get a resource's property specified by the path
`org.esupportail.portal.utils.webdav.acl.EsupPermissions` | `grant(java.lang.String path, java.lang.String principal, java.lang.String permissionType, boolean inheritable)` Add a grant permission on a resource for a user role specified
`java.util.Vector` | `hasInheritedPermission(java.lang.String path, java.lang.String principal, java.lang.String permissionType, boolean negative, boolean inheritable)` Check if the specified resource has the inherited permission given in parameter
`boolean` | `hasNotInheritedPermission(java.lang.String path, java.lang.String principal, java.lang.String permissionType, boolean negative, boolean inheritable)` Check if the specified resource has the not inherited permission given in parameter
`void` | `init(Space space)` This method initializes the parameters.
`boolean` | `isDirectory(java.lang.String name, java.lang.String path)` Check if the resource named name is a directory in the path given
`boolean` | `isEmpty(java.lang.String dir, java.lang.String path)` Check if the directory named dir is empty or not.
`ChannelResource[]` | `ls(java.lang.String fullPath)` List all ressources for a given path
`ChannelResource[]` | `ls(java.lang.String path, java.lang.String targetDirectory)` List all ressources for a given path
`boolean` | `rename(java.lang.String oldName, java.lang.String newName, java.lang.String path)` Rename the resource
`org.esupportail.portal.utils.webdav.acl.EsupPermissions` | `revoke(java.lang.String path, java.lang.String principal, java.lang.String permissionType, boolean inheritable)` Revoke permission on a resource for a user role specified
`void` | `revokeAllPermissons(java.lang.String path)` Revoke all the permissions on a resource
`boolean` | `setProperty(java.lang.String namespace, java.lang.String path, java.lang.String propertyName, java.lang.String propertyValue)` Set the property of resource
`boolean` | `upload(java.lang.String fileName, java.io.InputStream fileStream, java.lang.String path)` Upload a file to the path given in argument

Methods inherited from class org.esupportail.portal.channels.CStockage.provider.access.ServerAccess
`copy, move`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### WebdavAccessImpl

    public WebdavAccessImpl()

  Default constructor

Method Detail

### init

    public void init(Space space)
              throws java.net.MalformedURLException,
                     PropertiesException

  This method initializes the parameters. You have to call this method before calling connect method.

  Specified by:
    `init` in class `ServerAccess`
  Parameters:
    `space` - the space corresponding to the server access
  Throws:
    `java.net.MalformedURLException`
    `PropertiesException`

### connect

    public void connect()
                 throws ServerException,
                        BadConnexionParameters

  Connect this object to the server

  Specified by:
    `connect` in class `ServerAccess`
  Throws:
    `ServerException`
    `BadConnexionParameters`

### disconnect

    public void disconnect()
                    throws ServerException

  Disconnection of the server

  Specified by:
    `disconnect` in class `ServerAccess`
  Throws:
    `ServerException`

### getMethodData

    public java.io.InputStream getMethodData(java.lang.String fullPath)
                                      throws java.io.IOException

  Return the stream from a resource

  Specified by:
    `getMethodData` in class `ServerAccess`
  Parameters:
    `fullPath` - the full resource path
  Returns:
    the InputStream
  Throws:
    `java.io.IOException`

### ls

    public ChannelResource[] ls(java.lang.String path,
                                java.lang.String targetDirectory)
                         throws NotExistsResourceException,
                                ApplicationException,
                                NotAuthorizedException

  List all ressources for a given path

  Specified by:
    `ls` in class `ServerAccess`
  Parameters:
    `path` - directory path on the dav server
    `targetDirectory` - the directory name to list
  Returns:
    ChannelWebdavResource array
  Throws:
    `NotExistsResourceException`
    `ApplicationException`
    `NotAuthorizedException`

### upload

    public boolean upload(java.lang.String fileName,
                          java.io.InputStream fileStream,
                          java.lang.String path)
                   throws ApplicationException,
                          ServerException,
                          NotExistsResourceException,
                          StillExistsException,
                          BadFormatException,
                          UploadException,
                          EmptyFileOnUploadException,
                          OverQuotaException,
                          NotAuthorizedDeleteException,
                          NotAuthorizedUploadException,
                          NotAuthorizedException,
                          PropertiesException

  Upload a file to the path given in argument

  Specified by:
    `upload` in class `ServerAccess`
  Parameters:
    `fileName` - the input file name
    `fileStream` - the input file stream
    `path` - the path
  Returns:
    boolean true if no problem, else false
  Throws:
    `ApplicationException`
    `ServerException`
    `NotExistsResourceException`
    `StillExistsException`
    `BadFormatException`
    `UploadException`
    `EmptyFileOnUploadException`
    `OverQuotaException`
    `NotAuthorizedDeleteException`
    `NotAuthorizedUploadException`
    `NotAuthorizedException`
    `PropertiesException`

### delete

    public boolean delete(java.lang.String file,
                          java.lang.String path)
                   throws ApplicationException,
                          DeleteException,
                          NotAuthorizedDeleteException,
                          NotExistsResourceException,
                          NotAuthorizedException

  Delete the resource given in argument

  Specified by:
    `delete` in class `ServerAccess`
  Parameters:
    `file` - file/directory to delete
    `path` - path where is file/directory
  Returns:
    boolean true if well done else false
  Throws:
    `ApplicationException`
    `DeleteException`
    `NotAuthorizedDeleteException`
    `NotExistsResourceException`
    `NotAuthorizedException`

### rename

    public boolean rename(java.lang.String oldName,
                          java.lang.String newName,
                          java.lang.String path)
                   throws StillExistsException,
                          BadFormatException,
                          ApplicationException,
                          RenameException,
                          NotAuthorizedRenameException,
                          NotExistsResourceException,
                          NotAuthorizedException,
                          PropertiesException

  Rename the resource

  Specified by:
    `rename` in class `ServerAccess`
  Parameters:
    `oldName` - file/directory to rename
    `newName` - new name of the file/directory
    `path` - path where is file/directory
  Returns:
    boolean true if well done else false
  Throws:
    `StillExistsException`
    `BadFormatException`
    `ApplicationException`
    `RenameException`
    `NotAuthorizedRenameException`
    `NotExistsResourceException`
    `NotAuthorizedException`
    `PropertiesException`

### createDir

    public boolean createDir(java.lang.String name,
                             java.lang.String path)
                      throws ApplicationException,
                             CreateDirectoryException,
                             StillExistsException,
                             BadFormatException,
                             NotAuthorizedNewDirException,
                             NotExistsResourceException,
                             NotAuthorizedException,
                             PropertiesException

  Create the directory given in argument

  Specified by:
    `createDir` in class `ServerAccess`
  Parameters:
    `name` - file/directory to delete
    `path` - path where is file/directory
  Returns:
    boolean true if well done else false
  Throws:
    `ApplicationException`
    `CreateDirectoryException`
    `StillExistsException`
    `BadFormatException`
    `NotAuthorizedNewDirException`
    `NotExistsResourceException`
    `NotAuthorizedException`
    `PropertiesException`

### canPaste

    public boolean canPaste(Space fromSpace,
                            java.lang.String toSpaceKey,
                            java.lang.String clipboardPath,
                            java.util.Vector clipboard,
                            java.lang.String curentDirPath)
                     throws ApplicationException,
                            PasteInChildDirectoryException,
                            PasteWithSameNameException,
                            PasteDeletedResourceException,
                            NotAuthorizedException

  Check if we can paste here

  Specified by:
    `canPaste` in class `ServerAccess`
  Parameters:
    `fromSpace` - the space from whitch we want to paste
    `toSpaceKey` - the space key where we want to paste
    `clipboardPath` - the path where is the clipboad
    `clipboard` - the containt of the clipboard
    `curentDirPath` - the path of the curent dir
  Returns:
    true if ok excpetion else
  Throws:
    `ApplicationException`
    `PasteInChildDirectoryException`
    `PasteWithSameNameException`
    `PasteDeletedResourceException`
    `NotAuthorizedException`

### download

    public ChannelResource download(java.lang.String name,
                                    java.lang.String path)
                             throws DownloadException

  Return the resource associated to the file to download

  Specified by:
    `download` in class `ServerAccess`
  Parameters:
    `name` - the file name
    `path` - the path where to find the file
  Returns:
    the ChannelWebdavResource
  Throws:
    `DownloadException`

### exists

    public boolean exists(java.lang.String resourceName,
                          java.lang.String path)
                   throws ApplicationException,
                          NotAuthorizedException

  Check is the resource exists

  Specified by:
    `exists` in class `ServerAccess`
  Parameters:
    `resourceName` - name of the file/directory to verify
    `path` - path to find the file/directory
  Returns:
    true if file/directory exists else false
  Throws:
    `ApplicationException`
    `NotAuthorizedException`

### exists

    public boolean exists(java.lang.String fullPath)
                   throws ApplicationException,
                          NotAuthorizedException

  Check is the resource exists

  Specified by:
    `exists` in class `ServerAccess`
  Parameters:
    `fullPath` - path to find the file/directory
  Returns:
    true if file/directory exists else false
  Throws:
    `ApplicationException`
    `NotAuthorizedException`

### canRead

    public boolean canRead(java.lang.String resourceName,
                           java.lang.String path)
                    throws ApplicationException

  Check if we are authorized to read this resource

  Specified by:
    `canRead` in class `ServerAccess`
  Parameters:
    `resourceName` - name of the file/directory to verify
    `path` - path to find the file/directory
  Returns:
    true if authorized else false
  Throws:
    `ApplicationException`

### canRead

    public boolean canRead(java.lang.String path)
                    throws ApplicationException

  Check if we are authorized to read this resource

  Specified by:
    `canRead` in class `ServerAccess`
  Parameters:
    `path` - path to find the file/directory
  Returns:
    true if authorized else false
  Throws:
    `ApplicationException`

### isDirectory

    public boolean isDirectory(java.lang.String name,
                               java.lang.String path)
                        throws ApplicationException,
                               NotAuthorizedException,
                               NotExistsResourceException

  Check if the resource named name is a directory in the path given

  Specified by:
    `isDirectory` in class `ServerAccess`
  Parameters:
    `name` - the name of the resource
    `path` - the path
  Returns:
    true if directory, false else
  Throws:
    `ApplicationException`
    `NotAuthorizedException`
    `NotExistsResourceException`

### isEmpty

    public boolean isEmpty(java.lang.String dir,
                           java.lang.String path)
                    throws ApplicationException,
                           NotExistsResourceException,
                           NotAuthorizedException

  Check if the directory named dir is empty or not. We suppose that dir has been checked as a directory before

  Specified by:
    `isEmpty` in class `ServerAccess`
  Parameters:
    `dir` - the name of the directory
    `path` - the path
  Returns:
    true if empty, false else
  Throws:
    `ApplicationException`
    `NotExistsResourceException`
    `NotAuthorizedException`

### getProperty

    public java.lang.String getProperty(java.lang.String namespace,
                                        java.lang.String path,
                                        java.lang.String propertyName)
                                 throws ServerException

  Get a resource's property specified by the path

  Specified by:
    `getProperty` in class `ServerAccess`
  Parameters:
    `namespace` - the namespace used for this metadata
    `path` - the resource path
    `propertyName` - the property name
  Returns:
    the property as a String object
  Throws:
    `ServerException`

### setProperty

    public boolean setProperty(java.lang.String namespace,
                               java.lang.String path,
                               java.lang.String propertyName,
                               java.lang.String propertyValue)
                        throws ServerException

  Set the property of resource

  Specified by:
    `setProperty` in class `ServerAccess`
  Parameters:
    `namespace` - the namespace used for this metadata
    `path` - the resource path
    `propertyName` - the name of the property to set
    `propertyValue` - the value of the property to set
  Returns:
    true if well done
  Throws:
    `ServerException`

### getPermissions

    public org.esupportail.portal.utils.webdav.acl.EsupPermissions getPermissions(java.lang.String path,
                                                                                  java.lang.String permissionType)
                                                                           throws AclReadException,
                                                                                  AclAccessException,
                                                                                  NotSupportedAclException

  Get a resource permissions as an EsupPermissions object

  Specified by:
    `getPermissions` in class `ServerAccess`
  Parameters:
    `path` - the resource path
    `permissionType` - the type of permission (read, write, ....)
  Returns:
    an EsupPermissions object representing the permissions
  Throws:
    `AclReadException`
    `AclAccessException`
    `NotSupportedAclException`

### getPermissions

    public org.esupportail.portal.utils.webdav.acl.EsupPermissions getPermissions(java.lang.String path)
                                                                           throws AclReadException,
                                                                                  AclAccessException,
                                                                                  NotSupportedAclException

  Get a resource permissions as an EsupPermissions object

  Specified by:
    `getPermissions` in class `ServerAccess`
  Parameters:
    `path` - the resource path
  Returns:
    an EsupPermissions object representing the permissions
  Throws:
    `AclReadException`
    `AclAccessException`
    `NotSupportedAclException`

### grant

    public org.esupportail.portal.utils.webdav.acl.EsupPermissions grant(java.lang.String path,
                                                                         java.lang.String principal,
                                                                         java.lang.String permissionType,
                                                                         boolean inheritable)
                                                                  throws AclReadException,
                                                                         AclAccessException,
                                                                         AclWriteException,
                                                                         NotSupportedAclException

  Add a grant permission on a resource for a user role specified

  Specified by:
    `grant` in class `ServerAccess`
  Parameters:
    `path` - the resource path
    `principal` - the concerned user role
    `permissionType` - the permission type: [read|read-acl|read-current-user-privilege-set|write|write-acl|write-properties|write-content]
  Returns:
    the EsupPermissions object modified by the action
  Throws:
    `AclReadException`
    `AclAccessException`
    `AclWriteException`
    `NotSupportedAclException`

### deny

    public org.esupportail.portal.utils.webdav.acl.EsupPermissions deny(java.lang.String path,
                                                                        java.lang.String principal,
                                                                        java.lang.String permissionType,
                                                                        boolean inheritable)
                                                                 throws AclReadException,
                                                                        AclAccessException,
                                                                        AclWriteException,
                                                                        NotSupportedAclException

  Add a deny permission on a resource for a user role specified

  Specified by:
    `deny` in class `ServerAccess`
  Parameters:
    `path` - the resource path
    `principal` - the concerned user role
    `permissionType` - the permission type: [read|read-acl|read-current-user-privilege-set|write|write-acl|write-properties|write-content]
  Returns:
    the EsupPermissions object modified by the action
  Throws:
    `AclReadException`
    `AclAccessException`
    `AclWriteException`
    `NotSupportedAclException`

### revoke

    public org.esupportail.portal.utils.webdav.acl.EsupPermissions revoke(java.lang.String path,
                                                                          java.lang.String principal,
                                                                          java.lang.String permissionType,
                                                                          boolean inheritable)
                                                                   throws AclReadException,
                                                                          AclAccessException,
                                                                          AclWriteException,
                                                                          NotSupportedAclException

  Revoke permission on a resource for a user role specified

  Specified by:
    `revoke` in class `ServerAccess`
  Parameters:
    `path` - the resource path
    `principal` - the concerned user role
    `permissionType` - the permission type: [read|read-acl|read-current-user-privilege-set|write|write-acl|write-properties|write-content]
  Returns:
    the EsupPermissions object modified by the action
  Throws:
    `AclReadException`
    `AclAccessException`
    `AclWriteException`
    `NotSupportedAclException`

### revokeAllPermissons

    public void revokeAllPermissons(java.lang.String path)
                             throws AclReadException,
                                    AclAccessException,
                                    AclWriteException,
                                    NotSupportedAclException

  Revoke all the permissions on a resource

  Specified by:
    `revokeAllPermissons` in class `ServerAccess`
  Parameters:
    `path` - the resource path
  Throws:
    `java.io.IOException`
    `org.esupportail.portal.utils.webdav.acl.exception.ReadAclException`
    `org.esupportail.portal.utils.webdav.acl.exception.WriteAclException`
    `AclReadException`
    `AclAccessException`
    `AclWriteException`
    `NotSupportedAclException`

### hasInheritedPermission

    public java.util.Vector hasInheritedPermission(java.lang.String path,
                                                   java.lang.String principal,
                                                   java.lang.String permissionType,
                                                   boolean negative,
                                                   boolean inheritable)
                                            throws AclReadException,
                                                   AclAccessException,
                                                   NotSupportedAclException

  Check if the specified resource has the inherited permission given in parameter

  Specified by:
    `hasInheritedPermission` in class `ServerAccess`
  Parameters:
    `path` - the resource path
    `principal` - the concerned user role
    `permissionType` - the permission type: [read|read-acl|read-current-user-privilege-set|write|write-acl|write-properties|write-content]
    `negative` - false for grant, true for deny
  Returns:
    null if not inherited permission, else return the inherited permissions
  Throws:
    `AclReadException`
    `AclAccessException`
    `NotSupportedAclException`

### hasNotInheritedPermission

    public boolean hasNotInheritedPermission(java.lang.String path,
                                             java.lang.String principal,
                                             java.lang.String permissionType,
                                             boolean negative,
                                             boolean inheritable)
                                      throws AclReadException,
                                             AclAccessException,
                                             NotSupportedAclException

  Check if the specified resource has the not inherited permission given in parameter

  Specified by:
    `hasNotInheritedPermission` in class `ServerAccess`
  Parameters:
    `path` - the resource path
    `principal` - the concerned user role
    `permissionType` - the permission type: [read|read-acl|read-current-user-privilege-set|write|write-acl|write-properties|write-content]
    `negative` - false for grant, true for deny
  Throws:
    `AclReadException`
    `AclAccessException`
    `NotSupportedAclException`

### checkPrivileges

    public boolean[] checkPrivileges(java.lang.String path)

  Check The privileges for the current user

  Specified by:
    `checkPrivileges` in class `ServerAccess`
  Parameters:
    `path` - the path of the space
  Returns:
    an array containing the values of reading, writing and sharing

### ls

    public ChannelResource[] ls(java.lang.String fullPath)
                         throws NotExistsResourceException,
                                ApplicationException,
                                NotAuthorizedException

  List all ressources for a given path

  Specified by:
    `ls` in class `ServerAccess`
  Parameters:
    `fullPath` - directory path on the dav server
  Returns:
    ChannelWebdavResource array
  Throws:
    `NotExistsResourceException`
    `ApplicationException`
    `NotAuthorizedException`

Overview | Package | Class | Tree | Deprecated | Index | Help
| CStockage 4.2_beta-RC-1 API Documentation
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD