Package net.sf.basedb.opengrid
Class AbstractSession.UploadSourceWrapper
java.lang.Object
net.sf.basedb.opengrid.AbstractSession.UploadSourceWrapper
- All Implemented Interfaces:
net.schmizz.sshj.xfer.LocalSourceFile
- Enclosing class:
- AbstractSession<T extends AbstractHost<?>>
static class AbstractSession.UploadSourceWrapper extends Object implements net.schmizz.sshj.xfer.LocalSourceFile
Wraps an UploadSource implementation with a LocalSourceFile
implementation so that the file data can be sent to the remote
server with SSHj. We do it this way so we don't have to expose
SSHj-specific classes to the other extensions.
- Since:
- 1.0
-
Field Summary
Fields Modifier and Type Field Description private FileMetaData
metadata
private FilePermission
permission
private UploadSource
source
-
Constructor Summary
Constructors Constructor Description UploadSourceWrapper(UploadSource source, FilePermission permission)
-
Method Summary
Modifier and Type Method Description Iterable<? extends net.schmizz.sshj.xfer.LocalSourceFile>
getChildren(net.schmizz.sshj.xfer.LocalFileFilter filter)
No children.InputStream
getInputStream()
long
getLastAccessTime()
long
getLastModifiedTime()
long
getLength()
String
getName()
int
getPermissions()
boolean
isDirectory()
boolean
isFile()
We only support files.boolean
providesAtimeMtime()
-
Field Details
-
source
-
metadata
-
permission
-
-
Constructor Details
-
UploadSourceWrapper
UploadSourceWrapper(UploadSource source, FilePermission permission)
-
-
Method Details
-
getName
- Specified by:
getName
in interfacenet.schmizz.sshj.xfer.LocalSourceFile
-
getLength
public long getLength()- Specified by:
getLength
in interfacenet.schmizz.sshj.xfer.LocalSourceFile
-
getInputStream
- Specified by:
getInputStream
in interfacenet.schmizz.sshj.xfer.LocalSourceFile
- Throws:
IOException
-
getPermissions
public int getPermissions()- Specified by:
getPermissions
in interfacenet.schmizz.sshj.xfer.LocalSourceFile
-
isFile
public boolean isFile()We only support files.- Specified by:
isFile
in interfacenet.schmizz.sshj.xfer.LocalSourceFile
-
isDirectory
public boolean isDirectory()- Specified by:
isDirectory
in interfacenet.schmizz.sshj.xfer.LocalSourceFile
-
getChildren
public Iterable<? extends net.schmizz.sshj.xfer.LocalSourceFile> getChildren(net.schmizz.sshj.xfer.LocalFileFilter filter) throws IOExceptionNo children.- Specified by:
getChildren
in interfacenet.schmizz.sshj.xfer.LocalSourceFile
- Throws:
IOException
-
providesAtimeMtime
public boolean providesAtimeMtime()- Specified by:
providesAtimeMtime
in interfacenet.schmizz.sshj.xfer.LocalSourceFile
-
getLastAccessTime
- Specified by:
getLastAccessTime
in interfacenet.schmizz.sshj.xfer.LocalSourceFile
- Throws:
IOException
-
getLastModifiedTime
- Specified by:
getLastModifiedTime
in interfacenet.schmizz.sshj.xfer.LocalSourceFile
- Throws:
IOException
-