Strabon

changeset 1068:589bc43488c9

Fixed encoding issues with getResource method.
author Panayiotis Smeros <psmeros@di.uoa.gr>
date Mon Apr 22 19:19:51 2013 +0300 (2013-04-22)
parents 460c3eda76b0
children 49d07fd6367e
files testsuite/src/test/java/eu/earthobservatory/testsuite/utils/TemplateTest.java
line diff
     1.1 --- a/testsuite/src/test/java/eu/earthobservatory/testsuite/utils/TemplateTest.java	Mon Apr 22 19:11:20 2013 +0300
     1.2 +++ b/testsuite/src/test/java/eu/earthobservatory/testsuite/utils/TemplateTest.java	Mon Apr 22 19:19:51 2013 +0300
     1.3 @@ -10,6 +10,7 @@
     1.4  package eu.earthobservatory.testsuite.utils;
     1.5  
     1.6  import java.io.File;
     1.7 +import java.net.URISyntaxException;
     1.8  import java.util.ArrayList;
     1.9  import java.util.Iterator;
    1.10  
    1.11 @@ -49,14 +50,18 @@
    1.12  		String testname=this.getClass().getSimpleName();
    1.13  		
    1.14  		String testpackage=this.getClass().getPackage().getName().substring(this.getClass().getPackage().getName().lastIndexOf('.')+1);
    1.15 -		File testfolder = new File(this.getClass().getResource(File.separator+testpackage+File.separator+testname+File.separator).getPath());
    1.16 +		File testfolder = null;
    1.17  		
    1.18 -		if(!testfolder.exists())
    1.19 +		try 
    1.20  		{
    1.21 -			System.out.println("Path string: "+File.separator+testpackage+File.separator+testname+File.separator);
    1.22 -			System.out.println("Path: "+this.getClass().getResource(File.separator+testpackage+File.separator+testname+File.separator).getPath());
    1.23 -			System.out.println("Folder to string: "+testfolder.toString());
    1.24 +			testfolder = new File(this.getClass().getResource(File.separator+testpackage+File.separator+testname+File.separator).toURI());
    1.25 +		} 
    1.26 +		catch (URISyntaxException e) 
    1.27 +		{
    1.28 +			e.printStackTrace();
    1.29 +			System.exit(1);
    1.30  		}
    1.31 +		
    1.32  		String[] files = testfolder.list();
    1.33  		
    1.34  		for(String file : files)