|
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.CifsAccessImpl
Implements the ServerAccess interface to access a CIFS(SMB) server
Id: CifsAccessImpl.java
Classes: CifsAccessImpl
Creation date: 17/12/2004
Last modification: 24/02/2005
Modifications :
24/02/2005 Thomas Bellembois Correcting some bugs
Copyright (c) 2004 Esup Portail (www.esup-portail.org).
Notes :
/myDirectory/mySubDirectory/myResource is called full path (of myResource)
whereas an URI like /myDirectory/mySubDirectory is called path (of myResource)/myResource,
or /myResource/, but also myResource. Even if the resource is a file you can write /myFile.txt/ !
| Constructor Summary | |
CifsAccessImpl()
|
|
| Method Summary | |
boolean |
canPaste(Space fromSpace,
java.lang.String toSpaceKey,
java.lang.String clipboardPath,
java.util.Vector clipboard,
java.lang.String curentDirPath)
Check that we can paste a file in the target directory This version does not support inter spaces paste ! |
boolean |
canRead(java.lang.String path)
Check if we are authorized to read this resource (file or directory) |
boolean |
canRead(java.lang.String resourceName,
java.lang.String path)
Check if we are authorized to read this resource (file or directory) |
boolean[] |
checkPrivileges(java.lang.String path)
Check The privileges for the current user |
void |
connect()
Connect to the server |
boolean |
createDir(java.lang.String name,
java.lang.String path)
Create a directory |
boolean |
delete(java.lang.String file,
java.lang.String path)
Delete a resource (file or directory) |
org.esupportail.portal.utils.webdav.acl.EsupPermissions |
deny(java.lang.String path,
java.lang.String principal,
java.lang.String permissionType,
boolean inheritable)
not implemented |
void |
disconnect()
Disconnect from the server |
ChannelResource |
download(java.lang.String name,
java.lang.String path)
Download a file |
boolean |
exists(java.lang.String fullPath)
Check is the resource (file or directory) exists |
boolean |
exists(java.lang.String resourceName,
java.lang.String path)
Check is the resource (file or directory) exists |
java.io.InputStream |
getMethodData(java.lang.String fullPath)
Return the stream of a file |
org.esupportail.portal.utils.webdav.acl.EsupPermissions |
getPermissions(java.lang.String path)
not implemented |
org.esupportail.portal.utils.webdav.acl.EsupPermissions |
getPermissions(java.lang.String path,
java.lang.String permissionType)
not implemented |
java.lang.String |
getProperty(java.lang.String namespace,
java.lang.String path,
java.lang.String propertyName)
not implemented |
org.esupportail.portal.utils.webdav.acl.EsupPermissions |
grant(java.lang.String path,
java.lang.String principal,
java.lang.String permissionType,
boolean inheritable)
not implemented |
java.util.Vector |
hasInheritedPermission(java.lang.String path,
java.lang.String principal,
java.lang.String permissionType,
boolean negative,
boolean inheritable)
not implemented |
boolean |
hasNotInheritedPermission(java.lang.String path,
java.lang.String principal,
java.lang.String permissionType,
boolean negative,
boolean inheritable)
not implemented |
void |
init(Space space)
Initializes the CIFS server parameters You have to call this method before calling the connect method. |
boolean |
isDirectory(java.lang.String name,
java.lang.String path)
Check that the resource is a directory |
boolean |
isEmpty(java.lang.String dir,
java.lang.String path)
Check that the directory is empty |
ChannelResource[] |
ls(java.lang.String fullPath)
List all the resources of a directory |
ChannelResource[] |
ls(java.lang.String path,
java.lang.String targetDirectory)
List all the resources of the given directory |
boolean |
rename(java.lang.String oldName,
java.lang.String newName,
java.lang.String path)
Rename a resource (file or directory) |
org.esupportail.portal.utils.webdav.acl.EsupPermissions |
revoke(java.lang.String path,
java.lang.String principal,
java.lang.String permissionType,
boolean inheritable)
not implemented |
void |
revokeAllPermissons(java.lang.String path)
not implemented |
boolean |
setProperty(java.lang.String namespace,
java.lang.String path,
java.lang.String propertyName,
java.lang.String propertyValue)
not implemented |
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 CifsAccessImpl()
| Method Detail |
public void init(Space space)
throws java.net.MalformedURLException,
PropertiesException
http://jcifs.samba.org/src/docs/api/login : login to connect to the serverpassword : password to connect to the serveruri : URL of the CIFS server - example : smb://myServer:myPortresourcePath : resource full path on the CIFS server - example : /myHomeDir/myDirectory/myFile.txtdomain : domain of the CIFS serverresolveOrder : A comma separated list of name resolution method identifiers that specify which methods will be used and in what order to resolve hostnames. The possible identifiers in default order are LMHOSTS, WINS, BCAST, and DNS.disablePlainTextPassword : Plain text passwords should never be used and are disabled by default. To enable jCIFS to use plain text password this property must be set to false.
init in class ServerAccessspace - space used to get connexion parameters
java.net.MalformedURLException
PropertiesException
public void connect()
throws ServerException,
BadConnexionParameters
connect in class ServerAccessServerException
BadConnexionParameters
public void disconnect()
throws ServerException
disconnect in class ServerAccessServerException
public ChannelResource[] ls(java.lang.String fullPath)
throws NotExistsResourceException,
ApplicationException,
NotAuthorizedException
ls in class ServerAccessfullPath - full path of the directory to list
NotExistsResourceException
ApplicationException
NotAuthorizedException
public ChannelResource[] ls(java.lang.String path,
java.lang.String targetDirectory)
throws NotExistsResourceException,
ApplicationException,
NotAuthorizedException
ls in class ServerAccesspath - path of the directory to listtargetDirectory - name of the directory 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 ServerAccessfileName - 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 ServerAccessfile - resource to deletepath - path of the resource
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 ServerAccessoldName - resource to renamenewName - new name of the resourcepath - path of the resource
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 ServerAccessname - name of the directory to createpath - path where to create the 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 ServerAccessfromSpace - the space from which we want to paste - not usedtoSpaceKey - the space key where we want to paste - not usedclipboardPath - the path of the clipboadclipboard - the contain of the clipboardcurentDirPath - the path of the current dir
ApplicationException
PasteInChildDirectoryException
PasteWithSameNameException
PasteDeletedResourceException
NotAuthorizedException
public ChannelResource download(java.lang.String name,
java.lang.String path)
throws DownloadException
download in class ServerAccessname - the file namepath - the path of the file
DownloadException
public java.io.InputStream getMethodData(java.lang.String fullPath)
throws java.io.IOException
getMethodData in class ServerAccessfullPath - the full path of the file
java.io.IOException
public boolean exists(java.lang.String fullPath)
throws ApplicationException,
NotAuthorizedException
exists in class ServerAccessfullPath - the full path of the resource
ApplicationException
NotAuthorizedException
public boolean exists(java.lang.String resourceName,
java.lang.String path)
throws ApplicationException,
NotAuthorizedException
exists in class ServerAccessresourceName - the name of the resourcepath - the relative path of the resource
ApplicationException
NotAuthorizedException
public boolean canRead(java.lang.String resourceName,
java.lang.String path)
throws ApplicationException
canRead in class ServerAccessresourceName - the name of the resourcepath - relative path of the resource
ApplicationException
public boolean canRead(java.lang.String path)
throws ApplicationException
canRead in class ServerAccesspath - full path of the resource
ApplicationException
public boolean isDirectory(java.lang.String name,
java.lang.String path)
throws ApplicationException,
NotAuthorizedException,
NotExistsResourceException
isDirectory in class ServerAccessname - the name of the resourcepath - the relative path of the resource
ApplicationException
NotAuthorizedException
NotExistsResourceException
public boolean isEmpty(java.lang.String dir,
java.lang.String path)
throws ApplicationException,
NotExistsResourceException,
NotAuthorizedException
isEmpty in class ServerAccessdir - the name of the directorypath - the relative path of the directory
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 ServerAccessnamespace - 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 ServerAccessnamespace - 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 ServerAccesspath - 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 ServerAccesspath - the resource path
NotSupportedAclException
AclAccessException
AclReadException
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 ServerAccesspath - 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]
NotSupportedAclException
AclAccessException
AclWriteException
AclReadException
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 ServerAccesspath - 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]
AclAccessException
AclWriteException
NotSupportedAclException
AclReadException
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 ServerAccesspath - 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]
NotSupportedAclException
AclAccessException
AclReadException
AclWriteException
public void revokeAllPermissons(java.lang.String path)
throws AclReadException,
AclAccessException,
AclWriteException,
NotSupportedAclException
revokeAllPermissons in class ServerAccesspath - the resource path
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 ServerAccesspath - 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
AclAccessException
AclReadException
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 ServerAccesspath - 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
AclAccessException
AclReadException
NotSupportedAclExceptionpublic boolean[] checkPrivileges(java.lang.String path)
checkPrivileges in class ServerAccesspath - the path of the space
|
CStockage 4.2_beta-RC-1 API Documentation |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||