Class SftpFileObject

    • Method Detail

      • doGetType

        protected FileType doGetType()
                              throws java.lang.Exception
        Determines the type of this file, returns null if the file does not exist.
        Specified by:
        doGetType in class AbstractFileObject
        Throws:
        java.lang.Exception
      • onChange

        protected void onChange()
                         throws java.lang.Exception
        Called when the type or content of this file changes.
        Overrides:
        onChange 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
      • doSetLastModifiedTime

        protected void doSetLastModifiedTime​(long modtime)
                                      throws java.lang.Exception
        Sets the last modified time of this file. Is only called if doGetType() does not return FileType.IMAGINARY.

        Overrides:
        doSetLastModifiedTime in class AbstractFileObject
        Parameters:
        modtime - is modification time in milliseconds. SFTP protocol can send times with nanosecond precision but at the moment jsch send them with second precision.
        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
      • doListChildren

        protected java.lang.String[] doListChildren()
                                             throws java.lang.Exception
        Lists the children of this file.
        Specified by:
        doListChildren in class AbstractFileObject
        Throws:
        java.lang.Exception
      • doGetContentSize

        protected long doGetContentSize()
                                 throws java.lang.Exception
        Returns the size of the file content (in bytes).
        Specified by:
        doGetContentSize in class AbstractFileObject
        Throws:
        java.lang.Exception
      • doGetInputStream

        protected java.io.InputStream doGetInputStream()
                                                throws java.lang.Exception
        Creates an input stream to read the file content from.
        Specified by:
        doGetInputStream in class AbstractFileObject
        Throws:
        java.lang.Exception
      • doGetOutputStream

        protected java.io.OutputStream doGetOutputStream​(boolean bAppend)
                                                  throws java.lang.Exception
        Creates an output stream to write the file content to.
        Overrides:
        doGetOutputStream in class AbstractFileObject
        Throws:
        java.lang.Exception