Class HttpFileObject<FS extends HttpFileSystem>

    • Method Detail

      • doDetach

        protected void doDetach()
                         throws java.lang.Exception
        Detaches this file object from its file resource.
        Overrides:
        doDetach in class AbstractFileObject<FS extends HttpFileSystem>
        Throws:
        java.lang.Exception - if an error occurs.
      • doGetContentSize

        protected long doGetContentSize()
                                 throws java.lang.Exception
        Returns the size of the file content (in bytes).
        Specified by:
        doGetContentSize in class AbstractFileObject<FS extends HttpFileSystem>
        Returns:
        The size of the file in bytes.
        Throws:
        java.lang.Exception - if an error occurs.
      • doGetInputStream

        protected java.io.InputStream doGetInputStream()
                                                throws java.lang.Exception
        Creates an input stream to read the file content from. Is only called if doGetType() returns FileType.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:
        doGetInputStream in class AbstractFileObject<FS extends HttpFileSystem>
        Returns:
        An InputStream to read the file content.
        Throws:
        java.lang.Exception - if an error occurs.
      • doGetLastModifiedTime

        protected long doGetLastModifiedTime()
                                      throws java.lang.Exception
        Returns the last modified time of this file.

        This implementation throws an exception.

        Overrides:
        doGetLastModifiedTime in class AbstractFileObject<FS extends HttpFileSystem>
        Returns:
        The last modification time.
        Throws:
        java.lang.Exception - if an error occurs.
      • 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:
        doGetType in class AbstractFileObject<FS extends HttpFileSystem>
        Returns:
        the type of the file.
        Throws:
        java.lang.Exception - if an error occurs.
      • doListChildren

        protected java.lang.String[] doListChildren()
                                             throws java.lang.Exception
        Lists the children of this file.
        Specified by:
        doListChildren in class AbstractFileObject<FS extends HttpFileSystem>
        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 - if an error occurs.
      • encodePath

        protected java.lang.String encodePath​(java.lang.String decodedPath)
                                       throws org.apache.commons.httpclient.URIException
        Throws:
        org.apache.commons.httpclient.URIException
      • getFollowRedirect

        protected boolean getFollowRedirect()
      • getUserAgent

        protected java.lang.String getUserAgent()
      • getUrlCharset

        protected java.lang.String getUrlCharset()
      • setupMethod

        protected void setupMethod​(org.apache.commons.httpclient.HttpMethod method)
                            throws FileSystemException,
                                   org.apache.commons.httpclient.URIException
        Prepares a HttpMethod object.
        Parameters:
        method - The object which gets prepared to access the file object.
        Throws:
        FileSystemException - if an error occurs.
        org.apache.commons.httpclient.URIException - if path cannot be represented.
        Since:
        2.0 (was package)