Package net.schmizz.sshj.xfer
Class InMemoryDestFile
- java.lang.Object
-
- net.schmizz.sshj.xfer.InMemoryDestFile
-
- All Implemented Interfaces:
LocalDestFile
public abstract class InMemoryDestFile extends java.lang.Object implements LocalDestFile
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Loggerlog
-
Constructor Summary
Constructors Constructor Description InMemoryDestFile()
-
Method Summary
Modifier and Type Method Description LocalDestFilegetChild(java.lang.String name)LocalDestFilegetTargetDirectory(java.lang.String dirname)Allows caller to express intent that caller expects to write to directory withdirname.InMemoryDestFilegetTargetFile(java.lang.String filename)Allows caller to express intent that caller expects to write to file withfilename.voidsetLastAccessedTime(long t)Set the last access time for the underlying file.voidsetLastModifiedTime(long t)Set the last modified time for the underlying file.voidsetPermissions(int perms)Set the permissions for the underlying file.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.schmizz.sshj.xfer.LocalDestFile
getLength, getOutputStream, getOutputStream
-
-
-
-
Method Detail
-
getTargetFile
public InMemoryDestFile getTargetFile(java.lang.String filename) throws java.io.IOException
Description copied from interface:LocalDestFileAllows caller to express intent that caller expects to write to file withfilename. Based on this information, an implementation may return an alternate file to write to, which should be respected by the caller.- Specified by:
getTargetFilein interfaceLocalDestFile- Throws:
java.io.IOException
-
setLastAccessedTime
public void setLastAccessedTime(long t) throws java.io.IOExceptionDescription copied from interface:LocalDestFileSet the last access time for the underlying file.- Specified by:
setLastAccessedTimein interfaceLocalDestFile- Parameters:
t- time in seconds since Unix epoch- Throws:
java.io.IOException
-
setLastModifiedTime
public void setLastModifiedTime(long t) throws java.io.IOExceptionDescription copied from interface:LocalDestFileSet the last modified time for the underlying file.- Specified by:
setLastModifiedTimein interfaceLocalDestFile- Parameters:
t- time in seconds since Unix epoch- Throws:
java.io.IOException
-
setPermissions
public void setPermissions(int perms) throws java.io.IOExceptionDescription copied from interface:LocalDestFileSet the permissions for the underlying file.- Specified by:
setPermissionsin interfaceLocalDestFile- Parameters:
perms- permissions e.g. 0644- Throws:
java.io.IOException
-
getTargetDirectory
public LocalDestFile getTargetDirectory(java.lang.String dirname) throws java.io.IOException
Description copied from interface:LocalDestFileAllows caller to express intent that caller expects to write to directory withdirname. Based on this information, an implementation may return an alternate directory to write to, which should be respected by the caller.- Specified by:
getTargetDirectoryin interfaceLocalDestFile- Throws:
java.io.IOException
-
getChild
public LocalDestFile getChild(java.lang.String name)
- Specified by:
getChildin interfaceLocalDestFile- Returns:
- A child file/directory of this directory with given
name.
-
-