*/
public static void main(String[] args) throws DataTransferException,
IOException, URISyntaxException {
String usage = "LocalFileTransfer --productName <name> --productRepo <repo> [--dir <dirRef>] [--files <origRef 1>...<origRef N>]\n";
MimeTypes mimeTypeRepo;
try {
mimeTypeRepo = MimeTypesFactory
.create(System
.getProperty("org.apache.oodt.cas.filemgr.mime.type.repository"));
} catch (MimeTypeException e) {
e.printStackTrace();
throw new IOException(e.getMessage());
}
String productName = null;
String productRepo = null;
String transferType = null;
Reference dirReference = null;
List<Reference> fileReferences = null;
for (int i = 0; i < args.length; i++) {
if (args[i].equals("--dir")) {
transferType = "dir";
dirReference = new Reference();
dirReference.setOrigReference(new File(new URI(args[++i])).toURI()
.toString());
LOG.log(Level.FINER,
"LocalFileTransfer.main: Generated orig reference: "
+ dirReference.getOrigReference());
} else if (args[i].equals("--files")) {
transferType = "files";
fileReferences = new Vector<Reference>();
for (int j = i + 1; j < args.length; j++) {
LOG.log(Level.FINER, "LocalFileTransfer.main: Adding file ref: "
+ args[j]);
fileReferences.add(new Reference(args[j], null,
new File(args[j]).length(), mimeTypeRepo
.getMimeType(args[j])));
}
} else if (args[i].equals("--productName")) {
productName = args[++i];
} else if (args[i].equals("--productRepo")) {