Package net.schmizz.sshj.xfer
Class FileSystemFile
java.lang.Object
net.schmizz.sshj.xfer.FileSystemFile
- All Implemented Interfaces:
LocalDestFile,LocalSourceFile
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetChildren(LocalFileFilter filter) getFile()longReturns last access time for the underlying file.longReturns last access time for the underlying file.longgetName()getOutputStream(boolean append) intReturns the permissions for the underlying filegetTargetDirectory(String dirname) Allows caller to express intent that caller expects to write to directory withdirname.getTargetFile(String filename) Allows caller to express intent that caller expects to write to file withfilename.inthashCode()booleanbooleanisFile()booleanvoidsetLastAccessedTime(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.toString()private voidvalidateIsChildPath(String name)
-
Field Details
-
log
protected final org.slf4j.Logger log -
file
-
-
Constructor Details
-
FileSystemFile
-
FileSystemFile
-
-
Method Details
-
getFile
-
getName
- Specified by:
getNamein interfaceLocalSourceFile
-
isFile
public boolean isFile()- Specified by:
isFilein interfaceLocalSourceFile
-
isDirectory
public boolean isDirectory()- Specified by:
isDirectoryin interfaceLocalSourceFile
-
getLength
public long getLength()- Specified by:
getLengthin interfaceLocalDestFile- Specified by:
getLengthin interfaceLocalSourceFile
-
getInputStream
- Specified by:
getInputStreamin interfaceLocalSourceFile- Throws:
IOException
-
getOutputStream
- Specified by:
getOutputStreamin interfaceLocalDestFile- Throws:
IOException
-
getOutputStream
- Specified by:
getOutputStreamin interfaceLocalDestFile- Throws:
IOException
-
getChildren
- Specified by:
getChildrenin interfaceLocalSourceFile- Throws:
IOException
-
providesAtimeMtime
public boolean providesAtimeMtime()- Specified by:
providesAtimeMtimein interfaceLocalSourceFile
-
getLastAccessTime
Description copied from interface:LocalSourceFileReturns last access time for the underlying file.- Specified by:
getLastAccessTimein interfaceLocalSourceFile- Returns:
- time in seconds since Unix epoch
- Throws:
IOException
-
getLastModifiedTime
Description copied from interface:LocalSourceFileReturns last access time for the underlying file.- Specified by:
getLastModifiedTimein interfaceLocalSourceFile- Returns:
- time in seconds since Unix epoch
- Throws:
IOException
-
getPermissions
Description copied from interface:LocalSourceFileReturns the permissions for the underlying file- Specified by:
getPermissionsin interfaceLocalSourceFile- Returns:
- permissions e.g. 0644
- Throws:
IOException
-
setLastAccessedTime
Description 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:
IOException
-
setLastModifiedTime
Description 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:
IOException
-
setPermissions
Description copied from interface:LocalDestFileSet the permissions for the underlying file.- Specified by:
setPermissionsin interfaceLocalDestFile- Parameters:
perms- permissions e.g. 0644- Throws:
IOException
-
getChild
- Specified by:
getChildin interfaceLocalDestFile- Returns:
- A child file/directory of this directory with given
name.
-
validateIsChildPath
-
getTargetFile
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:
IOException
-
getTargetDirectory
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:
IOException
-
equals
-
hashCode
public int hashCode() -
toString
-