public class R66File extends FilesystemBasedFileImpl
currentFile, isAppend, session
isReady
Constructor and Description |
---|
R66File(R66Session session,
R66Dir dir,
String path)
This constructor is for External file
|
R66File(R66Session session,
R66Dir dir,
String path,
boolean append) |
Modifier and Type | Method and Description |
---|---|
boolean |
canRead() |
boolean |
canWrite() |
boolean |
closeFile()
Close the current FileInterface
|
boolean |
delete()
Delete the current FileInterface.
|
boolean |
exists() |
String |
getBasename() |
static String |
getBasename(String path) |
protected FileChannel |
getFileChannel()
Returns the FileChannel in In mode associated with the current file.
|
protected FileOutputStream |
getFileOutputStream(boolean append)
Returns the FileOutputStream in Out mode associated with the current
file.
|
protected String |
getFullInDir() |
protected RandomAccessFile |
getRandomFile()
Returns the RandomAccessFile in Out mode associated with the current
file.
|
R66Session |
getSession() |
File |
getTrueFile()
This method is a good to have in a true FileInterface implementation.
|
boolean |
isDirectory()
Is the current FileInterface a directory and exists
|
boolean |
isExternal() |
boolean |
isFile()
Is the current FileInterface a file and exists
|
long |
length() |
boolean |
renameTo(String path)
Rename the current FileInterface into a new filename from argument
|
boolean |
renameTo(String path,
boolean external)
Move the current file to the path as destination
|
void |
replaceFilename(String filename,
boolean isExternal)
Replace the current file with the new filename after closing the previous
one.
|
void |
retrieveBlocking(AtomicBoolean running)
Start the retrieve (send to the remote host the local file)
|
String |
toString() |
abortFile, clear, get, getDir, getFile, getFileFromPath, getPosition, getRelativePath, isInReading, isInWriting, readDataBlock, setPosition, writeDataBlock
checkIdentify, getMarker, restartMarker, retrieve, store
public R66File(R66Session session, R66Dir dir, String path, boolean append) throws CommandAbstractException
session
- dir
- path
- append
- CommandAbstractException
public R66File(R66Session session, R66Dir dir, String path)
session
- dir
- path
- public void retrieveBlocking(AtomicBoolean running) throws OpenR66RunnerErrorException, OpenR66ProtocolSystemException
running
- When false, should stop the runnerOpenR66RunnerErrorException
OpenR66ProtocolSystemException
public File getTrueFile()
public String getBasename()
public static String getBasename(String path)
path
- public R66Session getSession()
getSession
in interface FileInterface
getSession
in class FilesystemBasedFileImpl
public boolean canRead() throws CommandAbstractException
canRead
in interface FileInterface
canRead
in class FilesystemBasedFileImpl
CommandAbstractException
public boolean canWrite() throws CommandAbstractException
canWrite
in interface FileInterface
canWrite
in class FilesystemBasedFileImpl
CommandAbstractException
public boolean delete() throws CommandAbstractException
FileInterface
delete
in interface FileInterface
delete
in class FilesystemBasedFileImpl
CommandAbstractException
public boolean exists() throws CommandAbstractException
exists
in interface FileInterface
exists
in class FilesystemBasedFileImpl
CommandAbstractException
protected FileChannel getFileChannel()
FilesystemBasedFileImpl
getFileChannel
in class FilesystemBasedFileImpl
protected RandomAccessFile getRandomFile()
FilesystemBasedFileImpl
getRandomFile
in class FilesystemBasedFileImpl
protected FileOutputStream getFileOutputStream(boolean append)
getFileOutputStream
in class FilesystemBasedFileImpl
append
- True if the FileOutputStream should be in append
modepublic boolean isDirectory() throws CommandAbstractException
FileInterface
isDirectory
in interface FileInterface
isDirectory
in class FilesystemBasedFileImpl
CommandAbstractException
public boolean isFile() throws CommandAbstractException
FileInterface
isFile
in interface FileInterface
isFile
in class FilesystemBasedFileImpl
CommandAbstractException
public long length() throws CommandAbstractException
length
in interface FileInterface
length
in class FilesystemBasedFileImpl
CommandAbstractException
protected String getFullInDir()
public boolean renameTo(String path) throws CommandAbstractException
FileInterface
renameTo
in interface FileInterface
renameTo
in class FilesystemBasedFileImpl
path
- the new filename (path could be relative or absolute
-
without mount point)CommandAbstractException
public boolean renameTo(String path, boolean external) throws CommandAbstractException
path
- external
- if True, the path is outside authentication
controlCommandAbstractException
public void replaceFilename(String filename, boolean isExternal) throws CommandAbstractException
filename
- isExternal
- CommandAbstractException
public boolean closeFile() throws CommandAbstractException
FileInterface
closeFile
in interface FileInterface
closeFile
in class FilesystemBasedFileImpl
CommandAbstractException
public boolean isExternal()
Copyright © 2009–2020 Waarp. All rights reserved.