Ignore:
Timestamp:
2014-10-19T01:27:04+02:00 (10 years ago)
Author:
donvip
Message:

[josm_plugins] fix java 7 warnings / global usage of try-with-resource

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/opendata/util/opendata/ModuleListGenerator.java

    r30340 r30738  
    1515import java.util.zip.ZipOutputStream;
    1616
     17import org.openstreetmap.josm.Main;
     18
    1719public class ModuleListGenerator {
    1820
     
    2628                        baseDir = args[0];
    2729                }
    28                 try {
     30                try (
    2931                        BufferedWriter list = new BufferedWriter(new FileWriter(baseDir+"modules.txt"));
    3032                        ZipOutputStream zip = new ZipOutputStream(new FileOutputStream(baseDir+"modules-icons.zip"));
     33                ) {
    3134                        for (File file : new File(baseDir+"dist").listFiles(new FilenameFilter() {
    3235                                @Override
     
    3740                                try {
    3841                                        String filename = file.getName();
    39                                         System.out.println("Processing "+filename);
     42                                        Main.info("Processing "+filename);
    4043                                        list.write(filename+";"+url+filename); list.newLine();
    4144                                        Manifest mf = new JarFile(file).getManifest();
     
    7780                                                                        }
    7881                                                                } catch (IOException e) {
    79                                                                         System.err.println("Cannot load Image-Icon: "+value.toString());
     82                                                                        Main.error("Cannot load Image-Icon: "+value.toString());
    8083                                                                } finally {
    8184                                                                        zip.closeEntry();
     
    8487                                                }
    8588                                        }
    86                                        
     89
    8790                                } catch (IOException e) {
    88                                         e.printStackTrace();
     91                                    Main.error(e);
    8992                                }
    9093                        }
    91                         System.out.println("Done");
    92                         zip.close();
    93                         list.close();
    9494                } catch (IOException e) {
    95                         e.printStackTrace();
     95                        Main.error(e);
    9696                }
    9797        }
Note: See TracChangeset for help on using the changeset viewer.