import org.tizen.common.verrari.IModelProvider;
import org.tizen.common.verrari.ITemplate;
import org.tizen.common.verrari.ITemplateEngine;
+import org.tizen.common.verrari.ITemplateProvider;
import org.tizen.common.verrari.Storage;
import org.tizen.common.verrari.Template;
import org.tizen.common.verrari.TemplateException;
try {
pretemplate( models );
- // copy
- for ( final String name : this.copyNames )
- {
- logger.trace( "Copy[{}] start", name );
- final String target = nvl( this.mapper.map( (OSChecker.isWindows() ? name.replace( System.getProperty("file.separator"), "/" ) : name) ), name );
-
- ITemplate template = engine.getTemplateProvider().getTemplate( name );
- if ( template == null ) {
- continue;
- }
-
- InputStream in = null;
- OutputStream out = null;
- try
+ ITemplateProvider provider = engine.getTemplateProvider();
+ if ( provider != null ) {
+ // copy
+ for ( final String name : this.copyNames )
{
- in = template.open();
- out = storage.getTarget( target );
- ExecutionContext.getCurrentContext().getPrompter().notify( target + " created" );
- IOUtil.redirect( in , out );
- }
- finally
- {
- tryClose( in, out );
+ logger.trace( "Copy[{}] start", name );
+ final String target = nvl( this.mapper.map( (OSChecker.isWindows() ? name.replace( System.getProperty("file.separator"), "/" ) : name) ), name );
+ ITemplate template = provider.getTemplate( name );
+ if ( template == null ) {
+ continue;
+ }
+
+ InputStream in = null;
+ OutputStream out = null;
+ try
+ {
+ in = template.open();
+ out = storage.getTarget( target );
+ ExecutionContext.getCurrentContext().getPrompter().notify( target + " created" );
+ IOUtil.redirect( in , out );
+ }
+ finally
+ {
+ tryClose( in, out );
+ }
}
}
import org.tizen.common.util.StringUtil;\r
import org.tizen.common.verrari.IModelProvider;\r
import org.tizen.common.verrari.ITemplate;\r
+import org.tizen.common.verrari.ITemplateProvider;\r
import org.tizen.common.verrari.Storage;\r
import org.tizen.common.verrari.Template;\r
import org.tizen.common.verrari.TemplateException;\r
context.set( this );\r
try\r
{\r
- for ( final String name : this.copyNames )\r
- {\r
- logger.trace( "Copy[{}] start", name );\r
- final String target = nvl( this.mapper.map( name ), name );\r
+ ITemplateProvider provider = engine.getTemplateProvider();\r
+ if ( provider != null ) {\r
+ for ( final String name : this.copyNames )\r
+ {\r
+ logger.trace( "Copy[{}] start", name );\r
+ final String target = nvl( this.mapper.map( name ), name );\r
\r
- InputStream in = null;\r
- OutputStream out = null;\r
+ InputStream in = null;\r
+ OutputStream out = null;\r
\r
- try\r
- {\r
- ITemplate template = engine.getTemplateProvider().getTemplate( name );\r
- if ( template != null ) {\r
- in = template.open();\r
- out = storage.getTarget( target );\r
- ExecutionContext.getCurrentContext().getPrompter().notify( target + " created" );\r
- IOUtil.redirect( in , out );\r
+ try\r
+ {\r
+ ITemplate template = provider.getTemplate( name );\r
+ if ( template != null ) {\r
+ in = template.open();\r
+ out = storage.getTarget( target );\r
+ ExecutionContext.getCurrentContext().getPrompter().notify( target + " created" );\r
+ IOUtil.redirect( in , out );\r
+ }\r
+ }\r
+ finally\r
+ {\r
+ tryClose( in, out );\r
}\r
- }\r
- finally\r
- {\r
- tryClose( in, out );\r
}\r
}\r
for ( final String name : this.templateNames )\r