this.generator = generator;
this.destfileBase = destfileBase;
}
public String nextEntry(String template, ConfigGenerate generate) {
ConfigDescriptor descriptor = generate.getConfigDescriptor();
String base = generate.getTemplateBase();
template = generate.getTemplate();
String dest = generate.getDestfile();
File templateBase = descriptor.getBaseFile();
File destfileBase = this.destfileBase;
if (destfileBase == null) {
destfileBase = templateBase;
}
File destFile = new File(destfileBase, dest);
File templateFile = new File(templateBase, base + template);
File templateFileInPlace = new File(templateBase, template);
if (!templateFile.exists()) {
if (!templateFileInPlace.exists()) {
throw new ConfigException("Could not find template file: " + templateFileInPlace.getAbsolutePath()
+ " for descriptor: " + descriptor.getURL());
}
if (templateFileInPlace.getAbsolutePath().equals(destFile.getAbsolutePath())) {
templateFile.getParentFile().mkdirs();