Package tv.hd3g.transfertfiles.sftp
Class SFTPFileSystem
- java.lang.Object
-
- tv.hd3g.transfertfiles.CommonAbstractFileSystem<SFTPFile>
-
- tv.hd3g.transfertfiles.sftp.SFTPFileSystem
-
- All Implemented Interfaces:
Closeable,AutoCloseable,AbstractFileSystem<SFTPFile>
public class SFTPFileSystem extends CommonAbstractFileSystem<SFTPFile>
-
-
Constructor Summary
Constructors Constructor Description SFTPFileSystem(InetAddress host, int port, String username, String basePath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidconnect()voidcreateANewSFTPClient()Needed for simultaneous transferts: a = getFromPath() + createANewSFTPClient() + b = getFromPath() > a and b can do actions in same time.booleanequals(Object obj)net.schmizz.sshj.SSHClientgetClient()SFTPFilegetFromPath(String path)InetAddressgetHost()intgetIOBufferSize()65535 bytesnet.schmizz.sshj.sftp.SFTPClientgetSFTPClient()StringgetUsername()inthashCode()booleanisAvaliable()booleanisReusable()If disconnected, can we re-connect after ?booleanisStatefulSFTPClient()voidmanuallyAddPrivatekeyAuth(File privateKey)voidmanuallyAddPrivatekeyAuth(File privateKey, char[] keyPassword)voidsetPasswordAuth(char[] password)voidsetStatefulSFTPClient(boolean statefulSFTPClient)StringtoString()-
Methods inherited from class tv.hd3g.transfertfiles.CommonAbstractFileSystem
getBasePath, getPathFromRelative
-
-
-
-
Constructor Detail
-
SFTPFileSystem
public SFTPFileSystem(InetAddress host, int port, String username, String basePath)
-
-
Method Detail
-
isReusable
public boolean isReusable()
Description copied from interface:AbstractFileSystemIf disconnected, can we re-connect after ?
-
isAvaliable
public boolean isAvaliable()
-
getIOBufferSize
public int getIOBufferSize()
Description copied from interface:AbstractFileSystem65535 bytes
-
setPasswordAuth
public void setPasswordAuth(char[] password)
-
manuallyAddPrivatekeyAuth
public void manuallyAddPrivatekeyAuth(File privateKey, char[] keyPassword)
- Parameters:
privateKey- can be a file, or a directory of key files (like "~/.ssh/")
-
manuallyAddPrivatekeyAuth
public void manuallyAddPrivatekeyAuth(File privateKey)
- Parameters:
privateKey- can be a file, or a directory of key files (like "~/.ssh/")
-
getClient
public net.schmizz.sshj.SSHClient getClient()
-
getSFTPClient
public net.schmizz.sshj.sftp.SFTPClient getSFTPClient()
-
connect
public void connect()
-
isStatefulSFTPClient
public boolean isStatefulSFTPClient()
-
setStatefulSFTPClient
public void setStatefulSFTPClient(boolean statefulSFTPClient)
-
createANewSFTPClient
public void createANewSFTPClient()
Needed for simultaneous transferts: a = getFromPath() + createANewSFTPClient() + b = getFromPath() > a and b can do actions in same time.
-
close
public void close()
-
getHost
public InetAddress getHost()
-
getUsername
public String getUsername()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classCommonAbstractFileSystem<SFTPFile>
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classCommonAbstractFileSystem<SFTPFile>
-
-