throw new IOException("Output type not supported: " + type);
}
+ Story story = getStory(luid);
+ if (story == null) {
+ throw new IOException("Cannot find story to export: " + luid);
+ }
+
return out.process(getStory(luid), target);
}
String target = null;
MainAction action = MainAction.HELP;
Boolean plusInfo = null;
-
+
boolean noMoreActions = false;
int exitCode = 0;
exitCode = imprt(urlString);
break;
case EXPORT:
- exitCode = export(urlString, typeString, target);
+ exitCode = export(luid, typeString, target);
break;
case CONVERT:
exitCode = convert(urlString, typeString, target,
/**
* Export the {@link Story} from the {@link Library} to the given target.
*
- * @param urlString
+ * @param luid
* the story LUID
* @param typeString
* the {@link OutputType} to use
*
* @return the exit return code (0 = success)
*/
- private static int export(String urlString, String typeString, String target) {
+ private static int export(String luid, String typeString, String target) {
OutputType type = OutputType.valueOfNullOkUC(typeString);
if (type == null) {
Instance.syserr(new Exception(trans(StringId.OUTPUT_DESC,
}
try {
- Story story = Instance.getLibrary().imprt(new URL(urlString));
- Instance.getLibrary().export(story.getMeta().getLuid(), type,
- target);
+ Instance.getLibrary().export(luid, type, target);
} catch (IOException e) {
Instance.syserr(e);
return 4;