Changeset 14982 in josm


Ignore:
Timestamp:
2019-04-10T10:09:49+02:00 (13 days ago)
Author:
GerdP
Message:

fix #17237: Poor error handling with write protected files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/io/importexport/OsmExporter.java

    r14950 r14982  
    1111import java.io.Writer;
    1212import java.nio.charset.StandardCharsets;
     13import java.nio.file.AccessDeniedException;
    1314import java.nio.file.InvalidPathException;
    1415import java.text.MessageFormat;
     
    8687        File tmpFile = null;
    8788        try {
     89            if (file.exists() && !file.canWrite()) {
     90                throw new AccessDeniedException(file.toString());
     91            }
    8892
    8993            // use a tmp file because if something errors out in the process of writing the file,
Note: See TracChangeset for help on using the changeset viewer.