Class WebdavFileObject

java.lang.Object
org.apache.commons.vfs2.provider.AbstractFileObject<FS>
org.apache.commons.vfs2.provider.http.HttpFileObject<WebdavFileSystem>
org.apache.commons.vfs2.provider.webdav.WebdavFileObject
All Implemented Interfaces:
Closeable, AutoCloseable, Comparable<org.apache.commons.vfs2.FileObject>, Iterable<org.apache.commons.vfs2.FileObject>, org.apache.commons.vfs2.FileObject

public class WebdavFileObject extends org.apache.commons.vfs2.provider.http.HttpFileObject<WebdavFileSystem>
A WebDAV file.
Since:
2.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.apache.jackrabbit.webdav.property.DavPropertyName
    The character set property name.

    Fields inherited from class org.apache.commons.vfs2.provider.AbstractFileObject

    DEFAULT_BUFFER_SIZE
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    WebdavFileObject(org.apache.commons.vfs2.provider.AbstractFileName fileName, WebdavFileSystem fileSystem)
    Constructs a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    configureMethod(org.apache.commons.httpclient.HttpMethodBase httpMethod)
    Configures the given HttpMethodBase.
    protected void
    Creates this file as a folder.
    protected void
    Deletes the file.
    protected Map<String,Object>
    Returns the properties of the WebDAV resource.
    protected long
    Returns the size of the file content (in bytes).
    protected long
    Returns the last modified time of this file.
    protected OutputStream
    doGetOutputStream(boolean bAppend)
     
    protected org.apache.commons.vfs2.FileType
    Determines the type of this file.
    protected boolean
    Determines if this file can be written to.
    protected String[]
    Lists the children of the file.
    protected org.apache.commons.vfs2.FileObject[]
    Lists the children of the file.
    protected void
    doRename(org.apache.commons.vfs2.FileObject newFile)
    Rename the file.
    protected void
    doSetAttribute(String attrName, Object value)
    Sets an attribute of this file.
    protected org.apache.commons.vfs2.FileContentInfoFactory
     
    protected void
    setupMethod(org.apache.commons.httpclient.HttpMethod method)
    Prepares a Method object.

    Methods inherited from class org.apache.commons.vfs2.provider.http.HttpFileObject

    doDetach, doGetInputStream, doGetRandomAccessContent, encodePath, getFollowRedirect, getUrlCharset, getUserAgent

    Methods inherited from class org.apache.commons.vfs2.provider.AbstractFileObject

    canRenameTo, childrenChanged, close, compareTo, copyFrom, createFile, createFolder, delete, delete, deleteAll, doAttach, doCreateFileContent, doGetCertificates, doGetInputStream, doIsExecutable, doIsHidden, doIsReadable, doIsSameFile, doIsSymbolicLink, doRemoveAttribute, doSetExecutable, doSetLastModifiedTime, doSetReadable, doSetWritable, endOutput, exists, finalize, findFiles, findFiles, getAbstractFileSystem, getChild, getChildren, getContent, getFileOperations, getFileSystem, getInputStream, getInputStream, getName, getOutputStream, getOutputStream, getParent, getPublicURIString, getRandomAccessContent, getType, getURL, handleChanged, handleCreate, handleDelete, holdObject, injectType, isAttached, isContentOpen, isExecutable, isFile, isFolder, isHidden, isReadable, isSameFile, isSymbolicLink, isWriteable, iterator, listFiles, moveTo, notifyAllStreamsClosed, onChange, onChildrenChanged, refresh, resolveFile, resolveFile, setExecutable, setReadable, setWritable, toString

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.commons.vfs2.FileObject

    getPath, getURI

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Field Details

    • RESPONSE_CHARSET

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

    • WebdavFileObject

      protected WebdavFileObject(org.apache.commons.vfs2.provider.AbstractFileName fileName, WebdavFileSystem fileSystem)
      Constructs a new instance.
      Parameters:
      fileName - the file name.
      fileSystem - the file system.
  • Method Details

    • configureMethod

      protected void configureMethod(org.apache.commons.httpclient.HttpMethodBase httpMethod)
      Configures the given HttpMethodBase.
      Parameters:
      httpMethod - The HttpMethodBase to configure.
    • doCreateFolder

      protected void doCreateFolder() throws Exception
      Creates this file as a folder.
      Overrides:
      doCreateFolder in class org.apache.commons.vfs2.provider.AbstractFileObject<WebdavFileSystem>
      Throws:
      Exception
    • doDelete

      protected void doDelete() throws Exception
      Deletes the file.
      Overrides:
      doDelete in class org.apache.commons.vfs2.provider.AbstractFileObject<WebdavFileSystem>
      Throws:
      Exception
    • doGetAttributes

      protected Map<String,Object> doGetAttributes() throws Exception
      Returns the properties of the WebDAV resource.
      Overrides:
      doGetAttributes in class org.apache.commons.vfs2.provider.AbstractFileObject<WebdavFileSystem>
      Throws:
      Exception
    • doGetContentSize

      protected long doGetContentSize() throws Exception
      Returns the size of the file content (in bytes).
      Overrides:
      doGetContentSize in class org.apache.commons.vfs2.provider.http.HttpFileObject<WebdavFileSystem>
      Throws:
      Exception
    • doGetLastModifiedTime

      protected long doGetLastModifiedTime() throws Exception
      Returns the last modified time of this file. Is only called if doGetType() does not return FileType.IMAGINARY.
      Overrides:
      doGetLastModifiedTime in class org.apache.commons.vfs2.provider.http.HttpFileObject<WebdavFileSystem>
      Throws:
      Exception
    • doGetOutputStream

      protected OutputStream doGetOutputStream(boolean bAppend) throws Exception
      Overrides:
      doGetOutputStream in class org.apache.commons.vfs2.provider.AbstractFileObject<WebdavFileSystem>
      Throws:
      Exception
    • doGetType

      protected org.apache.commons.vfs2.FileType doGetType() throws 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 org.apache.commons.vfs2.provider.http.HttpFileObject<WebdavFileSystem>
      Throws:
      Exception
    • doIsWriteable

      protected boolean doIsWriteable() throws Exception
      Determines if this file can be written to. Is only called if doGetType() does not return FileType.IMAGINARY.

      This implementation always returns true.

      Overrides:
      doIsWriteable in class org.apache.commons.vfs2.provider.http.HttpFileObject<WebdavFileSystem>
      Returns:
      true if the file is writable.
      Throws:
      Exception - if an error occurs.
    • doListChildren

      protected String[] doListChildren() throws Exception
      Lists the children of the file.
      Overrides:
      doListChildren in class org.apache.commons.vfs2.provider.http.HttpFileObject<WebdavFileSystem>
      Throws:
      Exception
    • doListChildrenResolved

      protected org.apache.commons.vfs2.FileObject[] doListChildrenResolved() throws Exception
      Lists the children of the file.
      Overrides:
      doListChildrenResolved in class org.apache.commons.vfs2.provider.AbstractFileObject<WebdavFileSystem>
      Throws:
      Exception
    • doRename

      protected void doRename(org.apache.commons.vfs2.FileObject newFile) throws Exception
      Rename the file.
      Overrides:
      doRename in class org.apache.commons.vfs2.provider.AbstractFileObject<WebdavFileSystem>
      Throws:
      Exception
    • doSetAttribute

      protected void doSetAttribute(String attrName, Object value) throws Exception
      Sets an attribute of this file. Is only called if doGetType() does not return FileType.IMAGINARY.
      Overrides:
      doSetAttribute in class org.apache.commons.vfs2.provider.AbstractFileObject<WebdavFileSystem>
      Throws:
      Exception
    • getFileContentInfoFactory

      protected org.apache.commons.vfs2.FileContentInfoFactory getFileContentInfoFactory()
      Overrides:
      getFileContentInfoFactory in class org.apache.commons.vfs2.provider.http.HttpFileObject<WebdavFileSystem>
    • setupMethod

      protected void setupMethod(org.apache.commons.httpclient.HttpMethod method) throws org.apache.commons.vfs2.FileSystemException, org.apache.commons.httpclient.URIException
      Prepares a Method object.
      Overrides:
      setupMethod in class org.apache.commons.vfs2.provider.http.HttpFileObject<WebdavFileSystem>
      Parameters:
      method - the HttpMethod.
      Throws:
      org.apache.commons.vfs2.FileSystemException - if an error occurs encoding the uri.
      org.apache.commons.httpclient.URIException - if the URI is in error.