ConfigurationUtils { public static File findTemplateDirectory( ApplicationTemplate tpl, File configurationDirectory ) { StringBuilder sb = new StringBuilder( TEMPLATES ); sb.append( "/" ); sb.append( tpl.getName()); if( ! Utils.isEmptyOrWhitespaces( tpl.getVersion())) { sb.append( " - " ); sb.append( tpl.getVersion()); } return new File( configurationDirectory, sb.toString()); } private  ConfigurationUtils(); static File findApplicationDirectory( String applicationName, File configurationDirectory ); static File findTemplateDirectory( ApplicationTemplate tpl, File configurationDirectory ); static void saveInstances( ManagedApplication ma ); static void saveInstances( Application app ); static InstancesLoadResult restoreInstances( ManagedApplication ma ); static File findIcon( String name, String qualifier, File configurationDirectory ); static void loadApplicationBindings( Application app ); static void saveApplicationBindings( Application app ); static final String TEMPLATES; static final String APPLICATIONS; static final String TARGETS; static final String INSTANCES_FILE; static final String APP_BINDINGS_FILE; static final String TARGETS_ASSOC_FILE; static final String TARGETS_HINTS_SUFFIX; static final String TARGETS_USAGE_SUFFIX; }
@Test public void testFindTemplateDirectory() { File configurationDirectory = new File( "somewhere" ); ApplicationTemplate tpl = new ApplicationTemplate( "test" ); Assert.assertEquals( "test", ConfigurationUtils.findTemplateDirectory( tpl, configurationDirectory ).getName()); tpl.setVersion( "v2" ); Assert.assertEquals( "test - v2", ConfigurationUtils.findTemplateDirectory( tpl, configurationDirectory ).getName()); }