- throw new ArgeoException("Cannot open file " + file.getName(), e);
- }
- }
-
- private void openFile(File file) {
- try {
- Desktop desktop = null;
- if (Desktop.isDesktopSupported()) {
- desktop = Desktop.getDesktop();
- desktop.open(file);
- } else {
- throw new ArgeoException("Desktop integration not supported.");
- }
- } catch (IOException e) {
- throw new ArgeoException("Cannot open file " + file.getName(), e);
+ // Note : tmpFileName = fileName if the error has been thrown while
+ // creating the tmpFile.
+ throw new ArgeoException("Cannot open file " + tmpFileName, e);
+ } finally {
+ IOUtils.closeQuietly(is);