CWebdav 0.1
API Documentation

org.esupportail.portal.channels.CWebdav.provider
Class DavAccess

java.lang.Object
  extended byorg.esupportail.portal.channels.CWebdav.provider.DavAccess
Direct Known Subclasses:
DavAccessImpl

public abstract class DavAccess
extends java.lang.Object

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


Constructor Summary
DavAccess()
           
 
Method Summary
abstract  boolean canPaste(java.lang.String clipboardPath, java.util.Vector clipboard, java.lang.String curentDirPath)
          Check if we can paste here
abstract  void connect()
          Connect this object to the server
abstract  boolean copy(java.lang.String resource, java.lang.String fromPath, 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  void disconnect()
          Disconnection of the server
abstract  java.lang.String getContentType()
          Search content type of the file whiwh will be downloaded
abstract  java.io.InputStream getInputStream()
          Real download WARNING : the method "fileToDownload.getMethodData()" create a tempory file which be delete when the JVM will be stoped
abstract  java.lang.String getLogin()
          Give the user login
abstract  java.lang.String getPassword()
          Give the user password
abstract  java.lang.String getUri()
          Give the uri webdav access
abstract  void init(java.lang.String uri, java.lang.String login, java.lang.String password)
          This method initialize 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.
abstract  boolean isExist(java.lang.String resourceName, java.lang.String path)
          Check is the resource exists
abstract  org.apache.webdav.lib.WebdavResource[] ls(java.lang.String path)
          All ressources for a given path
abstract  boolean move(java.lang.String resource, java.lang.String fromPath, 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  boolean setFileToDownload(java.lang.String name, java.lang.String path)
          Prepare the file whiwh will be downloaded
abstract  boolean upload(org.jasig.portal.MultipartDataSource inputFile, java.lang.String path)
          Upload a file to the path given in argument
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DavAccess

public DavAccess()
Method Detail

getLogin

public abstract java.lang.String getLogin()
Give the user login

Returns:
the user login

getPassword

public abstract java.lang.String getPassword()
Give the user password

Returns:
the user password

getUri

public abstract java.lang.String getUri()
Give the uri webdav access

Returns:
the uri webdav access

init

public abstract void init(java.lang.String uri,
                          java.lang.String login,
                          java.lang.String password)
                   throws java.net.MalformedURLException
This method initialize the parameters. You have to call this method after calling connect method

Parameters:
uri - webdav uri
login - connexion login
password - connexioàn password
Throws:
java.net.MalformedURLException

connect

public abstract void connect()
                      throws ServerException
Connect this object to the server

Throws:
ServerException

disconnect

public abstract void disconnect()
                         throws ServerException
Disconnection of the server

Throws:
ServerException

ls

public abstract org.apache.webdav.lib.WebdavResource[] ls(java.lang.String path)
                                                   throws NotExistsResourceException,
                                                          ApplicationException
All ressources for a given path

Parameters:
path - directory path on the dav server
Returns:
WebdavResource array
Throws:
NotExistsResourceException
ApplicationException

upload

public abstract boolean upload(org.jasig.portal.MultipartDataSource inputFile,
                               java.lang.String path)
                        throws ApplicationException,
                               ServerException,
                               NotExistsResourceException,
                               StillExistsException,
                               BadFormatException,
                               UploadException,
                               EmptyFileOnUploadException,
                               OverQuotaException
Upload a file to the path given in argument

Parameters:
inputFile - the input file
path - the path
Returns:
boolean true if no problem, else false
Throws:
ApplicationException
ServerException
NotExistsResourceException
StillExistsException
BadFormatException
UploadException
EmptyFileOnUploadException
OverQuotaException

delete

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

rename

public abstract boolean rename(java.lang.String oldName,
                               java.lang.String newName,
                               java.lang.String path)
                        throws StillExistsException,
                               BadFormatException,
                               ApplicationException,
                               RenameException
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

createDir

public abstract boolean createDir(java.lang.String name,
                                  java.lang.String path)
                           throws ApplicationException,
                                  CreateDirectoryException,
                                  StillExistsException,
                                  BadFormatException
Create the directory given in argument

Parameters:
path - path where is file/directory
Returns:
boolean true if well done else false
Throws:
ApplicationException
CreateDirectoryException
StillExistsException
BadFormatException

canPaste

public abstract boolean canPaste(java.lang.String clipboardPath,
                                 java.util.Vector clipboard,
                                 java.lang.String curentDirPath)
                          throws ApplicationException,
                                 PasteInChildDirectoryException,
                                 PasteWithSameNameException,
                                 PasteDeletedResourceException
Check if we can paste here

Parameters:
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

copy

public abstract boolean copy(java.lang.String resource,
                             java.lang.String fromPath,
                             java.lang.String toPath)
                      throws CopyException,
                             ApplicationException,
                             OverQuotaException
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:
ApplicationException
CopyException
OverQuotaException

move

public abstract boolean move(java.lang.String resource,
                             java.lang.String fromPath,
                             java.lang.String toPath)
                      throws ApplicationException,
                             MoveException
Move method

Parameters:
resource - resource to move
fromPath - path where is the resource
toPath - path to move the resource
Returns:
boolean true if well done else false
Throws:
ApplicationException
MoveException

getContentType

public abstract java.lang.String getContentType()
Search content type of the file whiwh will be downloaded

See Also:
getContentType()

getInputStream

public abstract java.io.InputStream getInputStream()
Real download WARNING : the method "fileToDownload.getMethodData()" create a tempory file which be delete when the JVM will be stoped

See Also:
org.esupportail.portal.channels.CWebdav.provider.DavAccess#downloadData(java.io.OutputStream, java.lang.String, java.lang.String)

setFileToDownload

public abstract boolean setFileToDownload(java.lang.String name,
                                          java.lang.String path)
Prepare the file whiwh will be downloaded

See Also:
setFileToDownload(java.lang.String, java.lang.String)

isExist

public abstract boolean isExist(java.lang.String resourceName,
                                java.lang.String path)
                         throws ApplicationException
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:
java.io.IOException
org.apache.commons.httpclient.HttpException
ApplicationException

isDirectory

public abstract boolean isDirectory(java.lang.String name,
                                    java.lang.String path)
                             throws ApplicationException
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

isEmpty

public abstract boolean isEmpty(java.lang.String dir,
                                java.lang.String path)
                         throws ApplicationException,
                                NotExistsResourceException
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

CWebdav 0.1
API Documentation