Author: nextgens
Date: 2007-11-30 11:39:55 +0000 (Fri, 30 Nov 2007)
New Revision: 16117

Modified:
   trunk/freenet/src/freenet/config/FilePersistentConfig.java
   trunk/freenet/src/freenet/node/Node.java
   trunk/freenet/src/freenet/pluginmanager/PluginManager.java
Log:
windows doesn't like/want to move files when the fds aren't closed :/

Modified: trunk/freenet/src/freenet/config/FilePersistentConfig.java
===================================================================
--- trunk/freenet/src/freenet/config/FilePersistentConfig.java  2007-11-30 
08:38:17 UTC (rev 16116)
+++ trunk/freenet/src/freenet/config/FilePersistentConfig.java  2007-11-30 
11:39:55 UTC (rev 16117)
@@ -143,7 +143,7 @@
                        synchronized(this) {
                                fs.writeTo(fos);
                        }
-
+                       fos.close();
                        FileUtil.renameTo(tempFilename, filename);
                }
                finally {

Modified: trunk/freenet/src/freenet/node/Node.java
===================================================================
--- trunk/freenet/src/freenet/node/Node.java    2007-11-30 08:38:17 UTC (rev 
16116)
+++ trunk/freenet/src/freenet/node/Node.java    2007-11-30 11:39:55 UTC (rev 
16117)
@@ -485,6 +485,7 @@
                try {
                        fos = new FileOutputStream(backup);
                        fs.writeTo(fos);
+                       fos.close();
                        FileUtil.renameTo(backup, orig);
                 } catch (IOException ioe){
                         Logger.error(this, "IOE :"+ioe.getMessage(), ioe);

Modified: trunk/freenet/src/freenet/pluginmanager/PluginManager.java
===================================================================
--- trunk/freenet/src/freenet/pluginmanager/PluginManager.java  2007-11-30 
08:38:17 UTC (rev 16116)
+++ trunk/freenet/src/freenet/pluginmanager/PluginManager.java  2007-11-30 
11:39:55 UTC (rev 16117)
@@ -515,7 +515,7 @@
                                while ((read = pluginInputStream.read(buffer)) 
!= -1) {
                                        pluginOutputStream.write(buffer, 0, 
read);
                                }
-                                                       
+                               pluginOutputStream.close();               
                                if(!FileUtil.renameTo(tempPluginFile, 
pluginFile)) {
                                        Logger.error(this, "could not rename 
temp file to plugin file");
                                        throw new 
PluginNotFoundException("could not rename temp file to plugin file");


Reply via email to