diff --git a/uk/ac/babraham/FastQC/Sequence/FastQFile.java b/uk/ac/babraham/FastQC/Sequence/FastQFile.java index 6c34e6c..8c84de1 100644 --- a/uk/ac/babraham/FastQC/Sequence/FastQFile.java +++ b/uk/ac/babraham/FastQC/Sequence/FastQFile.java @@ -77,17 +77,18 @@ protected FastQFile(FastQCConfig config,File file) throws SequenceFormatExceptio } System.out.println(file.toPath()); - System.out.println(Files.probeContentType(file.toPath())); - + + String content_type = Files.probeContentType(file.toPath()); + System.out.println(content_type); + if (file.getName().startsWith("stdin")) { br = new BufferedReader(new InputStreamReader(System.in)); - } - else if (Files.probeContentType(file.toPath()).equals("application/x-gzip")) { + } else if (content_type != null + && (content_type.equals("application/x-gzip") || content_type.equals("application/gzip"))) { br = new BufferedReader(new InputStreamReader(new MultiMemberGZIPInputStream(fis))); - } - else if (file.getName().toLowerCase().endsWith(".bz2")) { - br = new BufferedReader(new InputStreamReader(new BZip2InputStream(fis,false))); - } + } else if (file.getName().toLowerCase().endsWith(".bz2")) { + br = new BufferedReader(new InputStreamReader(new BZip2InputStream(fis, false))); + } else { br = new BufferedReader(new InputStreamReader(fis));