|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgoldengate.common.file.filesystembased.FilesystemBasedFileImpl
public abstract class FilesystemBasedFileImpl

File implementation for Filesystem Based
| Field Summary | |
|---|---|
protected String |
currentFile
Current file if any |
protected boolean |
isAppend
Is this file in append mode |
protected boolean |
isReady
Is this Document ready to be accessed |
protected SessionInterface |
session
SessionInterface |
| Constructor Summary | |
|---|---|
FilesystemBasedFileImpl(SessionInterface session,
FilesystemBasedDirImpl dir,
String path)
Special constructor for possibly external file |
|
FilesystemBasedFileImpl(SessionInterface session,
FilesystemBasedDirImpl dir,
String path,
boolean append)
|
|
| Method Summary | |
|---|---|
boolean |
abortFile()
Try to abort the current transfer if any |
boolean |
canRead()
|
boolean |
canWrite()
|
void |
checkIdentify()
Check if the authentication is correct |
void |
clear()
Set empty this FtpFile, mark it unReady. |
boolean |
closeFile()
Close the current FileInterface |
boolean |
delete()
Delete the current FileInterface. |
boolean |
exists()
|
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 FileChannel |
getFileChannel()
Returns the FileChannel in In mode associated with the current file. |
protected File |
getFileFromPath(String path)
Get the File from this path, checking first its validity |
protected FileOutputStream |
getFileOutputStream(boolean append)
Returns the FileOutputStream in Out mode associated with the current file. |
DataBlock |
getMarker()
Create a restart from context for the current FileInterface |
long |
getPosition()
Return the current position in the FileInterface. |
protected RandomAccessFile |
getRandomFile()
Returns the RandomAccessFile in Out mode associated with the current file. |
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 |
boolean |
restartMarker(Restart restart)
Restart from a Marker for the current FileInterface if any. |
boolean |
retrieve()
Ask to retrieve the current FileInterface. |
void |
setPosition(long position)
Change the position in the file. |
boolean |
store()
Ask to store the current FileInterface. |
void |
writeDataBlock(DataBlock dataBlock)
Function called by the DataNetworkHandler when it receives one DataBlock (Store like command) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final SessionInterface session
protected String currentFile
protected boolean isReady
protected boolean isAppend
| Constructor Detail |
|---|
public FilesystemBasedFileImpl(SessionInterface session,
FilesystemBasedDirImpl dir,
String path,
boolean append)
throws CommandAbstractException
session - dir - It is not necessary the directory that owns this file.path - append -
CommandAbstractException
public FilesystemBasedFileImpl(SessionInterface session,
FilesystemBasedDirImpl dir,
String path)
session - dir - It is not necessary the directory that owns this file.path - | Method Detail |
|---|
public void clear()
throws CommandAbstractException
FileInterface
clear in interface FileInterfaceCommandAbstractException
public void checkIdentify()
throws Reply530Exception
FileInterface
checkIdentify in interface FileInterfaceReply530Exceptionpublic SessionInterface getSession()
getSession in interface FileInterfacepublic DirInterface getDir()
getDir in interface FileInterface
protected File getFileFromPath(String path)
throws CommandAbstractException
path -
CommandAbstractExceptionprotected String getRelativePath(File file)
file -
public boolean isDirectory()
throws CommandAbstractException
FileInterface
isDirectory in interface FileInterfaceCommandAbstractException
public boolean isFile()
throws CommandAbstractException
FileInterface
isFile in interface FileInterfaceCommandAbstractException
public String getFile()
throws CommandAbstractException
getFile in interface FileInterfaceCommandAbstractException
public boolean closeFile()
throws CommandAbstractException
FileInterface
closeFile in interface FileInterfaceCommandAbstractException
public boolean abortFile()
throws CommandAbstractException
FileInterface
abortFile in interface FileInterfaceCommandAbstractException
public long length()
throws CommandAbstractException
length in interface FileInterfaceCommandAbstractException
public boolean isInReading()
throws CommandAbstractException
isInReading in interface FileInterfaceCommandAbstractException
public boolean isInWriting()
throws CommandAbstractException
isInWriting in interface FileInterfaceCommandAbstractException
public boolean canRead()
throws CommandAbstractException
canRead in interface FileInterfaceCommandAbstractException
public boolean canWrite()
throws CommandAbstractException
canWrite in interface FileInterfaceCommandAbstractException
public boolean exists()
throws CommandAbstractException
exists in interface FileInterfaceCommandAbstractException
public boolean delete()
throws CommandAbstractException
FileInterface
delete in interface FileInterfaceCommandAbstractException
public boolean renameTo(String path)
throws CommandAbstractException
FileInterface
renameTo in interface FileInterfacepath - the new filename (path could be relative or absolute - without
mount point)
CommandAbstractException
public DataBlock getMarker()
throws CommandAbstractException
FileInterface
getMarker in interface FileInterfaceCommandAbstractException
public boolean restartMarker(Restart restart)
throws CommandAbstractException
FileInterface
restartMarker in interface FileInterfaceCommandAbstractException
public boolean retrieve()
throws CommandAbstractException
FileInterface
retrieve in interface FileInterfaceCommandAbstractException
public boolean store()
throws CommandAbstractException
FileInterface
store in interface FileInterfaceCommandAbstractException
public DataBlock readDataBlock()
throws FileTransferException,
FileEndOfTransferException
FileInterface
readDataBlock in interface FileInterfaceFileTransferException
FileEndOfTransferException
public void writeDataBlock(DataBlock dataBlock)
throws FileTransferException
FileInterface
writeDataBlock in interface FileInterfaceFileTransferExceptionpublic long getPosition()
public void setPosition(long position)
throws IOException
position - the position to set
IOExceptionprotected boolean get(FileChannel fileChannelOut)
fileChannelOut -
protected FileChannel getFileChannel()
protected RandomAccessFile getRandomFile()
protected FileOutputStream getFileOutputStream(boolean append)
append - True if the FileOutputStream should be in append mode
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||