Class HttpFileObject
- java.lang.Object
-
- org.apache.commons.vfs.provider.AbstractFileObject
-
- org.apache.commons.vfs.provider.http.HttpFileObject
-
- All Implemented Interfaces:
FileObject
public class HttpFileObject extends AbstractFileObject
A file object backed by commons httpclient.- Version:
- $Revision: 480428 $ $Date: 2006-11-29 07:15:24 +0100 (Wed, 29 Nov 2006) $
- Author:
- Adam Murdoch
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedHttpFileObject(FileName name, HttpFileSystem fileSystem)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoDetach()Detaches this file object from its file resource.protected longdoGetContentSize()Returns the size of the file content (in bytes).protected java.io.InputStreamdoGetInputStream()Creates an input stream to read the file content from.protected longdoGetLastModifiedTime()Returns the last modified time of this file.protected RandomAccessContentdoGetRandomAccessContent(RandomAccessMode mode)Creates access to the file for random i/o.protected FileTypedoGetType()Determines the type of this file.protected java.lang.String[]doListChildren()Lists the children of this file.protected java.lang.StringencodePath(java.lang.String decodedPath)protected FileContentInfoFactorygetFileContentInfoFactory()create the filecontentinfo implementation-
Methods inherited from class org.apache.commons.vfs.provider.AbstractFileObject
canRenameTo, childrenChanged, childrenChanged, close, copyFrom, createFile, createFolder, delete, delete, doAttach, doCreateFolder, doDelete, doGetAttributes, doGetCertificates, doGetOutputStream, doIsHidden, doIsReadable, doIsSameFile, doIsWriteable, doListChildrenResolved, doRename, doSetAttribute, doSetLastModifiedTime, 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
-
-
-
-
Constructor Detail
-
HttpFileObject
protected HttpFileObject(FileName name, HttpFileSystem fileSystem)
-
-
Method Detail
-
doDetach
protected void doDetach() throws java.lang.ExceptionDetaches this file object from its file resource.- Overrides:
doDetachin classAbstractFileObject- Throws:
java.lang.Exception
-
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.- Specified by:
doGetTypein classAbstractFileObject- Throws:
java.lang.Exception
-
doListChildren
protected java.lang.String[] doListChildren() throws java.lang.ExceptionLists the children of this file.- Specified by:
doListChildrenin classAbstractFileObject- Throws:
java.lang.Exception
-
doGetContentSize
protected long doGetContentSize() throws java.lang.ExceptionReturns the size of the file content (in bytes).- Specified by:
doGetContentSizein classAbstractFileObject- Throws:
java.lang.Exception
-
doGetLastModifiedTime
protected long doGetLastModifiedTime() throws java.lang.ExceptionReturns the last modified time of this file. This implementation throws an exception.- Overrides:
doGetLastModifiedTimein classAbstractFileObject- Throws:
java.lang.Exception
-
doGetInputStream
protected java.io.InputStream doGetInputStream() throws java.lang.ExceptionCreates an input stream to read the file content from. Is only called ifdoGetType()returnsFileType.FILE.It is guaranteed that there are no open output streams for this file when this method is called.
The returned stream does not have to be buffered.
- Specified by:
doGetInputStreamin classAbstractFileObject- Throws:
java.lang.Exception
-
doGetRandomAccessContent
protected RandomAccessContent doGetRandomAccessContent(RandomAccessMode mode) throws java.lang.Exception
Description copied from class:AbstractFileObjectCreates access to the file for random i/o. Is only called ifAbstractFileObject.doGetType()returnsFileType.FILE.It is guaranteed that there are no open output streams for this file when this method is called.
- Overrides:
doGetRandomAccessContentin classAbstractFileObject- Throws:
java.lang.Exception
-
encodePath
protected java.lang.String encodePath(java.lang.String decodedPath) throws org.apache.commons.httpclient.URIException- Throws:
org.apache.commons.httpclient.URIException
-
getFileContentInfoFactory
protected FileContentInfoFactory getFileContentInfoFactory()
Description copied from class:AbstractFileObjectcreate the filecontentinfo implementation- Overrides:
getFileContentInfoFactoryin classAbstractFileObject
-
-