Changeset 34743 in osm for applications


Ignore:
Timestamp:
2018-11-27T21:02:44+01:00 (6 years ago)
Author:
donvip
Message:

fix #josm17030 - remove indoorhelper validator file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/indoorhelper/src/org/openstreetmap/josm/plugins/indoorhelper/IndoorHelperPlugin.java

    r34733 r34743  
    6262    public IndoorHelperPlugin(PluginInformation info) throws IOException {
    6363        super(info);
    64         exportValidator("/data/indoorhelper.validator.mapcss");
    6564        exportStyleFile("sit.mapcss");
    6665        exportStyleFile("entrance_door_icon.png");
     
    7776            // Secures that the plug-in is only loaded, if a new MapFrame is created.
    7877            controller = new IndoorHelperController();
    79         }
    80     }
    81 
    82     /**
    83      * Exports the mapcss validator file to the preferences directory.
    84      * @param resourceName resource name
    85      * @throws IOException if any I/O error occurs
    86      */
    87     private void exportValidator(String resourceName) throws IOException {
    88         try (InputStream stream = IndoorHelperPlugin.class.getResourceAsStream(resourceName)) {
    89             if (stream == null) {
    90                 throw new IOException("Cannot get resource \"" + resourceName + "\" from Jar file.");
    91             }
    92 
    93             File valDir = new File(Config.getDirs().getUserDataDirectory(true), "validator");
    94             valDir.mkdirs();
    95             String outPath = valDir.getAbsolutePath() +sep+ "indoorhelper.validator.mapcss";
    96 
    97             try (OutputStream resStreamOut = new FileOutputStream(outPath)) {
    98                 int readBytes;
    99                 byte[] buffer = new byte[4096];
    100                 while ((readBytes = stream.read(buffer)) > 0) {
    101                     resStreamOut.write(buffer, 0, readBytes);
    102                 }
    103             }
    10478        }
    10579    }
Note: See TracChangeset for help on using the changeset viewer.