String[] collections = null;
boolean useWorkflow = true;
String packageType = null;
boolean submit = true;
String itemHandle = null;
PackageParameters pkgParams = new PackageParameters();
if (line.hasOption('h'))
{
HelpFormatter myhelp = new HelpFormatter();
myhelp.printHelp("Packager [options] package-file|-\n",
options);
System.out.println("\nAvailable Submission Package (SIP) types:");
String pn[] = PluginManager
.getAllPluginNames(PackageIngester.class);
for (int i = 0; i < pn.length; ++i)
System.out.println(" " + pn[i]);
System.out
.println("\nAvailable Dissemination Package (DIP) types:");
pn = PluginManager.getAllPluginNames(PackageDisseminator.class);
for (int i = 0; i < pn.length; ++i)
System.out.println(" " + pn[i]);
System.exit(0);
}
if (line.hasOption('w'))
useWorkflow = false;
if (line.hasOption('e'))
eperson = line.getOptionValue('e');
if (line.hasOption('c'))
collections = line.getOptionValues('c');
if (line.hasOption('t'))
packageType = line.getOptionValue('t');
if (line.hasOption('i'))
itemHandle = line.getOptionValue('i');
String files[] = line.getArgs();
if (files.length > 0)
sourceFile = files[0];
if (line.hasOption('d'))
submit = false;
if (line.hasOption('o'))
{
String popt[] = line.getOptionValues('o');
for (int i = 0; i < popt.length; ++i)
{
String pair[] = popt[i].split("\\=", 2);
if (pair.length == 2)
pkgParams.addProperty(pair[0].trim(), pair[1].trim());
else if (pair.length == 1)
pkgParams.addProperty(pair[0].trim(), "");
else
System.err
.println("Warning: Illegal package option format: \""
+ popt[i] + "\"");
}