Changeset 3612 in osm for applications/editors/josm/plugins/ywms/src/org
- Timestamp:
- 2007-07-17T20:48:52+02:00 (17 years ago)
- Location:
- applications/editors/josm/plugins/ywms/src/org/openstreetmap/josm/plugins/ywms
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/ywms/src/org/openstreetmap/josm/plugins/ywms/Util.java
r3575 r3612 246 246 return new File(localPath); 247 247 } 248 249 /** 250 * Copies the ressource 'from' to the file in the plugin directory named 'to'. 251 * @param from The source directory 252 * @param to The destination directory 253 * @throws FileNotFoundException 254 * @throws IOException 255 */ 256 public static void copy(String from, String to) throws FileNotFoundException, IOException { 257 File pluginDir = new File(getPluginDir()); 258 if (!pluginDir.exists()) 259 pluginDir.mkdirs(); 260 FileOutputStream out = new FileOutputStream(getPluginDir()+to); 261 InputStream in = Util.class.getResourceAsStream(from); 262 byte[] buffer = new byte[8192]; 263 for(int len = in.read(buffer); len > 0; len = in.read(buffer)) 264 out.write(buffer, 0, len); 265 in.close(); 266 out.close(); 267 } 248 268 } -
applications/editors/josm/plugins/ywms/src/org/openstreetmap/josm/plugins/ywms/YWMSPlugin.java
r3574 r3612 86 86 try 87 87 { 88 copy("/resources/ymap.html", "ymap.html"); 89 copy("/resources/config.html", "config.html"); 88 Util.copy("/resources/ymap.html", "ymap.html"); 89 Util.copy("/resources/config.html", "config.html"); 90 90 restartServer(); 91 91 }
Note:
See TracChangeset
for help on using the changeset viewer.