public String getClassName() {
return packageName;
}
};
SchemaGen schemaGen;
try {
schemaGen = new SchemaGen(arguments);
} catch (IOException e) {
getLog().error(e.getMessage(), e);
return;
} catch (URISyntaxException e) {
getLog().error(e.getMessage(), e);
return;
}
String rootPath = baseDir + File.separator + "target"
+ File.separator + "generated-sources" + File.separator
+ "main" + File.separator + "java" + File.separator;
File dir = new File(rootPath + pathToJavaClass);
dir.mkdirs();
PrintWriter out = null;
try {
out = new PrintWriter(new File(rootPath + pathToJavaClass + className + ".java"), "utf-8");
} catch (FileNotFoundException e) {
getLog().error(e.getMessage(), e);
return;
} catch (UnsupportedEncodingException e) {
getLog().error(e.getMessage(), e);
throw new RuntimeException("utf-8 not supported!");
}
try {
schemaGen.writeClass(out);
} finally {
out.flush();
}
}