|
CStockage 4.2_beta-RC-1 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.esupportail.portal.channels.CStockage.provider.access.ServerAccess
org.esupportail.portal.channels.CStockage.provider.access.WebdavAccessImpl
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 |
public WebdavAccessImpl()
Method Detail |
public void init(Space space) throws java.net.MalformedURLException, PropertiesException
init
in class ServerAccess
space
- the space corresponding to the server access
java.net.MalformedURLException
PropertiesException
public void connect() throws ServerException, BadConnexionParameters
connect
in class ServerAccess
ServerException
BadConnexionParameters
public void disconnect() throws ServerException
disconnect
in class ServerAccess
ServerException
public java.io.InputStream getMethodData(java.lang.String fullPath) throws java.io.IOException
getMethodData
in class ServerAccess
fullPath
- the full resource path
java.io.IOException
public ChannelResource[] ls(java.lang.String path, java.lang.String targetDirectory) throws NotExistsResourceException, ApplicationException, NotAuthorizedException
ls
in class ServerAccess
path
- directory path on the dav servertargetDirectory
- the directory name to list
NotExistsResourceException
ApplicationException
NotAuthorizedException
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
in class ServerAccess
fileName
- the input file namefileStream
- the input file streampath
- the path
ApplicationException
ServerException
NotExistsResourceException
StillExistsException
BadFormatException
UploadException
EmptyFileOnUploadException
OverQuotaException
NotAuthorizedDeleteException
NotAuthorizedUploadException
NotAuthorizedException
PropertiesException
public boolean delete(java.lang.String file, java.lang.String path) throws ApplicationException, DeleteException, NotAuthorizedDeleteException, NotExistsResourceException, NotAuthorizedException
delete
in class ServerAccess
file
- file/directory to deletepath
- path where is file/directory
ApplicationException
DeleteException
NotAuthorizedDeleteException
NotExistsResourceException
NotAuthorizedException
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
in class ServerAccess
oldName
- file/directory to renamenewName
- new name of the file/directorypath
- path where is file/directory
StillExistsException
BadFormatException
ApplicationException
RenameException
NotAuthorizedRenameException
NotExistsResourceException
NotAuthorizedException
PropertiesException
public boolean createDir(java.lang.String name, java.lang.String path) throws ApplicationException, CreateDirectoryException, StillExistsException, BadFormatException, NotAuthorizedNewDirException, NotExistsResourceException, NotAuthorizedException, PropertiesException
createDir
in class ServerAccess
name
- file/directory to deletepath
- path where is file/directory
ApplicationException
CreateDirectoryException
StillExistsException
BadFormatException
NotAuthorizedNewDirException
NotExistsResourceException
NotAuthorizedException
PropertiesException
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
canPaste
in class ServerAccess
fromSpace
- the space from whitch we want to pastetoSpaceKey
- the space key where we want to pasteclipboardPath
- the path where is the clipboadclipboard
- the containt of the clipboardcurentDirPath
- the path of the curent dir
ApplicationException
PasteInChildDirectoryException
PasteWithSameNameException
PasteDeletedResourceException
NotAuthorizedException
public ChannelResource download(java.lang.String name, java.lang.String path) throws DownloadException
download
in class ServerAccess
name
- the file namepath
- the path where to find the file
DownloadException
public boolean exists(java.lang.String resourceName, java.lang.String path) throws ApplicationException, NotAuthorizedException
exists
in class ServerAccess
resourceName
- name of the file/directory to verifypath
- path to find the file/directory
ApplicationException
NotAuthorizedException
public boolean exists(java.lang.String fullPath) throws ApplicationException, NotAuthorizedException
exists
in class ServerAccess
fullPath
- path to find the file/directory
ApplicationException
NotAuthorizedException
public boolean canRead(java.lang.String resourceName, java.lang.String path) throws ApplicationException
canRead
in class ServerAccess
resourceName
- name of the file/directory to verifypath
- path to find the file/directory
ApplicationException
public boolean canRead(java.lang.String path) throws ApplicationException
canRead
in class ServerAccess
path
- path to find the file/directory
ApplicationException
public boolean isDirectory(java.lang.String name, java.lang.String path) throws ApplicationException, NotAuthorizedException, NotExistsResourceException
isDirectory
in class ServerAccess
name
- the name of the resourcepath
- the path
ApplicationException
NotAuthorizedException
NotExistsResourceException
public boolean isEmpty(java.lang.String dir, java.lang.String path) throws ApplicationException, NotExistsResourceException, NotAuthorizedException
isEmpty
in class ServerAccess
dir
- the name of the directorypath
- the path
ApplicationException
NotExistsResourceException
NotAuthorizedException
public java.lang.String getProperty(java.lang.String namespace, java.lang.String path, java.lang.String propertyName) throws ServerException
getProperty
in class ServerAccess
namespace
- the namespace used for this metadatapath
- the resource pathpropertyName
- the property name
ServerException
public boolean setProperty(java.lang.String namespace, java.lang.String path, java.lang.String propertyName, java.lang.String propertyValue) throws ServerException
setProperty
in class ServerAccess
namespace
- the namespace used for this metadatapath
- the resource pathpropertyName
- the name of the property to setpropertyValue
- the value of the property to set
ServerException
public org.esupportail.portal.utils.webdav.acl.EsupPermissions getPermissions(java.lang.String path, java.lang.String permissionType) throws AclReadException, AclAccessException, NotSupportedAclException
getPermissions
in class ServerAccess
path
- the resource pathpermissionType
- the type of permission (read, write, ....)
AclReadException
AclAccessException
NotSupportedAclException
public org.esupportail.portal.utils.webdav.acl.EsupPermissions getPermissions(java.lang.String path) throws AclReadException, AclAccessException, NotSupportedAclException
getPermissions
in class ServerAccess
path
- the resource path
AclReadException
AclAccessException
NotSupportedAclException
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
grant
in class ServerAccess
path
- the resource pathprincipal
- the concerned user rolepermissionType
- the permission type: [read|read-acl|read-current-user-privilege-set|write|write-acl|write-properties|write-content]
AclReadException
AclAccessException
AclWriteException
NotSupportedAclException
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
deny
in class ServerAccess
path
- the resource pathprincipal
- the concerned user rolepermissionType
- the permission type: [read|read-acl|read-current-user-privilege-set|write|write-acl|write-properties|write-content]
AclReadException
AclAccessException
AclWriteException
NotSupportedAclException
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
in class ServerAccess
path
- the resource pathprincipal
- the concerned user rolepermissionType
- the permission type: [read|read-acl|read-current-user-privilege-set|write|write-acl|write-properties|write-content]
AclReadException
AclAccessException
AclWriteException
NotSupportedAclException
public void revokeAllPermissons(java.lang.String path) throws AclReadException, AclAccessException, AclWriteException, NotSupportedAclException
revokeAllPermissons
in class ServerAccess
path
- the resource path
java.io.IOException
org.esupportail.portal.utils.webdav.acl.exception.ReadAclException
org.esupportail.portal.utils.webdav.acl.exception.WriteAclException
AclReadException
AclAccessException
AclWriteException
NotSupportedAclException
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
hasInheritedPermission
in class ServerAccess
path
- the resource pathprincipal
- the concerned user rolepermissionType
- 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
AclReadException
AclAccessException
NotSupportedAclException
public boolean hasNotInheritedPermission(java.lang.String path, java.lang.String principal, java.lang.String permissionType, boolean negative, boolean inheritable) throws AclReadException, AclAccessException, NotSupportedAclException
hasNotInheritedPermission
in class ServerAccess
path
- the resource pathprincipal
- the concerned user rolepermissionType
- 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
AclReadException
AclAccessException
NotSupportedAclException
public boolean[] checkPrivileges(java.lang.String path)
checkPrivileges
in class ServerAccess
path
- the path of the space
public ChannelResource[] ls(java.lang.String fullPath) throws NotExistsResourceException, ApplicationException, NotAuthorizedException
ls
in class ServerAccess
fullPath
- directory path on the dav server
NotExistsResourceException
ApplicationException
NotAuthorizedException
|
CStockage 4.2_beta-RC-1 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |