(File file)
| 561 | } |
| 562 | |
| 563 | static public InputStream createInput(File file) { |
| 564 | if (file == null) { |
| 565 | throw new IllegalArgumentException("File passed to createInput() was null"); |
| 566 | } |
| 567 | try { |
| 568 | InputStream input = new FileInputStream(file); |
| 569 | if (file.getName().toLowerCase().endsWith(".gz")) { |
| 570 | return new GZIPInputStream(input); |
| 571 | } |
| 572 | return input; |
| 573 | |
| 574 | } catch (IOException e) { |
| 575 | System.err.println("Could not createInput() for " + file); |
| 576 | e.printStackTrace(); |
| 577 | return null; |
| 578 | } |
| 579 | } |
| 580 | |
| 581 | /** |
| 582 | * Returns a path inside the applet folder to save to. Like sketchPath(), |
no test coverage detected