1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
Subject: load config in /etc
Description: use config in Debian etc dirs instead of embedding data in jar
Author: Olivier Sallou <osallou@debian.org>
Last-Updated: 2014-08-19
Forwarded: no
--- a/uk/ac/babraham/FastQC/Modules/ModuleConfig.java
+++ b/uk/ac/babraham/FastQC/Modules/ModuleConfig.java
@@ -23,6 +23,7 @@ import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.InputStream;
+import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
@@ -82,7 +83,7 @@ public class ModuleConfig {
try {
if (FastQCConfig.getInstance().limits_file == null) {
- InputStream rsrc=ContaminentFinder.class.getResourceAsStream("/Configuration/limits.txt");
+ InputStream rsrc = new FileInputStream("/etc/fastqc/Configuration/limits.txt");
if (rsrc==null) throw new FileNotFoundException("cannot find Configuration/limits.txt");
br =new BufferedReader(new InputStreamReader(rsrc));
}
--- a/uk/ac/babraham/FastQC/Modules/AdapterContent.java
+++ b/uk/ac/babraham/FastQC/Modules/AdapterContent.java
@@ -25,6 +25,7 @@ import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
+import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.Vector;
@@ -70,7 +71,8 @@ public class AdapterContent extends Abst
BufferedReader br = null;
if (FastQCConfig.getInstance().adapter_file == null) {
- InputStream rsrc=ContaminentFinder.class.getResourceAsStream("/Configuration/adapter_list.txt");
+ // InputStream rsrc=ContaminentFinder.class.getResourceAsStream("/Configuration/adapter_list.txt");
+ InputStream rsrc = new FileInputStream("/etc/fastqc/Configuration/adapter_list.txt");
if (rsrc==null) throw new FileNotFoundException("cannot find Configuration/adapter_list.txt");
br =new BufferedReader(new InputStreamReader(rsrc));
}
--- a/uk/ac/babraham/FastQC/Sequence/Contaminant/ContaminentFinder.java
+++ b/uk/ac/babraham/FastQC/Sequence/Contaminant/ContaminentFinder.java
@@ -24,6 +24,7 @@ import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
+import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.Vector;
@@ -65,8 +66,8 @@ public class ContaminentFinder {
BufferedReader br = null;
if (FastQCConfig.getInstance().contaminant_file == null) {
- InputStream rsrc=ContaminentFinder.class.getResourceAsStream("/Configuration/contaminant_list.txt");
- if (rsrc==null) throw new FileNotFoundException("cannot find Confituration/contaminant_list.txt");
+ InputStream rsrc = new FileInputStream("/etc/fastqc/Configuration/contaminant_list.txt");
+ if (rsrc==null) throw new FileNotFoundException("cannot find /etc/fastqc/Configuration/contaminant_list.txt");
br =new BufferedReader(new InputStreamReader(rsrc));
}
else {
|