Changeset 1035 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2008-10-09T09:43:59+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/OpenAction.java
r1023 r1035 7 7 import java.awt.event.InputEvent; 8 8 import java.awt.event.KeyEvent; 9 import java.io.InputStream; 9 10 import java.io.File; 10 11 import java.io.FileInputStream; … … 88 89 if (ExtensionFileFilter.filters[ExtensionFileFilter.GPX].acceptName(fn)) { 89 90 GpxReader r = null; 91 InputStream is; 90 92 if (file.getName().endsWith(".gpx.gz")) { 91 r = new GpxReader(new GZIPInputStream(new FileInputStream(file)), file.getAbsoluteFile().getParentFile());93 is = new GZIPInputStream(new FileInputStream(file)); 92 94 } else { 93 r = new GpxReader(new FileInputStream(file), file.getAbsoluteFile().getParentFile());95 is = new FileInputStream(file); 94 96 } 97 // Workaround for SAX BOM bug 98 // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6206835 99 if(!((is.read()==0xef)&&(is.read()==0xbb)&&(is.read()==0xbf))) { 100 is.close(); 101 if (file.getName().endsWith(".gpx.gz")) { 102 is = new GZIPInputStream(new FileInputStream(file)); 103 } else { 104 is = new FileInputStream(file); 105 } 106 } 107 r = new GpxReader(is,file.getAbsoluteFile().getParentFile()); 95 108 r.data.storageFile = file; 96 109 GpxLayer gpxLayer = new GpxLayer(r.data, fn);
Note:
See TracChangeset
for help on using the changeset viewer.