// do nothing
}
protected void processImpl( Template pTemplate ) {
Template template = pTemplate;
PropertySet tmps = pTemplate.getMergedPropertySet();
if( tmps.isYes( Property.main_SaveCodeWriter ) ) {
File codeWriterPath = template.getCodeWriterPath();
String codeWriterSource = template.getCodeWriterSource();
boolean changed = true;
String previousCodeWriterSource = Standard.EMPTY;
if( codeWriterPath.exists() ) {
try {
previousCodeWriterSource = FileUtil.readFile( codeWriterPath );
changed = !( codeWriterSource.equals( previousCodeWriterSource ) );
}
catch( IOException ioe ) {
// assume that this is a non-fatal error
// keep going to try to at least save the CodeWriter
changed = true;
}
}
try {
// always save code writer so that we can tell that template was parsed
FileUtil.ensureParentFolder( codeWriterPath );
FileUtil.writeFile( codeWriterPath, codeWriterSource );
WayPointRecorder.add( BasicWayPoint.SavingCodeWriter.make( codeWriterPath.getAbsolutePath() ) );
}
catch( Exception e ) {
throw ProcessException.CODE_cw_not_saved( new String[] {"path", codeWriterPath.getAbsolutePath()}, e );
}
template.setCodeWriterChanged( changed );
}
MetaUtil.saveMetaData( template );
}