Skip to content
Snippets Groups Projects
Commit 8c9acc5f authored by gv1's avatar gv1
Browse files

fixed a type in the main parameter help listing

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@11609 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent c204b3c1
No related branches found
No related tags found
No related merge requests found
...@@ -266,10 +266,10 @@ public class ReadAndWriteEntry ...@@ -266,10 +266,10 @@ public class ReadAndWriteEntry
// note that read_only and noprompt -D parameters redundant now // note that read_only and noprompt -D parameters redundant now
System.out.println("New parameters:"); System.out.println("New parameters:");
System.out.println("-c\the URL for your Chado database e.g. db.genedb.org:5432/snapshot?genedb_ro (if not using default)"); System.out.println("-c\tthe URL for your Chado database e.g. db.genedb.org:5432/snapshot?genedb_ro (if not using default)");
System.out.println("-u\t[swing|console|script] the UI mode : run in swing (with popup dialog boxes) mode, run in console mode (choices entered in the console window), or in script mode (all choices default to continue, all parameters passed on command line) "); System.out.println("-u\t[swing|console|script] the UI mode : run in swing (with popup dialog boxes) mode, run in console mode (choices entered in the console window), or in script mode (all choices default to continue, all parameters passed on command line) ");
System.out.println("-p\tthe password for connecting to the Chado database"); System.out.println("-p\tthe password for connecting to the Chado database");
System.out.println("-fp\t the file path (the folder you want to save the files in)");
System.exit(0); System.exit(0);
} }
...@@ -280,6 +280,8 @@ public class ReadAndWriteEntry ...@@ -280,6 +280,8 @@ public class ReadAndWriteEntry
boolean include_diana_extensions = true; boolean include_diana_extensions = true;
String suffix = ".embl"; String suffix = ".embl";
String filePath = "";
for(int i = 0; i < args.length; i++) for(int i = 0; i < args.length; i++)
{ {
String key = args[i].toLowerCase(); String key = args[i].toLowerCase();
...@@ -325,6 +327,10 @@ public class ReadAndWriteEntry ...@@ -325,6 +327,10 @@ public class ReadAndWriteEntry
{ {
System.setProperty("chadoPassword", args[i + 1]); System.setProperty("chadoPassword", args[i + 1]);
} }
if (key.equals("-fp"))
{
filePath = args[i + 1];
}
} }
// run this after all the system properties have been set // run this after all the system properties have been set
...@@ -362,32 +368,39 @@ public class ReadAndWriteEntry ...@@ -362,32 +368,39 @@ public class ReadAndWriteEntry
files.toArray(names); files.toArray(names);
} }
if (filePath.length() != 0)
{
filePath += "/";
}
for(int i=0;i < names.length; i++) for(int i=0;i < names.length; i++)
{ {
System.out.println("read :: "+names[i]+" write :: "+names[i]+suffix); System.out.println("read :: "+names[i]+" write :: "+names[i]+suffix);
logger4j.info("read :: "+names[i]+" write :: "+names[i]+suffix);
Entry entry = ReadAndWriteEntry.readEntryFromDatabase(names[i], ENTRY_SOURCE); Entry entry = ReadAndWriteEntry.readEntryFromDatabase(names[i], ENTRY_SOURCE);
try try
{ {
ReadAndWriteEntry.writeDatabaseEntryToFile( ReadAndWriteEntry.writeDatabaseEntryToFile(
entry, new File(names[i]+suffix), flatten, ignoreObsolete, entry, new File(filePath + names[i]+suffix), flatten, ignoreObsolete,
false, include_diana_extensions, false, include_diana_extensions,
format, null); format, null);
System.out.println("done");
logger4j.info("done");
} }
catch(EntryInformationException eie) catch(EntryInformationException eie)
{ {
//UI.warn(eie.getMessage(), "UhOh!");
//eie.printStackTrace();
String label = "Destination format can't handle all keys/qualifiers - continue?"; String label = "Destination format can't handle all keys/qualifiers - continue?";
boolean canContinue = UI.booleanUserInput(label, eie.getMessage()); boolean canContinue = UI.booleanUserInput(label, eie.getMessage());
if (canContinue) if (canContinue)
{ {
ReadAndWriteEntry.writeDatabaseEntryToFile(entry, new File( ReadAndWriteEntry.writeDatabaseEntryToFile(entry, new File(filePath + names[i] + suffix),
names[i] + suffix), flatten, ignoreObsolete, true, flatten, ignoreObsolete, true,
include_diana_extensions, format, null); include_diana_extensions, format, null);
System.out.println("done");
logger4j.info("done");
} }
} }
entry.dispose(); entry.dispose();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment