Ignore:
Timestamp:
2013-04-16T19:57:43+02:00 (11 years ago)
Author:
Don-vip
Message:

see #8570, #7406 - I/O refactorization:

  • Move different file copy functions to Utils.copyFile (to be replaced later by Files.copy when switching to Java 7)
  • Replace all Utils.close(XXX) by Utils.close(Closeable) -> impacted plugins: commandline, mirrored_download, opendata, piclayer
  • Add new Utils.close(ZipFile)
  • Use of Utils.close almost everywhere
  • Javadoc fixes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java

    r4996 r5874  
    3838import org.openstreetmap.josm.tools.MultiMap;
    3939import org.openstreetmap.josm.tools.Shortcut;
     40import org.openstreetmap.josm.tools.Utils;
    4041import org.xml.sax.SAXException;
    4142
     
    4849public class OpenFileAction extends DiskAccessAction {
    4950
     51    /**
     52     * The {@link ExtensionFileFilter} matching .url files
     53     */
    5054    public static final ExtensionFileFilter urlFileFilter = new ExtensionFileFilter("url", "url", tr("URL Files") + " (*.url)");
    5155
     
    5761                Shortcut.registerShortcut("system:open", tr("File: {0}", tr("Open...")), KeyEvent.VK_O, Shortcut.CTRL));
    5862        putValue("help", ht("/Action/Open"));
    59 
    6063    }
    6164
     
    296299                            }
    297300                        }
    298                         reader.close();
     301                        Utils.close(reader);
    299302                    } catch (Exception e) {
    300303                        System.err.println(e.getMessage());
     
    333336        }
    334337
     338        /**
     339         * Replies the list of files that have been successfully opened.
     340         * @return The list of files that have been successfully opened.
     341         */
    335342        public List<File> getSuccessfullyOpenedFiles() {
    336343            return successfullyOpenedFiles;
Note: See TracChangeset for help on using the changeset viewer.