public class CommandLineImporter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
ImportConfig |
config
Configuration used by all components
|
static int |
DEFAULT_WAIT |
java.util.List<FileExclusion> |
exclusions
FileExclusion mechanisms for skipping candidates |
ErrorHandler |
handler
ErrorHandler which is also responsible for uploading files
|
ImportLibrary |
library
Base importer library, this is what we actually use to import.
|
FileTransfer |
transfer
FileTransfer mechanism to be used for uploading |
Constructor and Description |
---|
CommandLineImporter(ImportConfig config,
java.lang.String[] paths,
boolean getUsedFiles)
Legacy constructor which uses a
UploadFileTransfer . |
CommandLineImporter(ImportConfig config,
java.lang.String[] paths,
boolean getUsedFiles,
FileTransfer transfer,
int minutesToWait)
Legacy constructor without any file exclusions.
|
CommandLineImporter(ImportConfig config,
java.lang.String[] paths,
boolean getUsedFiles,
FileTransfer transfer,
java.util.List<FileExclusion> exclusions,
int minutesToWait)
Main entry class for the application.
|
Modifier and Type | Method and Description |
---|---|
static void |
advUsage()
Prints advanced usage to STDERR and exits with return code 1.
|
void |
cleanup()
Cleans up after a successful or unsuccessful image import.
|
static int |
closeCompleted(ImportConfig config)
Look for all
ImportProcessPrx in the current session and close
them if they return a non-null Response (i.e. |
static void |
main(java.lang.String[] args)
Command line application entry point which parses CLI arguments and
passes them into the importer.
|
static void |
setArgument(java.util.Map<java.lang.String,java.lang.Boolean> map,
java.lang.String key)
Set a conflicting argument and return the usage if the key is already
set
|
ome.formats.importer.cli.ImportOutput |
setImportOutput(ome.formats.importer.cli.ImportOutput importOutput)
Set the current
ImportOutput (defaulting to null if
a null value is passed). |
int |
start() |
static void |
usage()
Prints usage to STDERR and exits with return code 1.
|
static int |
waitCompleted(ImportConfig config)
Look for all
ImportProcessPrx in the current session and close
them if they return a non-null Response (i.e. |
public static final int DEFAULT_WAIT
public final ImportConfig config
public final FileTransfer transfer
FileTransfer
mechanism to be used for uploadingpublic final java.util.List<FileExclusion> exclusions
FileExclusion
mechanisms for skipping candidatespublic final ImportLibrary library
public final ErrorHandler handler
public CommandLineImporter(ImportConfig config, java.lang.String[] paths, boolean getUsedFiles) throws java.lang.Exception
UploadFileTransfer
.config
- the import configurationpaths
- files or directories to searchgetUsedFiles
- if only getting a list of used filesjava.lang.Exception
- if the import could not be set uppublic CommandLineImporter(ImportConfig config, java.lang.String[] paths, boolean getUsedFiles, FileTransfer transfer, int minutesToWait) throws java.lang.Exception
config
- the import configurationpaths
- files or directories to searchgetUsedFiles
- if only getting a list of used filestransfer
- how files are to be transferred to the serverminutesToWait
- for how many minutes to wait for an import (negative for indefinitely)java.lang.Exception
- if the import could not be set uppublic CommandLineImporter(ImportConfig config, java.lang.String[] paths, boolean getUsedFiles, FileTransfer transfer, java.util.List<FileExclusion> exclusions, int minutesToWait) throws java.lang.Exception
config
- the import configurationpaths
- files or directories to searchgetUsedFiles
- if only getting a list of used filestransfer
- how files are to be transferred to the serverexclusions
- mechanisms to be used for skipping candidatesminutesToWait
- for how many minutes to wait for an import (negative for indefinitely)java.lang.Exception
- if the import could not be set uppublic static int closeCompleted(ImportConfig config) throws java.lang.Exception
ImportProcessPrx
in the current session and close
them if they return a non-null Response
(i.e. they are done).config
- the import configurationjava.lang.Exception
- in the event of errorpublic static int waitCompleted(ImportConfig config) throws java.lang.Exception
ImportProcessPrx
in the current session and close
them if they return a non-null Response
(i.e. they are done).config
- the import configuration0
for successjava.lang.Exception
- in the event of errorpublic ome.formats.importer.cli.ImportOutput setImportOutput(ome.formats.importer.cli.ImportOutput importOutput)
ImportOutput
(defaulting to null if
a null value is passed).importOutput
- possibly null enumeration value.public int start()
public void cleanup()
public static void usage()
public static void advUsage()
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- Command line arguments.java.lang.Exception
- in the event of errorpublic static void setArgument(java.util.Map<java.lang.String,java.lang.Boolean> map, java.lang.String key)
map
- map of conflicting propertieskey
- configuration property to be set