public class R66File extends FilesystemBasedFileImpl
currentFile, currentRealFile, 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 FileInputStream |
getFileInputStream() |
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, canRead, clear, exists, getDir, getFile, getFileFromPath, getPosition, getRelativePath, isDirectory, isFile, isInReading, isInWriting, readDataBlock, 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 final void retrieveBlocking(AtomicBoolean running) throws OpenR66RunnerErrorException, OpenR66ProtocolSystemException
running
- When false, should stop the runnerOpenR66RunnerErrorException
OpenR66ProtocolSystemException
public final File getTrueFile()
public final String getBasename()
public static String getBasename(String path)
path
- public final R66Session getSession()
getSession
in interface FileInterface
getSession
in class FilesystemBasedFileImpl
public final boolean canRead() throws CommandAbstractException
canRead
in interface FileInterface
canRead
in class FilesystemBasedFileImpl
CommandAbstractException
public final boolean canWrite() throws CommandAbstractException
canWrite
in interface FileInterface
canWrite
in class FilesystemBasedFileImpl
CommandAbstractException
public final boolean delete() throws CommandAbstractException
FileInterface
delete
in interface FileInterface
delete
in class FilesystemBasedFileImpl
CommandAbstractException
public final boolean exists() throws CommandAbstractException
exists
in interface FileInterface
exists
in class FilesystemBasedFileImpl
CommandAbstractException
protected final FileInputStream getFileInputStream()
getFileInputStream
in class FilesystemBasedFileImpl
protected final RandomAccessFile getRandomFile()
FilesystemBasedFileImpl
getRandomFile
in class FilesystemBasedFileImpl
protected final FileOutputStream getFileOutputStream(boolean append)
getFileOutputStream
in class FilesystemBasedFileImpl
append
- True if the FileOutputStream should be in append
modepublic final boolean isDirectory() throws CommandAbstractException
FileInterface
isDirectory
in interface FileInterface
isDirectory
in class FilesystemBasedFileImpl
CommandAbstractException
public final boolean isFile() throws CommandAbstractException
FileInterface
isFile
in interface FileInterface
isFile
in class FilesystemBasedFileImpl
CommandAbstractException
public final long length() throws CommandAbstractException
length
in interface FileInterface
length
in class FilesystemBasedFileImpl
CommandAbstractException
protected final String getFullInDir()
public final 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 final boolean renameTo(String path, boolean external) throws CommandAbstractException
path
- external
- if True, the path is outside authentication
controlCommandAbstractException
public final void replaceFilename(String filename, boolean isExternal) throws CommandAbstractException
filename
- isExternal
- CommandAbstractException
public final boolean closeFile() throws CommandAbstractException
FileInterface
closeFile
in interface FileInterface
closeFile
in class FilesystemBasedFileImpl
CommandAbstractException
public final boolean isExternal()
Copyright © 2009–2022 Waarp. All rights reserved.