From 8d5b21498a2ebdd82ed8154755b913201520e700 Mon Sep 17 00:00:00 2001 From: "gyeongseok.seo" Date: Thu, 30 May 2013 10:16:44 +0900 Subject: [PATCH] [Title] Fixed template and copy seperate logic, Fixed mapping wrong location logic [Desc.] [Issue] Change-Id: I7b1dd0de5efbee27aefdfe1a6fe863e0c5ce3e07 --- .../src/org/tizen/common/verrari/template/DirectoryTemplate.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/org.tizen.common.verrari.realm/src/org/tizen/common/verrari/template/DirectoryTemplate.java b/org.tizen.common.verrari.realm/src/org/tizen/common/verrari/template/DirectoryTemplate.java index f21f2b4..6b80dcb 100644 --- a/org.tizen.common.verrari.realm/src/org/tizen/common/verrari/template/DirectoryTemplate.java +++ b/org.tizen.common.verrari.realm/src/org/tizen/common/verrari/template/DirectoryTemplate.java @@ -54,6 +54,7 @@ import java.util.ResourceBundle; import org.tizen.common.core.command.ExecutionContext; import org.tizen.common.file.Filter; import org.tizen.common.util.IOUtil; +import org.tizen.common.util.OSChecker; import org.tizen.common.util.ReflectionUtil; import org.tizen.common.util.StringUtil; import org.tizen.common.verrari.IModelProvider; @@ -317,13 +318,13 @@ extends CommonTemplate final byte[] contents = getBytes( in ); templates.addTemplate( name, new InMemoryTemplate(contents, "utf-8", BufferFactory.getInstance() ) ); - if ( copyFilter.accept( "/", name ) ) + if ( copyFilter.accept( "/", (OSChecker.isWindows() ? name.replace( System.getProperty("file.separator"), "/" ) : name) ) ) { logger.debug( "{} is copy target", name ); this.copyNames.add( name ); continue; } - else if ( !templateFilter.accept( "/", name ) ) + else if ( !templateFilter.accept( "/", (OSChecker.isWindows() ? name.replace( System.getProperty("file.separator"), "/" ) : name) ) ) { logger.info( "{} filtered", name ); continue; @@ -400,7 +401,7 @@ extends CommonTemplate for ( final String name : this.copyNames ) { logger.trace( "Copy[{}] start", name ); - final String target = nvl( this.mapper.map( name ), name ); + final String target = nvl( this.mapper.map( (OSChecker.isWindows() ? name.replace( System.getProperty("file.separator"), "/" ) : name) ), name ); InputStream in = null; OutputStream out = null; @@ -423,7 +424,7 @@ extends CommonTemplate for ( final String name : this.templateNames ) { logger.trace( "Template[{}] start", name ); - final String target = nvl( this.mapper.map( name ), name ); + final String target = nvl( this.mapper.map( (OSChecker.isWindows() ? name.replace( System.getProperty("file.separator"), "/" ) : name) ), name ); final OutputStream out = storage.getTarget( target ); -- 2.7.4