public abstract class AbstractExecFileTransfer extends AbstractFileTransfer
AbstractFileTransfer.Transfers
log
Constructor and Description |
---|
AbstractExecFileTransfer() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkLocation(java.io.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(java.io.File location,
TransferState state)
Check that the server can properly read the copied file.
|
protected abstract java.lang.ProcessBuilder |
createProcessBuilder(java.io.File file,
java.io.File location)
Creates a
ProcessBuilder instance ready to have
ProcessBuilder.start() called on it. |
protected void |
exec(java.io.File file,
java.io.File location)
Executes a local command and fails on non-0 return codes.
|
protected java.lang.RuntimeException |
failLocationCheck(java.io.File location,
java.lang.String msg) |
protected java.io.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() |
java.lang.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 java.lang.String transfer(TransferState state) throws java.io.IOException, omero.ServerError
createProcessBuilder(File, File)
and the other protected methods here.java.io.IOException
omero.ServerError
protected java.io.File getLocalLocation(omero.model.OriginalFile root, omero.model.OriginalFile ofile)
root
- the root directoryofile
- a path relative to the rootprotected void checkLocation(java.io.File location, omero.api.RawFileStorePrx rawFileStore) throws omero.ServerError, java.io.IOException
location
- the source filerawFileStore
- the target on the serveromero.ServerError
- if the raw file store could not be usedjava.io.IOException
- for problems with the source fileprotected java.lang.RuntimeException failLocationCheck(java.io.File location, java.lang.String msg)
protected void exec(java.io.File file, java.io.File location) throws java.io.IOException
file
- the source filelocation
- the target on the serverjava.io.IOException
- for problems with the source fileprotected void checkTarget(java.io.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 java.lang.ProcessBuilder createProcessBuilder(java.io.File file, java.io.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.4.6-ice35-b87
Copyright © 2018 The University of Dundee & Open Microscopy Environment. All Rights Reserved.