Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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

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

Direct Known Subclasses:
  CifsAccessImpl, WebdavAccessImpl

public abstract class ServerAccess
extends java.lang.Object

Id: ServerAccess.java,v 1.0 14 avr. 2004
Copyright (c) 2004 Esup Portail (www.esup-portail.org)
Classes: ServerAccess
Original Author: Yohan Colmant
Interface for the dav access

Field Summary
`protected static Log` | `log` Logger object

Constructor Summary
`ServerAccess()`

Method Summary
`abstract 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
`abstract boolean` | `canRead(java.lang.String path)` Check if we are authorized to read this resource
`abstract boolean` | `canRead(java.lang.String resourceName, java.lang.String path)` Check if we are authorized to read this resource
`abstract void` | `connect()` Connect this object to the server
`boolean` | `copy(java.lang.String resource, Space fromSpace, java.lang.String fromPath, java.lang.String toSpaceKey, java.lang.String toPath)` Copy method
`abstract boolean` | `createDir(java.lang.String name, java.lang.String path)` Create the directory given in argument
`abstract boolean` | `delete(java.lang.String file, java.lang.String path)` Delete the resource given in argument
`abstract org.esupportail.portal.utils.webdav.acl.EsupPermissions` | `deny(java.lang.String path, java.lang.String principal, java.lang.String permissionType)` Add a deny permission on a resource for a user role specified
`abstract void` | `disconnect()` Disconnection of the server
`protected abstract boolean` | `distantCopy(java.lang.String resource, ServerAccess fromAccess, java.lang.String fromPath, java.lang.String toPath)` The distant copy method
`abstract ChannelResource` | `download(java.lang.String name, java.lang.String path)` Return the resource associated to the file to download
`abstract boolean` | `exists(java.lang.String fullPath)` Check is the resource exists
`abstract boolean` | `exists(java.lang.String resourceName, java.lang.String path)` Check is the resource exists
`abstract java.io.InputStream` | `getMethodData(java.lang.String fullPath)` Return the stream from a resource
`abstract org.esupportail.portal.utils.webdav.acl.EsupPermissions` | `getPermissions(java.lang.String path)` Get a resource permissions as an EsupPermissions object
`abstract org.esupportail.portal.utils.webdav.acl.EsupPermissions` | `getPermissions(java.lang.String path, java.lang.String permissionType)` Get a resource permissions as an EsupPermissions object
`abstract 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
`abstract org.esupportail.portal.utils.webdav.acl.EsupPermissions` | `grant(java.lang.String path, java.lang.String principal, java.lang.String permissionType)` Add a grant permission on a resource for a user role specified
`abstract java.util.Vector` | `hasInheritedPermission(java.lang.String path, java.lang.String principal, java.lang.String permissionType, boolean negative)` Check if the specified resource has the inherited permission given in parameter
`abstract boolean` | `hasNotInheritedPermission(java.lang.String path, java.lang.String principal, java.lang.String permissionType, boolean negative)` Check if the specified resource has the not inherited permission given in parameter
`abstract void` | `init(Space space)` This method initializes the parameters.
`abstract boolean` | `isDirectory(java.lang.String name, java.lang.String path)` Check if the resource named name is a directory in the path given
`abstract boolean` | `isEmpty(java.lang.String dir, java.lang.String path)` Check if the directory named dir is empty or not.
`protected abstract boolean` | `localCopy(java.lang.String resource, java.lang.String fromPath, java.lang.String toPath)` Local copy method
`protected abstract boolean` | `localMove(java.lang.String resource, java.lang.String fromPath, java.lang.String toPath)` Local move method
`abstract ChannelResource[]` | `ls(java.lang.String fullPath)` List all ressources for a given path
`abstract ChannelResource[]` | `ls(java.lang.String path, java.lang.String targetDirectory)` List all ressources for a given path
`boolean` | `move(java.lang.String resource, Space fromSpace, java.lang.String fromPath, java.lang.String toSpaceKey, java.lang.String toPath)` Move method
`abstract boolean` | `rename(java.lang.String oldName, java.lang.String newName, java.lang.String path)` Rename the resource
`abstract org.esupportail.portal.utils.webdav.acl.EsupPermissions` | `revoke(java.lang.String path, java.lang.String principal, java.lang.String permissionType)` Revoke permission on a resource for a user role specified
`abstract boolean` | `setProperty(java.lang.String namespace, java.lang.String path, java.lang.String propertyName, java.lang.String propertyValue)` Set the property of resource
`abstract 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 java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### log

    protected static final Log log

  Logger object

Constructor Detail

### ServerAccess

    public ServerAccess()

Method Detail

### init

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

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

  Parameters:
    `space` - the space corresponding to the server access
  Throws:
    `java.net.MalformedURLException`
    `PropertiesException`

### connect

    public abstract void connect()
                          throws ServerException,
                                 BadConnexionParameters

  Connect this object to the server

  Throws:
    `ServerException`
    `BadConnexionParameters`

### disconnect

    public abstract void disconnect()
                             throws ServerException

  Disconnection of the server

  Throws:
    `ServerException`

### ls

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

  List all ressources for a given path

  Parameters:
    `fullPath` - directory path on the dav server
  Returns:
    ChannelWebdavResource array
  Throws:
    `NotExistsResourceException`
    `ApplicationException`
    `NotAuthorizedException`

### ls

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

  List all ressources for a given path

  Parameters:
    `path` - directory path on the dav server
    `targetDirectory` - the directory name to list
  Returns:
    ChannelWebdavResource array
  Throws:
    `NotExistsResourceException`
    `ApplicationException`
    `NotAuthorizedException`

### upload

    public abstract 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

  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 abstract boolean delete(java.lang.String file,
                                   java.lang.String path)
                            throws ApplicationException,
                                   DeleteException,
                                   NotAuthorizedDeleteException,
                                   NotExistsResourceException,
                                   NotAuthorizedException

  Delete the resource given in argument

  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 abstract 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

  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 abstract 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

  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 abstract 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

  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`

