Changeset 4153 in josm for trunk/src/org


Ignore:
Timestamp:
2011-06-20T16:37:21+02:00 (13 years ago)
Author:
stoecker
Message:

fix #6213 - input stream mirror update failed on Windows

Location:
trunk/src/org/openstreetmap/josm
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java

    r4145 r4153  
    234234            fos = null;
    235235            file = new File(destDir, localPath);
    236             if(destDirFile.renameTo(file)) {
     236            if(Main.platform.rename(destDirFile, file)) {
    237237                Main.pref.putCollection(prefKey, Arrays.asList(new String[]
    238238                {Long.toString(System.currentTimeMillis()), file.toString()}));
  • trunk/src/org/openstreetmap/josm/tools/PlatformHook.java

    r3083 r4153  
    22package org.openstreetmap.josm.tools;
    33
     4import java.io.File;
    45import java.io.IOException;
    56
     
    102103
    103104    public String getDefaultStyle();
     105
     106    public boolean rename(File from, File to);
    104107}
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java

    r3378 r4153  
    33
    44import java.awt.event.KeyEvent;
     5import java.io.File;
    56import java.io.IOException;
    67import java.lang.reflect.InvocationHandler;
     
    269270        return "javax.swing.plaf.metal.MetalLookAndFeel";
    270271    }
     272
     273    @Override
     274    public boolean rename(File from, File to)
     275    {
     276        return from.renameTo(to);
     277    }
    271278}
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java

    r3083 r4153  
    33
    44import java.awt.event.KeyEvent;
     5import java.io.File;
    56import java.io.IOException;
    67
     
    7879        return "javax.swing.plaf.metal.MetalLookAndFeel";
    7980    }
     81
     82    @Override
     83    public boolean rename(File from, File to)
     84    {
     85        return from.renameTo(to);
     86    }
    8087}
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java

    r3083 r4153  
    55
    66import java.awt.event.KeyEvent;
     7import java.io.File;
    78import java.io.IOException;
    89
     
    6061        return "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
    6162    }
     63
     64    @Override
     65    public boolean rename(File from, File to)
     66    {
     67        if(to.exists())
     68            to.delete();
     69        return from.renameTo(to);
     70    }
    6271}
Note: See TracChangeset for help on using the changeset viewer.