public class File extends DiskEntry
| Modifier and Type | Method and Description |
|---|---|
java.io.InputStream |
getInputStream() |
java.io.InputStream |
getInputStream(ProgressListener listener) |
java.io.OutputStream |
getOutputStream() |
java.io.OutputStream |
getOutputStream(boolean append) |
java.io.OutputStream |
getOutputStream(ProgressListener listener) |
java.io.OutputStream |
getOutputStream(ProgressListener listener,
boolean append) |
int |
read(byte[] buffer,
long fileOffset)
Read data from this file starting at position fileOffset into the given buffer.
|
int |
read(byte[] buffer,
long fileOffset,
int offset,
int length)
Read data from this file starting at position fileOffset into the given buffer.
|
void |
read(java.io.OutputStream destStream) |
void |
read(java.io.OutputStream destStream,
ProgressListener progressListener) |
void |
remoteCopyTo(File destination)
Performs a remote file copy of this file to the given file.
|
void |
remoteCopyTo(long offset,
File destination,
long destinationOffset,
long length)
Copies the byte range
[offset, length] of this file to the range [destinationOffset, length]
of the given destination file. |
void |
setLength(long endOfFile)
The function for truncate or set file length for a file
|
java.lang.String |
toString() |
int |
write(byte[] buffer,
long fileOffset)
Write the data in buffer to this file at position fileOffset.
|
int |
write(byte[] buffer,
long fileOffset,
int offset,
int length)
Write the data in buffer to this file at position fileOffset.
|
int |
write(ByteChunkProvider provider)
Write all available data from the byte chunk provider to this file.
|
int |
write(ByteChunkProvider provider,
ProgressListener progressListener)
Write all available data from the byte chunk provider to this file.
|
close, closeSilently, createHardlink, createHardlink, deleteOnClose, flush, getDiskShare, getFileId, getFileInformation, getFileInformation, getFileName, getSecurityInformation, ioctl, ioctl, rename, rename, rename, setFileInformation, setSecurityInformation, setSecurityInformationpublic int write(byte[] buffer,
long fileOffset)
buffer - the data to writefileOffset - The offset, in bytes, into the file to which the data should be writtenpublic int write(byte[] buffer,
long fileOffset,
int offset,
int length)
buffer - the data to writefileOffset - The offset, in bytes, into the file to which the data should be writtenoffset - the start offset in the datalength - the number of bytes that are writtenpublic int write(ByteChunkProvider provider)
ByteChunkProvider.getOffset().provider - the byte chunk providerpublic int write(ByteChunkProvider provider, ProgressListener progressListener)
ByteChunkProvider.getOffset().provider - the byte chunk providerprogressListener - an optional callback that will be invoked when data has been written to the filepublic java.io.OutputStream getOutputStream()
public java.io.OutputStream getOutputStream(boolean append)
public java.io.OutputStream getOutputStream(ProgressListener listener)
public java.io.OutputStream getOutputStream(ProgressListener listener, boolean append)
public int read(byte[] buffer,
long fileOffset)
buffer - the buffer to write intofileOffset - The offset, in bytes, into the file from which the data should be readpublic int read(byte[] buffer,
long fileOffset,
int offset,
int length)
buffer - the buffer to write intofileOffset - The offset, in bytes, into the file from which the data should be readoffset - the start offset in the buffer at which to write datalength - the maximum number of bytes to readpublic void read(java.io.OutputStream destStream)
throws java.io.IOException
java.io.IOExceptionpublic void read(java.io.OutputStream destStream,
ProgressListener progressListener)
throws java.io.IOException
java.io.IOExceptionpublic void remoteCopyTo(File destination) throws Buffer.BufferException, TransportException
This method is equivalent to calling remoteCopyTo(0, destination, 0, sourceFileSize).
destination - the destination fileBuffer.BufferExceptionTransportExceptionpublic void remoteCopyTo(long offset,
File destination,
long destinationOffset,
long length)
throws Buffer.BufferException,
TransportException
[offset, length] of this file to the range [destinationOffset, length]
of the given destination file.destination - the destination fileBuffer.BufferExceptionTransportExceptionpublic void setLength(long endOfFile)
throws SMBApiException
endOfFile - 64-bit signed integer in bytes, MUST be greater than or equal to 0SMBApiExceptionpublic java.io.InputStream getInputStream()
public java.io.InputStream getInputStream(ProgressListener listener)
public java.lang.String toString()
toString in class java.lang.Object