Subject: issue when loading resources
Description: in Debian, templates and other resources are not embedded in Jar file.
 This is a problem when app tries to access the resources.
 This patch provides the path in Debian hierarcy to find resources.
Author: Olivier Sallou <osallou@debian.org>
Last-Updated: 2013-06-05
Forwarded: no
--- a/uk/ac/babraham/FastQC/Report/HTMLReportArchive.java
+++ b/uk/ac/babraham/FastQC/Report/HTMLReportArchive.java
@@ -167,12 +167,12 @@
 		data.append("\n");
 		
 		// Add in the icon files for pass/fail/warn
-		File templatesDir = new File(URLDecoder.decode(ClassLoader.getSystemResource("Templates/Icons").getFile(),"UTF-8"));
+		File templatesDir = new File("/usr/share/fastqc/Templates/Icons");
 		String [] names = templatesDir.list();
 		for (int n=0;n<names.length;n++) {
 			if (names[n].toLowerCase().endsWith(".png") || names[n].toLowerCase().endsWith(".jpg") || names[n].toLowerCase().endsWith(".jpeg")) {
 				zip.putNextEntry(new ZipEntry(folderName()+"/Icons/"+names[n]));
-				FileInputStream fileIn = new FileInputStream(new File(URLDecoder.decode(ClassLoader.getSystemResource("Templates/Icons/"+names[n]).getFile(),"UTF-8")));
+				FileInputStream fileIn = new FileInputStream(new File("/usr/share/fastqc/Templates/Icons/"+names[n]));
 				int len;
 				while ((len = fileIn.read(buffer)) > 0) { 
 					zip.write(buffer, 0, len); 
@@ -235,7 +235,7 @@
 	
 	private void addTemplate (String filename, String date) throws IOException {
 		
-		BufferedReader br = new BufferedReader(new FileReader(new File(URLDecoder.decode(ClassLoader.getSystemResource("Templates/header_template.html").getFile(),"UTF-8"))));
+		BufferedReader br = new BufferedReader(new FileReader(new File("/usr/share/fastqc/Templates/header_template.html")));
 		String line;
 		while ((line = br.readLine())!=null) {
 			
--- a/uk/ac/babraham/FastQC/Sequence/Contaminant/ContaminentFinder.java
+++ b/uk/ac/babraham/FastQC/Sequence/Contaminant/ContaminentFinder.java
@@ -60,7 +60,7 @@
 		
 		try {
 			
-			File contaminantFile = new File (URLDecoder.decode(ClassLoader.getSystemResource("Contaminants/contaminant_list.txt").getFile(),"UTF-8"));
+			File contaminantFile = new File ("/usr/share/fastqc/Contaminants/contaminant_list.txt");
 			
 			if (System.getProperty("fastqc.contaminant_file") != null && System.getProperty("fastqc.contaminant_file").length()>0) {
 				contaminantFile = new File(System.getProperty("fastqc.contaminant_file"));