### copy

    public boolean copy(java.lang.String resource,
                        Space fromSpace,
                        java.lang.String fromPath,
                        java.lang.String toSpaceKey,
                        java.lang.String toPath)
                 throws ChannelException,
                        CopyException,
                        ApplicationException,
                        OverQuotaException,
                        PasteNotAuthorizedResourceException,
                        NotExistsResourceException,
                        PasteNotAuthorizedResourceException,
                        NotAuthorizedException,
                        NotAuthorizedUploadException

  Copy method

  Parameters:
    `resource` - resource to copy
    `fromSpace` - the space from witch we want to move
    `fromPath` - path where is the resource
    `toSpaceKey` - the space key to witch we want to move
    `toPath` - path to copy the resource
  Returns:
    boolean true if well done else false
  Throws:
    `ChannelException`
    `CopyException`
    `ApplicationException`
    `OverQuotaException`
    `PasteNotAuthorizedResourceException`
    `NotExistsResourceException`
    `PasteNotAuthorizedResourceException`
    `NotAuthorizedException`
    `NotAuthorizedUploadException`

### localCopy

    protected abstract boolean localCopy(java.lang.String resource,
                                         java.lang.String fromPath,
                                         java.lang.String toPath)
                                  throws CopyException,
                                         ApplicationException,
                                         OverQuotaException,
                                         NotExistsResourceException,
                                         PasteNotAuthorizedResourceException,
                                         NotAuthorizedException,
                                         NotAuthorizedUploadException

  Local copy method

  Parameters:
    `resource` - resource to copy
    `fromPath` - path where is the resource
    `toPath` - path to copy the resource
  Returns:
    boolean true if well done else false
  Throws:
    `CopyException`
    `ApplicationException`
    `OverQuotaException`
    `NotExistsResourceException`
    `PasteNotAuthorizedResourceException`
    `NotAuthorizedException`
    `NotAuthorizedUploadException`

### distantCopy

    protected abstract boolean distantCopy(java.lang.String resource,
                                           ServerAccess fromAccess,
                                           java.lang.String fromPath,
                                           java.lang.String toPath)
                                    throws CopyException,
                                           ApplicationException,
                                           OverQuotaException,
                                           NotExistsResourceException,
                                           PasteNotAuthorizedResourceException,
                                           NotAuthorizedException,
                                           NotAuthorizedUploadException,
                                           ServerException

  The distant copy method

  Parameters:
    `resource` - resource to copy
    `fromAccess` - the space access from witch we want to copy
    `fromPath` - path where is the resource
    `toPath` - path to copy the resource
  Returns:
    boolean true if well done else false
  Throws:
    `CopyException`
    `ApplicationException`
    `OverQuotaException`
    `NotExistsResourceException`
    `PasteNotAuthorizedResourceException`
    `NotAuthorizedException`
    `NotAuthorizedUploadException`
    `ServerException`

