Package tv.hd3g.transfertfiles.sftp
Class SFTPFile
- java.lang.Object
-
- tv.hd3g.transfertfiles.CommonAbstractFile<SFTPFileSystem>
-
- tv.hd3g.transfertfiles.sftp.SFTPFile
-
- All Implemented Interfaces:
AbstractFile
public class SFTPFile extends CommonAbstractFile<SFTPFileSystem>
-
-
Field Summary
-
Fields inherited from class tv.hd3g.transfertfiles.CommonAbstractFile
fileSystem, path
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopyAbstractToLocal(File localFile, TransfertObserver observer)voiddelete()Not recursive.longdownloadAbstract(OutputStream outputStream, int bufferSize, SizedStoppableCopyCallback copyCallback)Only use with a regular file.booleanexists()AbstractFileSystem<?>getFileSystem()booleanisDirectory()booleanisFile()booleanisLink()booleanisSpecial()longlastModified()longlength()Stream<AbstractFile>list()voidmkdir()AbstractFilerenameTo(String path)voidsendLocalToAbstract(File localFile, TransfertObserver observer)CachedFileAttributestoCache()Stream<CachedFileAttributes>toCachedList()longuploadAbstract(InputStream inputStream, int bufferSize, SizedStoppableCopyCallback copyCallback)Only use with a regular file.-
Methods inherited from class tv.hd3g.transfertfiles.CommonAbstractFile
equals, getName, getParent, getPath, hashCode, isHidden, observableCopyStream, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface tv.hd3g.transfertfiles.AbstractFile
copyAbstractToAbstract, copyAbstractToAbstract, renameTo
-
-
-
-
Method Detail
-
getFileSystem
public AbstractFileSystem<?> getFileSystem()
- Specified by:
getFileSystemin interfaceAbstractFile- Overrides:
getFileSystemin classCommonAbstractFile<SFTPFileSystem>
-
length
public long length()
-
exists
public boolean exists()
-
delete
public void delete()
Description copied from interface:AbstractFileNot recursive.
-
isDirectory
public boolean isDirectory()
-
isFile
public boolean isFile()
-
isLink
public boolean isLink()
-
isSpecial
public boolean isSpecial()
-
lastModified
public long lastModified()
-
toCache
public CachedFileAttributes toCache()
- Returns:
- a read-only cached data version of this AbstractFile
-
list
public Stream<AbstractFile> list()
-
toCachedList
public Stream<CachedFileAttributes> toCachedList()
- Returns:
- a read-only cached list data version of AbstractFile.list
-
mkdir
public void mkdir()
-
renameTo
public AbstractFile renameTo(String path)
- Returns:
- moved file
-
copyAbstractToLocal
public void copyAbstractToLocal(File localFile, TransfertObserver observer)
-
sendLocalToAbstract
public void sendLocalToAbstract(File localFile, TransfertObserver observer)
-
downloadAbstract
public long downloadAbstract(OutputStream outputStream, int bufferSize, SizedStoppableCopyCallback copyCallback)
Description copied from interface:AbstractFileOnly use with a regular file. Type will not be checked before copy action. Never forget to call outputStream.close after download.bufferSize- can be used on internal stream transfert, but it's not mandated.- Returns:
- data size readed from this
-
uploadAbstract
public long uploadAbstract(InputStream inputStream, int bufferSize, SizedStoppableCopyCallback copyCallback)
Description copied from interface:AbstractFileOnly use with a regular file. Type will not be checked before copy action.bufferSize- can be used on internal stream transfert, but it's not mandated.- Returns:
- data size writer to this
-
-