public abstract class AbstractExecFileTransfer extends AbstractFileTransfer
AbstractFileTransfer.Transfers
log
Constructor and Description |
---|
AbstractExecFileTransfer() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkLocation(File location,
omero.api.RawFileStorePrx rawFileStore)
Check that the target location: 1) doesn't exist and 2) is properly
written to by the server.
|
protected void |
checkTarget(File location,
TransferState state)
Check that the server can properly read the copied file.
|
protected abstract ProcessBuilder |
createProcessBuilder(File file,
File location)
Creates a
ProcessBuilder instance ready to have
ProcessBuilder.start() called on it. |
protected void |
exec(File file,
File location)
Executes a local command and fails on non-0 return codes.
|
protected RuntimeException |
failLocationCheck(File location,
String msg) |
protected File |
getLocalLocation(omero.model.OriginalFile root,
omero.model.OriginalFile ofile)
Build a path of the form "root.path/root.name/file.path/file.name".
|
protected void |
printLine() |
String |
transfer(TransferState state)
"Transfer" files by soft-linking them into place.
|
cleanupUpload, createTransfer, deleteTransferredFiles, finish, isWindows, start
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
afterTransfer
public String transfer(TransferState state) throws IOException, omero.ServerError
createProcessBuilder(File, File)
and the other protected methods here.IOException
omero.ServerError
protected File getLocalLocation(omero.model.OriginalFile root, omero.model.OriginalFile ofile)
root
- the root directoryofile
- a path relative to the rootprotected void checkLocation(File location, omero.api.RawFileStorePrx rawFileStore) throws omero.ServerError, IOException
location
- the source filerawFileStore
- the target on the serveromero.ServerError
- if the raw file store could not be usedIOException
- for problems with the source fileprotected RuntimeException failLocationCheck(File location, String msg)
protected void exec(File file, File location) throws IOException
file
- the source filelocation
- the target on the serverIOException
- for problems with the source fileprotected void checkTarget(File location, TransferState state) throws omero.ServerError
checkLocation(File, RawFileStorePrx)
but after
the invocation of exec(File, File)
, there is some chance, likely
due to file permissions, that the server will not be able to read the
transfered file. If so, raise an exception and leave the user to cleanup
and modifications.omero.ServerError
protected abstract ProcessBuilder createProcessBuilder(File file, File location)
ProcessBuilder
instance ready to have
ProcessBuilder.start()
called on it. The only critical
piece of information should be the return code.file
- File to be copied.location
- Location to copy to.protected void printLine()
printLine
in class AbstractFileTransfer
Version: 5.3.3-ice35-b63
Copyright © 2017 The University of Dundee & Open Microscopy Environment. All Rights Reserved.