### move

    public boolean move(java.lang.String resource,
                        Space fromSpace,
                        java.lang.String fromPath,
                        java.lang.String toSpaceKey,
                        java.lang.String toPath)
                 throws ChannelException,
                        MoveException,
                        ApplicationException,
                        OverQuotaException,
                        PasteNotAuthorizedResourceException,
                        NotExistsResourceException,
                        PasteNotAuthorizedResourceException,
                        NotAuthorizedException,
                        NotAuthorizedUploadException

  Move method

  Parameters:
    `resource` - resource to move
    `fromSpace` - the space from witch we want to move
    `fromPath` - path where is the resource
    `toSpaceKey` - the space key to witch we want to move
    `toPath` - path to move the resource
  Returns:
    boolean true if well done else false
  Throws:
    `ChannelException`
    `ApplicationException`
    `MoveException`
    `PasteNotAuthorizedResourceException`
    `NotExistsResourceException`
    `PasteNotAuthorizedResourceException`
    `NotAuthorizedException`
    `NotAuthorizedUploadException`
    `OverQuotaException`

### localMove

    protected abstract boolean localMove(java.lang.String resource,
                                         java.lang.String fromPath,
                                         java.lang.String toPath)
                                  throws MoveException,
                                         ApplicationException,
                                         OverQuotaException,
                                         PasteNotAuthorizedResourceException,
                                         NotExistsResourceException,
                                         PasteNotAuthorizedResourceException,
                                         NotAuthorizedException,
                                         NotAuthorizedUploadException

  Local move method

  Parameters:
    `resource` - resource to move
    `fromPath` - path where is the resource
    `toPath` - path to copy the resource
  Returns:
    boolean true if well done else false
  Throws:
    `MoveException`
    `ApplicationException`
    `OverQuotaException`
    `PasteNotAuthorizedResourceException`
    `NotExistsResourceException`
    `PasteNotAuthorizedResourceException`
    `NotAuthorizedException`
    `NotAuthorizedUploadException`

### download

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

  Return the resource associated to the file to download

  Parameters:
    `name` - the file name
    `path` - the path where to find the file
  Returns:
    the ChannelWebdavResource
  Throws:
    `DownloadException`

### getMethodData

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

  Return the stream from a resource

  Parameters:
    `fullPath` - the full resource path
  Returns:
    the InputStream
  Throws:
    `java.io.IOException`

### exists

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

  Check is the resource exists

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

### exists

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

  Check is the resource exists

  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`

### canRead

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

  Check if we are authorized to read this resource

  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 abstract boolean canRead(java.lang.String path)
                             throws ApplicationException

  Check if we are authorized to read this resource

  Parameters:
    `path` - path to find the file/directory
  Returns:
    true if authorized else false
  Throws:
    `ApplicationException`

### isDirectory

    public abstract 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

  Parameters:
    `name` - the name of the resource
    `path` - the path
  Returns:
    true if directory, false else
  Throws:
    `ApplicationException`
    `NotAuthorizedException`
    `NotExistsResourceException`

### isEmpty

    public abstract 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

  Parameters:
    `dir` - the name of the directory
    `path` - the path
  Returns:
    true if empty, false else
  Throws:
    `ApplicationException`
    `NotExistsResourceException`
    `NotAuthorizedException`

### getProperty

    public abstract 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

  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 abstract 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

  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 abstract 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

  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 abstract org.esupportail.portal.utils.webdav.acl.EsupPermissions getPermissions(java.lang.String path)
                                                                                    throws AclReadException,
                                                                                           AclAccessException,
                                                                                           NotSupportedAclException

  Get a resource permissions as an EsupPermissions object

  Parameters:
    `path` - the resource path
  Returns:
    an EsupPermissions object representing the permissions
  Throws:
    `AclReadException`
    `AclAccessException`
    `NotSupportedAclException`

### grant

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

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

  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 abstract org.esupportail.portal.utils.webdav.acl.EsupPermissions deny(java.lang.String path,
                                                                                 java.lang.String principal,
                                                                                 java.lang.String permissionType)
                                                                          throws AclReadException,
                                                                                 AclAccessException,
                                                                                 AclWriteException,
                                                                                 NotSupportedAclException

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

  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 abstract org.esupportail.portal.utils.webdav.acl.EsupPermissions revoke(java.lang.String path,
                                                                                   java.lang.String principal,
                                                                                   java.lang.String permissionType)
                                                                            throws AclReadException,
                                                                                   AclAccessException,
                                                                                   AclWriteException,
                                                                                   NotSupportedAclException

  Revoke permission on a resource for a user role specified

  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`

### hasInheritedPermission

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

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

  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 abstract boolean hasNotInheritedPermission(java.lang.String path,
                                                      java.lang.String principal,
                                                      java.lang.String permissionType,
                                                      boolean negative)
                                               throws AclReadException,
                                                      AclAccessException,
                                                      NotSupportedAclException

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

  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`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD