private void validate(ProcessorEnvironment env) throws ToolException {
String outdir = (String)env.get(ToolConstants.CFG_OUTPUTDIR);
if (outdir != null) {
File dir = new File(outdir);
if (!dir.exists()) {
Message msg = new Message("DIRECTORY_NOT_EXIST", LOG, outdir);
throw new ToolException(msg);
}
if (!dir.isDirectory()) {
Message msg = new Message("NOT_A_DIRECTORY", LOG, outdir);
throw new ToolException(msg);
}
}
if (env.containsKey(ToolConstants.CFG_BINDING)) {
String[] bindings = (String[])env.get(ToolConstants.CFG_BINDING);
for (int i = 0; i < bindings.length; i++) {
File binding = new File(bindings[i]);
if (!binding.exists()) {
Message msg = new Message("FILE_NOT_EXIST", LOG, binding);
throw new ToolException(msg);
} else if (binding.isDirectory()) {
Message msg = new Message("NOT_A_FILE", LOG, binding);
throw new ToolException(msg);
}
}
}
if (!env.optionSet(ToolConstants.CFG_EXTRA_SOAPHEADER)) {
env.put(ToolConstants.CFG_EXTRA_SOAPHEADER, "false");
}
if (env.optionSet(ToolConstants.CFG_COMPILE)) {
String clsdir = (String)env.get(ToolConstants.CFG_CLASSDIR);
if (clsdir != null) {
File dir = new File(clsdir);
if (!dir.exists()) {
Message msg = new Message("DIRECTORY_NOT_EXIST", LOG, clsdir);
throw new ToolException(msg);
}
}
}
}