@SuppressWarnings("unchecked")
public static void main(String[] args) {
long t1, t2;
try {
CommandLine cl = parseComandLine(args);
Device device = new Device("storescu");
Connection conn = new Connection();
device.addConnection(conn);
ApplicationEntity ae = new ApplicationEntity("STORESCU");
device.addApplicationEntity(ae);
ae.addConnection(conn);
StoreSCU main = new StoreSCU(ae);
configureTmpFile(main, cl);
CLIUtils.configureConnect(main.remote, main.rq, cl);
CLIUtils.configureBind(conn, ae, cl);
CLIUtils.configure(conn, cl);
main.remote.setTlsProtocols(conn.getTlsProtocols());
main.remote.setTlsCipherSuites(conn.getTlsCipherSuites());
configureRelatedSOPClass(main, cl);
main.setAttributes(new Attributes());
CLIUtils.addAttributes(main.attrs, cl.getOptionValues("s"));
main.setUIDSuffix(cl.getOptionValue("uid-suffix"));
main.setPriority(CLIUtils.priorityOf(cl));
List<String> argList = cl.getArgList();
boolean echo = argList.isEmpty();
if (!echo) {
System.out.println(rb.getString("scanning"));
t1 = System.currentTimeMillis();
main.scanFiles(argList);
t2 = System.currentTimeMillis();
int n = main.filesScanned;
System.out.println();
if (n == 0)
return;
System.out.println(MessageFormat.format(
rb.getString("scanned"), n, (t2 - t1) / 1000F,
(t2 - t1) / n));
}
ExecutorService executorService = Executors
.newSingleThreadExecutor();
ScheduledExecutorService scheduledExecutorService = Executors
.newSingleThreadScheduledExecutor();
device.setExecutor(executorService);
device.setScheduledExecutor(scheduledExecutorService);
try {
t1 = System.currentTimeMillis();
main.open();
t2 = System.currentTimeMillis();
System.out.println(MessageFormat.format(