Changeset 30462 in osm for applications/editors/josm


Ignore:
Timestamp:
2014-05-20T08:27:47+02:00 (11 years ago)
Author:
bastik
Message:

see #josm10045 - Could not rename file! when writing geolocation data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingAction.java

    r30457 r30462  
    1111import java.io.File;
    1212import java.io.IOException;
     13import java.nio.file.Files;
     14import java.nio.file.Path;
     15import java.nio.file.Paths;
    1316import java.text.DecimalFormat;
    1417import java.util.ArrayList;
     
    289292                System.err.println("TMP: "+fileTmp.getAbsolutePath());
    290293            }
    291             if (! file.renameTo(fileTmp))
    292                 throw new IOException(tr("Could not rename file {0} to {1}!", file, fileTmp));
    293 
     294            try {
     295                Files.move(file.toPath(), fileTmp.toPath());
     296            } catch (IOException e) {
     297                Main.error(tr("Could not rename file {0} to {1}!", file, fileTmp));
     298                throw e;
     299            }
    294300            fileFrom = fileTmp;
    295301            fileTo = file;
Note: See TracChangeset for help on using the changeset viewer.