Skip to content

Commit

Permalink
Put back gz file name detection.
Browse files Browse the repository at this point in the history
Using probeContentType is just too fragile - it breaks everywhere except
linux.

Bump version to 0.12.1
  • Loading branch information
s-andrews committed Mar 1, 2023
1 parent e5c3505 commit 2b74369
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion uk/ac/babraham/FastQC/FastQCApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

public class FastQCApplication extends JFrame {

public static final String VERSION = "0.12.0";
public static final String VERSION = "0.12.1";

private JTabbedPane fileTabs;
private WelcomePanel welcomePanel;
Expand Down
3 changes: 2 additions & 1 deletion uk/ac/babraham/FastQC/Sequence/FastQFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,15 @@ protected FastQFile(FastQCConfig config,File file) throws SequenceFormatExceptio
}
}

System.out.println(Files.probeContentType(file.toPath()));
if (!file.getName().startsWith("stdin")) {
fis = new FileInputStream(file);
}

if (file.getName().startsWith("stdin")) {
br = new BufferedReader(new InputStreamReader(System.in));
}
else if (Files.probeContentType(file.toPath()) != null && (Files.probeContentType(file.toPath()).equals("application/x-gzip") || Files.probeContentType(file.toPath()).equals("application/gzip"))) {
else if (file.getName().toLowerCase().endsWith(".gz") || (Files.probeContentType(file.toPath()) != null && (Files.probeContentType(file.toPath()).equals("application/x-gzip") || Files.probeContentType(file.toPath()).equals("application/gzip")))) {
br = new BufferedReader(new InputStreamReader(new MultiMemberGZIPInputStream(fis)));
}
else if (file.getName().toLowerCase().endsWith(".bz2")) {
Expand Down

0 comments on commit 2b74369

Please sign in to comment.