Ignore:
Timestamp:
2012-03-23T21:22:46+01:00 (13 years ago)
Author:
donvip
Message:

opendata: fix filename parsing in network reading, add initial French National Forest inventory support (datagouvfr module)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/NetworkReader.java

    r28113 r28142  
    8585        } else if (contentType.startsWith("application/octet-stream")) {
    8686                //return OdsReader.class;//FIXME, can be anything
     87        } else if (contentType.startsWith("text/csv")) {
     88                return CsvReader.class;
    8789        } else if (contentType.startsWith("text/plain")) {//TODO: extract charset
    8890                return CsvReader.class;
     
    138140            if (readerClass == null) {
    139141                readerClass = findReaderByExtension(url.toLowerCase());
    140                 if (readerClass != null) {
    141                         filename = url.substring(url.lastIndexOf('/'));
    142                 }
    143142            }
    144143            if (readerClass == null) {
    145144                        throw new OsmTransferException("Cannot find appropriate reader !");//TODO handler job ?
     145            } else if (findReaderByExtension(url.toLowerCase()) != null) {
     146                filename = url.substring(url.lastIndexOf('/')+1);
    146147            }
    147148            if (readerClass.equals(ZipReader.class)) {
Note: See TracChangeset for help on using the changeset viewer.