Package net.schmizz.sshj.sftp
Class RemoteFile
- java.lang.Object
-
- net.schmizz.sshj.sftp.RemoteResource
-
- net.schmizz.sshj.sftp.RemoteFile
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class RemoteFile extends RemoteResource
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
RemoteFile.ReadAheadRemoteFileInputStream
class
RemoteFile.RemoteFileInputStream
class
RemoteFile.RemoteFileOutputStream
-
Field Summary
-
Fields inherited from class net.schmizz.sshj.sftp.RemoteResource
handle, log, path, requester
-
-
Constructor Summary
Constructors Constructor Description RemoteFile(SFTPEngine requester, java.lang.String path, byte[] handle)
-
Method Summary
Modifier and Type Method Description protected Promise<Response,SFTPException>
asyncRead(long fileOffset, int len)
protected Promise<Response,SFTPException>
asyncWrite(long fileOffset, byte[] data, int off, int len)
protected int
checkReadResponse(Response res, byte[] to, int offset)
FileAttributes
fetchAttributes()
int
getOutgoingPacketOverhead()
long
length()
int
read(long fileOffset, byte[] to, int offset, int len)
void
setAttributes(FileAttributes attrs)
void
setLength(long len)
void
write(long fileOffset, byte[] data, int off, int len)
-
Methods inherited from class net.schmizz.sshj.sftp.RemoteResource
close, getPath, newRequest, toString
-
-
-
-
Constructor Detail
-
RemoteFile
public RemoteFile(SFTPEngine requester, java.lang.String path, byte[] handle)
-
-
Method Detail
-
fetchAttributes
public FileAttributes fetchAttributes() throws java.io.IOException
- Throws:
java.io.IOException
-
length
public long length() throws java.io.IOException
- Throws:
java.io.IOException
-
setLength
public void setLength(long len) throws java.io.IOException
- Throws:
java.io.IOException
-
read
public int read(long fileOffset, byte[] to, int offset, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
asyncRead
protected Promise<Response,SFTPException> asyncRead(long fileOffset, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
checkReadResponse
protected int checkReadResponse(Response res, byte[] to, int offset) throws Buffer.BufferException, SFTPException
- Throws:
Buffer.BufferException
SFTPException
-
write
public void write(long fileOffset, byte[] data, int off, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
asyncWrite
protected Promise<Response,SFTPException> asyncWrite(long fileOffset, byte[] data, int off, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
setAttributes
public void setAttributes(FileAttributes attrs) throws java.io.IOException
- Throws:
java.io.IOException
-
getOutgoingPacketOverhead
public int getOutgoingPacketOverhead()
-
-