org.apache.commons.vfs.provider.webdav
Class WebdavFileObject

java.lang.Object
  extended by org.apache.commons.vfs.provider.AbstractFileObject
      extended by org.apache.commons.vfs.provider.http.HttpFileObject
          extended by org.apache.commons.vfs.provider.webdav.WebdavFileObject
All Implemented Interfaces:
FileObject

public class WebdavFileObject
extends HttpFileObject
implements FileObject

A WebDAV file.

Version:
$Revision: 833831 $
Author:
Commons VFS team

Field Summary
static org.apache.jackrabbit.webdav.property.DavPropertyName RESPONSE_CHARSET
          The character set property name.
 
Constructor Summary
protected WebdavFileObject(FileName name, WebdavFileSystem fileSystem)
           
 
Method Summary
protected  void configureMethod(org.apache.commons.httpclient.HttpMethodBase httpMethod)
           
protected  void doCreateFolder()
          Creates this file as a folder.
protected  void doDelete()
          Deletes the file.
protected  java.util.Map doGetAttributes()
          Returns the properties of the Webdav resource.
protected  long doGetContentSize()
          Returns the size of the file content (in bytes).
protected  long doGetLastModifiedTime()
          Returns the last modified time of this file.
protected  java.io.OutputStream doGetOutputStream(boolean bAppend)
          Creates an output stream to write the file content to.
protected  FileType doGetType()
          Determines the type of this file.
protected  java.lang.String[] doListChildren()
          Lists the children of the file.
protected  FileObject[] doListChildrenResolved()
          Lists the children of the file.
protected  void doRename(FileObject newfile)
          Rename the file.
protected  FileContentInfoFactory getFileContentInfoFactory()
          create the filecontentinfo implementation
protected  void setupMethod(org.apache.commons.httpclient.HttpMethod method)
          Prepares a Method object.
 
Methods inherited from class org.apache.commons.vfs.provider.http.HttpFileObject
doDetach, doGetInputStream, doGetRandomAccessContent, encodePath
 
Methods inherited from class org.apache.commons.vfs.provider.AbstractFileObject
canRenameTo, childrenChanged, childrenChanged, close, copyFrom, createFile, createFolder, delete, delete, doAttach, doCreateFileContent, doGetCertificates, doIsHidden, doIsReadable, doIsSameFile, doIsWriteable, doRemoveAttribute, doSetAttribute, doSetLastModifiedTime, doSetLastModTime, endOutput, exists, finalize, findFiles, findFiles, getChild, getChildren, getContent, getFileOperations, getFileSystem, getInputStream, getName, getOutputStream, getOutputStream, getParent, getRandomAccessContent, getType, getURL, handleChanged, handleCreate, handleDelete, holdObject, injectType, isAttached, isContentOpen, isHidden, isReadable, isSameFile, isWriteable, moveTo, notifyAllStreamsClosed, onChange, onChildrenChanged, refresh, resolveFile, resolveFile, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.commons.vfs.FileObject
canRenameTo, close, copyFrom, createFile, createFolder, delete, delete, exists, findFiles, findFiles, getChild, getChildren, getContent, getFileOperations, getFileSystem, getName, getParent, getType, getURL, isAttached, isContentOpen, isHidden, isReadable, isWriteable, moveTo, refresh, resolveFile, resolveFile
 

Field Detail

RESPONSE_CHARSET

public static final org.apache.jackrabbit.webdav.property.DavPropertyName RESPONSE_CHARSET
The character set property name.

Constructor Detail

WebdavFileObject

protected WebdavFileObject(FileName name,
                           WebdavFileSystem fileSystem)
Method Detail

configureMethod

protected void configureMethod(org.apache.commons.httpclient.HttpMethodBase httpMethod)

doGetType

protected FileType doGetType()
                      throws java.lang.Exception
Determines the type of this file. Must not return null. The return value of this method is cached, so the implementation can be expensive.

Overrides:
doGetType in class HttpFileObject
Throws:
java.lang.Exception

doListChildren

protected java.lang.String[] doListChildren()
                                     throws java.lang.Exception
Lists the children of the file.

Overrides:
doListChildren in class HttpFileObject
Returns:
a possible empty String array if the file is a directory or null or an exception if the file is not a directory or can't be read
Throws:
java.lang.Exception

doListChildrenResolved

protected FileObject[] doListChildrenResolved()
                                       throws java.lang.Exception
Lists the children of the file.

Overrides:
doListChildrenResolved in class AbstractFileObject
Throws:
java.lang.Exception

doCreateFolder

protected void doCreateFolder()
                       throws java.lang.Exception
Creates this file as a folder.

Overrides:
doCreateFolder in class AbstractFileObject
Throws:
java.lang.Exception

doDelete

protected void doDelete()
                 throws java.lang.Exception
Deletes the file.

Overrides:
doDelete in class AbstractFileObject
Throws:
java.lang.Exception

doRename

protected void doRename(FileObject newfile)
                 throws java.lang.Exception
Rename the file.

Overrides:
doRename in class AbstractFileObject
Throws:
java.lang.Exception

doGetContentSize

protected long doGetContentSize()
                         throws java.lang.Exception
Returns the size of the file content (in bytes).

Overrides:
doGetContentSize in class HttpFileObject
Throws:
java.lang.Exception

doGetLastModifiedTime

protected long doGetLastModifiedTime()
                              throws java.lang.Exception
Returns the last modified time of this file. Is only called if doGetType() does not return FileType.IMAGINARY.

Overrides:
doGetLastModifiedTime in class HttpFileObject
Throws:
java.lang.Exception

doGetAttributes

protected java.util.Map doGetAttributes()
                                 throws java.lang.Exception
Returns the properties of the Webdav resource.

Overrides:
doGetAttributes in class AbstractFileObject
Throws:
java.lang.Exception

doGetOutputStream

protected java.io.OutputStream doGetOutputStream(boolean bAppend)
                                          throws java.lang.Exception
Description copied from class: AbstractFileObject
Creates an output stream to write the file content to. Is only called if:

It is guaranteed that there are no open stream (input or output) for this file when this method is called.

The returned stream does not have to be buffered.

This implementation throws an exception.

Overrides:
doGetOutputStream in class AbstractFileObject
Throws:
java.lang.Exception

getFileContentInfoFactory

protected FileContentInfoFactory getFileContentInfoFactory()
Description copied from class: AbstractFileObject
create the filecontentinfo implementation

Overrides:
getFileContentInfoFactory in class HttpFileObject

setupMethod

protected void setupMethod(org.apache.commons.httpclient.HttpMethod method)
                    throws FileSystemException,
                           org.apache.commons.httpclient.URIException
Prepares a Method object.

Overrides:
setupMethod in class HttpFileObject
Parameters:
method - the HttpMethod.
Throws:
FileSystemException - if an error occurs encoding the uri.
org.apache.commons.httpclient.URIException - if the URI is in error.


Copyright © 2002-2009 Apache Software Foundation. All Rights Reserved.