
public abstract class PassthroughBasedFileImpl extends AbstractFile
| Modifier and Type | Field and Description |
|---|---|
protected String |
currentFile
Current file if any
|
protected static PassthroughFileFactory |
factory
Factory for PassthroughFile
|
protected boolean |
isAppend
Is this file in append mode
|
protected PassthroughFile |
pfile
Passthrough object
|
protected SessionInterface |
session
SessionInterface
|
isReady| Constructor and Description |
|---|
PassthroughBasedFileImpl(SessionInterface session,
PassthroughBasedDirImpl dir,
String path,
boolean append) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
abortFile()
Try to abort the current transfer if any
|
boolean |
canRead() |
boolean |
canWrite() |
void |
clear()
Set empty this FtpFile, mark it unReady.
|
boolean |
closeFile()
Close the current FileInterface
|
boolean |
delete()
Delete the current FileInterface.
|
boolean |
exists() |
void |
flush()
Try to flush written data if possible
|
protected boolean |
get(FileChannel fileChannelOut)
Write the FileInterface to the fileChannelOut, thus bypassing the limitation of the file size
to 2^32 bytes.
|
DirInterface |
getDir() |
String |
getFile() |
protected File |
getFileFromPath(String path)
Get the File from this path, checking first its validity
|
long |
getPosition()
Return the current position in the FileInterface.
|
protected String |
getRelativePath(File file)
Get the relative path (without mount point)
|
SessionInterface |
getSession() |
boolean |
isDirectory()
Is the current FileInterface a directory and exists
|
boolean |
isFile()
Is the current FileInterface a file and exists
|
boolean |
isInReading() |
boolean |
isInWriting() |
long |
length() |
DataBlock |
readDataBlock()
Read a new block for FileInterface
|
boolean |
renameTo(String path)
Rename the current FileInterface into a new filename from argument
|
void |
setPosition(long position)
Change the position in the file.
|
void |
writeDataBlock(DataBlock dataBlock)
Function called by the DataNetworkHandler when it receives one DataBlock (Store like command)
|
checkIdentify, getMarker, restartMarker, retrieve, storeprotected final SessionInterface session
protected String currentFile
protected boolean isAppend
protected PassthroughFile pfile
protected static PassthroughFileFactory factory
public PassthroughBasedFileImpl(SessionInterface session, PassthroughBasedDirImpl dir, String path, boolean append) throws CommandAbstractException
session - dir - It is not necessary the directory that owns this file.path - append - CommandAbstractExceptionPassthroughExceptionpublic void clear()
throws CommandAbstractException
FileInterfaceclear in interface FileInterfaceclear in class AbstractFileCommandAbstractExceptionpublic SessionInterface getSession()
public DirInterface getDir()
protected File getFileFromPath(String path) throws CommandAbstractException
path - CommandAbstractExceptionprotected String getRelativePath(File file)
file - public boolean isDirectory()
throws CommandAbstractException
FileInterfaceCommandAbstractExceptionpublic boolean isFile()
throws CommandAbstractException
FileInterfaceCommandAbstractExceptionpublic String getFile() throws CommandAbstractException
CommandAbstractExceptionpublic boolean closeFile()
throws CommandAbstractException
FileInterfaceCommandAbstractExceptionpublic boolean abortFile()
throws CommandAbstractException
FileInterfaceCommandAbstractExceptionpublic long length()
throws CommandAbstractException
CommandAbstractExceptionpublic boolean isInReading()
throws CommandAbstractException
CommandAbstractExceptionpublic boolean isInWriting()
throws CommandAbstractException
CommandAbstractExceptionpublic boolean canRead()
throws CommandAbstractException
CommandAbstractExceptionpublic boolean canWrite()
throws CommandAbstractException
CommandAbstractExceptionpublic boolean exists()
throws CommandAbstractException
CommandAbstractExceptionpublic boolean delete()
throws CommandAbstractException
FileInterfaceCommandAbstractExceptionpublic boolean renameTo(String path) throws CommandAbstractException
FileInterfacepath - the new filename (path could be relative or absolute - without mount point)CommandAbstractExceptionpublic DataBlock readDataBlock() throws FileTransferException, FileEndOfTransferException
FileInterfaceFileTransferExceptionFileEndOfTransferExceptionpublic void writeDataBlock(DataBlock dataBlock) throws FileTransferException
FileInterfaceFileTransferExceptionpublic long getPosition()
public void setPosition(long position)
throws IOException
position - the position to setIOExceptionpublic void flush()
protected boolean get(FileChannel fileChannelOut)
fileChannelOut - Copyright © 2009–2019 Waarp. All rights reserved.