Changeset 23244 in osm for applications/editors/josm/plugins/smed/src
- Timestamp:
- 2010-09-17T23:14:51+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/smed/src/smed
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/src/smed/Smed.java
r23236 r23244 8 8 import java.net.URL; 9 9 import java.net.URLClassLoader; 10 import java.util.Arrays; 10 11 import java.util.Enumeration; 11 12 import java.util.List; … … 23 24 import smed.plug.SmedPluginApp; 24 25 import smed.plug.ifc.SmedPluggable; 26 import smed.plug.util.JARFileFilter; 25 27 import smed.plug.util.SmedPluginLoader; 26 28 import smed.tabs.SmedTabAction; … … 39 41 File pluginDir = Main.pref.getPluginsDirectory(); 40 42 String pluginDirName = pluginDir.getAbsolutePath(); 41 File splug = new File(pluginDirName + "/splug"); 42 if(!splug.exists()) splug.mkdir(); 43 SmedFile splugDir = new SmedFile(pluginDirName + "/splug"); 44 45 if(!splugDir.exists()) splugDir.mkdir(); 43 46 47 File[] jars = splugDir.listFiles(new JARFileFilter()); 48 44 49 // build smed_ifc.jar from smed.jar 45 50 JarEntry e = null; … … 49 54 int len; 50 55 51 System.out.println(new java.util.Date());52 53 56 try { 54 57 JarFile file = new JarFile(pluginDirName + "/smed.jar"); … … 57 60 BufferedOutputStream oos = new BufferedOutputStream( jos); 58 61 59 /* nicht ohne Versionierung freigeben60 62 // extract *.jar to splug 61 63 Enumeration<JarEntry> ent = file.entries(); … … 64 66 eName = e.getName(); 65 67 if(eName.endsWith(".jar")) { 66 FileOutputStream pfos = new FileOutputStream(pluginDirName + "/splug/" + eName); 67 BufferedOutputStream pos = new BufferedOutputStream(pfos); 68 inp = new BufferedInputStream(file.getInputStream( e )); 68 if(splugDir.needUpdate(jars,eName)) { 69 FileOutputStream pfos = new FileOutputStream(pluginDirName + "/splug/" + eName); 70 BufferedOutputStream pos = new BufferedOutputStream(pfos); 71 inp = new BufferedInputStream(file.getInputStream( e )); 69 72 70 71 72 73 while ((len = inp.read(buffer)) > 0) { 74 pos.write(buffer, 0, len); 75 } 73 76 74 pos.flush(); 75 pos.close(); 76 inp.close(); 77 pfos.close(); 77 pos.flush(); 78 pos.close(); 79 inp.close(); 80 pfos.close(); 81 } 78 82 } 79 83 } 80 */ 84 85 81 86 82 87 // write smed_ifc.jar to splug -
applications/editors/josm/plugins/smed/src/smed/plug/ifc/SmedPluggable.java
r23236 r23244 6 6 public interface SmedPluggable { 7 7 8 9 10 11 12 13 14 8 boolean start(); 9 boolean stop(); 10 String getName(); 11 String getInfo(); 12 JComponent getComponent(); 13 14 void setPluginManager(SmedPluginManager manager); 15 15 16 16 }
Note:
See TracChangeset
for help on using the changeset viewer.