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>
-
Field Summary
Fields inherited from class tv.hd3g.transfertfiles.CommonAbstractFileSystem
timeoutDuration -
Constructor Summary
ConstructorsConstructorDescriptionSFTPFileSystem(InetAddress host, int port, String username, String basePath) SFTPFileSystem(InetAddress host, int port, String username, String basePath, boolean absoluteBasePath) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidconnect()voidNeeded for simultaneous transferts: a = getFromPath() + createANewSFTPClient() + b = getFromPath() > a and b can do actions in same time.booleannet.schmizz.sshj.SSHClientgetFromPath(String path) getHost()int65535 bytesnet.schmizz.sshj.sftp.SFTPClientinthashCode()booleanbooleanbooleanIf disconnected, can we re-connect after ?booleanvoidmanuallyAddPrivatekeyAuth(File privateKey) voidmanuallyAddPrivatekeyAuth(File privateKey, char[] keyPassword) intvoidsetPasswordAuth(char[] password) voidsetStatefulSFTPClient(boolean statefulSFTPClient) voidsetTimeout(long duration, TimeUnit unit) Set socket/connection timeout.toString()Methods inherited from class tv.hd3g.transfertfiles.CommonAbstractFileSystem
getBasePath, getPathFromRelative, getTimeoutMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface tv.hd3g.transfertfiles.AbstractFileSystem
getFromPath
-
Constructor Details
-
SFTPFileSystem
-
SFTPFileSystem
public SFTPFileSystem(InetAddress host, int port, String username, String basePath, boolean absoluteBasePath)
-
-
Method Details
-
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 -
toString
-
setPasswordAuth
public void setPasswordAuth(char[] password) -
manuallyAddPrivatekeyAuth
- Parameters:
privateKey- can be a file, or a directory of key files (like "~/.ssh/")
-
manuallyAddPrivatekeyAuth
- 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() -
setTimeout
Description copied from interface:AbstractFileSystemSet socket/connection timeout.- Specified by:
setTimeoutin interfaceAbstractFileSystem<SFTPFile>- Overrides:
setTimeoutin classCommonAbstractFileSystem<SFTPFile>
-
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() -
getFromPath
- Parameters:
path- relative path only
-
isAbsoluteBasePath
public boolean isAbsoluteBasePath() -
getHost
-
getUsername
-
hashCode
public int hashCode()- Overrides:
hashCodein classCommonAbstractFileSystem<SFTPFile>
-
equals
- Overrides:
equalsin classCommonAbstractFileSystem<SFTPFile>
-
reusableHashCode
public int reusableHashCode()- Returns:
- the same code for the same internal engine instance in FileSystem. Can be used for interract two FS and protect the both are not the same.
-