Class SftpFileObject
java.lang.Object
org.apache.commons.vfs.provider.AbstractFileObject
org.apache.commons.vfs.provider.sftp.SftpFileObject
- All Implemented Interfaces:
FileObject
An SFTP file.
- Version:
- $Revision: 480428 $ $Date: 2005-10-14 19:59:47 +0200 (Fr, 14 Okt 2005) $
- Author:
- Adam Murdoch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCreates this file as a folder.protected voiddoDelete()Deletes the file.protected longReturns the size of the file content (in bytes).protected InputStreamCreates an input stream to read the file content from.protected longReturns the last modified time of this file.protected OutputStreamdoGetOutputStream(boolean bAppend) Creates an output stream to write the file content to.protected RandomAccessContentCreates access to the file for random i/o.protected FileTypeDetermines the type of this file, returns null if the file does not exist.protected String[]Lists the children of this file.protected FileObject[]Lists the children of this file.protected voiddoRename(FileObject newfile) Rename the file.protected voiddoSetLastModifiedTime(long modtime) Sets the last modified time of this file.protected voidonChange()Called when the type or content of this file changes.Methods inherited from class org.apache.commons.vfs.provider.AbstractFileObject
canRenameTo, childrenChanged, childrenChanged, close, copyFrom, createFile, createFolder, delete, delete, doAttach, doDetach, doGetAttributes, doGetCertificates, doIsHidden, doIsReadable, doIsSameFile, doIsWriteable, doSetAttribute, endOutput, exists, finalize, findFiles, findFiles, getChild, getChildren, getContent, getFileContentInfoFactory, getFileOperations, getFileSystem, getInputStream, getName, getOutputStream, getOutputStream, getParent, getRandomAccessContent, getType, getURL, handleChanged, handleCreate, handleDelete, holdObject, injectType, isAttached, isContentOpen, isHidden, isReadable, isSameFile, isWriteable, moveTo, notifyAllStreamsClosed, onChildrenChanged, refresh, resolveFile, resolveFile, toStringMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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
-
Constructor Details
-
SftpFileObject
- Throws:
FileSystemException
-
-
Method Details
-
doGetType
Determines the type of this file, returns null if the file does not exist.- Specified by:
doGetTypein classAbstractFileObject- Throws:
Exception
-
onChange
Called when the type or content of this file changes.- Overrides:
onChangein classAbstractFileObject- Throws:
Exception
-
doCreateFolder
Creates this file as a folder.- Overrides:
doCreateFolderin classAbstractFileObject- Throws:
Exception
-
doGetLastModifiedTime
Description copied from class:AbstractFileObjectReturns the last modified time of this file. Is only called ifAbstractFileObject.doGetType()does not returnFileType.IMAGINARY. This implementation throws an exception.- Overrides:
doGetLastModifiedTimein classAbstractFileObject- Throws:
Exception
-
doSetLastModifiedTime
Sets the last modified time of this file. Is only called ifdoGetType()does not returnFileType.IMAGINARY.- Overrides:
doSetLastModifiedTimein classAbstractFileObject- 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:
Exception
-
doDelete
Deletes the file.- Overrides:
doDeletein classAbstractFileObject- Throws:
Exception
-
doRename
Rename the file.- Overrides:
doRenamein classAbstractFileObject- Throws:
Exception
-
doListChildrenResolved
Lists the children of this file.- Overrides:
doListChildrenResolvedin classAbstractFileObject- Throws:
Exception
-
doListChildren
Lists the children of this file.- Specified by:
doListChildrenin classAbstractFileObject- Throws:
Exception
-
doGetContentSize
Returns the size of the file content (in bytes).- Specified by:
doGetContentSizein classAbstractFileObject- Throws:
Exception
-
doGetRandomAccessContent
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:
Exception
-
doGetInputStream
Creates an input stream to read the file content from.- Specified by:
doGetInputStreamin classAbstractFileObject- Throws:
Exception
-
doGetOutputStream
Creates an output stream to write the file content to.- Overrides:
doGetOutputStreamin classAbstractFileObject- Throws:
Exception
-