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 TypeMethodDescriptionboolean
getChildren
(LocalFileFilter filter) getFile()
long
Returns last access time for the underlying file.long
Returns last access time for the underlying file.long
getName()
getOutputStream
(boolean append) int
Returns 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
.int
hashCode()
boolean
boolean
isFile()
boolean
void
setLastAccessedTime
(long t) Set the last access time for the underlying file.void
setLastModifiedTime
(long t) Set the last modified time for the underlying file.void
setPermissions
(int perms) Set the permissions for the underlying file.toString()
private void
validateIsChildPath
(String name)
-
Field Details
-
log
protected final org.slf4j.Logger log -
file
-
-
Constructor Details
-
FileSystemFile
-
FileSystemFile
-
-
Method Details
-
getFile
-
getName
- Specified by:
getName
in interfaceLocalSourceFile
-
isFile
public boolean isFile()- Specified by:
isFile
in interfaceLocalSourceFile
-
isDirectory
public boolean isDirectory()- Specified by:
isDirectory
in interfaceLocalSourceFile
-
getLength
public long getLength()- Specified by:
getLength
in interfaceLocalDestFile
- Specified by:
getLength
in interfaceLocalSourceFile
-
getInputStream
- Specified by:
getInputStream
in interfaceLocalSourceFile
- Throws:
IOException
-
getOutputStream
- Specified by:
getOutputStream
in interfaceLocalDestFile
- Throws:
IOException
-
getOutputStream
- Specified by:
getOutputStream
in interfaceLocalDestFile
- Throws:
IOException
-
getChildren
- Specified by:
getChildren
in interfaceLocalSourceFile
- Throws:
IOException
-
providesAtimeMtime
public boolean providesAtimeMtime()- Specified by:
providesAtimeMtime
in interfaceLocalSourceFile
-
getLastAccessTime
Description copied from interface:LocalSourceFile
Returns last access time for the underlying file.- Specified by:
getLastAccessTime
in interfaceLocalSourceFile
- Returns:
- time in seconds since Unix epoch
- Throws:
IOException
-
getLastModifiedTime
Description copied from interface:LocalSourceFile
Returns last access time for the underlying file.- Specified by:
getLastModifiedTime
in interfaceLocalSourceFile
- Returns:
- time in seconds since Unix epoch
- Throws:
IOException
-
getPermissions
Description copied from interface:LocalSourceFile
Returns the permissions for the underlying file- Specified by:
getPermissions
in interfaceLocalSourceFile
- Returns:
- permissions e.g. 0644
- Throws:
IOException
-
setLastAccessedTime
Description copied from interface:LocalDestFile
Set the last access time for the underlying file.- Specified by:
setLastAccessedTime
in interfaceLocalDestFile
- Parameters:
t
- time in seconds since Unix epoch- Throws:
IOException
-
setLastModifiedTime
Description copied from interface:LocalDestFile
Set the last modified time for the underlying file.- Specified by:
setLastModifiedTime
in interfaceLocalDestFile
- Parameters:
t
- time in seconds since Unix epoch- Throws:
IOException
-
setPermissions
Description copied from interface:LocalDestFile
Set the permissions for the underlying file.- Specified by:
setPermissions
in interfaceLocalDestFile
- Parameters:
perms
- permissions e.g. 0644- Throws:
IOException
-
getChild
- Specified by:
getChild
in interfaceLocalDestFile
- Returns:
- A child file/directory of this directory with given
name
.
-
validateIsChildPath
-
getTargetFile
Description copied from interface:LocalDestFile
Allows 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:
getTargetFile
in interfaceLocalDestFile
- Throws:
IOException
-
getTargetDirectory
Description copied from interface:LocalDestFile
Allows 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:
getTargetDirectory
in interfaceLocalDestFile
- Throws:
IOException
-
equals
-
hashCode
public int hashCode() -
toString
-