Changeset 14630 in josm for trunk/src/org/openstreetmap/josm/io/session/GenericSessionExporter.java
- Timestamp:
- 2019-01-03T20:11:27+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/session/GenericSessionExporter.java
r10615 r14630 13 13 import java.io.IOException; 14 14 import java.io.OutputStream; 15 import java.n et.MalformedURLException;15 import java.nio.file.Path; 16 16 17 17 import javax.swing.AbstractAction; … … 192 192 addDataFile(support.getOutputStreamZip(zipPath)); 193 193 } else { 194 try { 195 File f = layer.getAssociatedFile(); 196 if (f != null) { 197 file.appendChild(support.createTextNode(f.toURI().toURL().toString())); 194 File f = layer.getAssociatedFile(); 195 if (f != null) { 196 final Path sessionDirectory = support.getOutput().getParent(); 197 final String fileString; 198 if (f.toPath().startsWith(sessionDirectory)) { 199 fileString = sessionDirectory.relativize(f.toPath()).toString(); 200 } else { 201 fileString = f.toPath().toString(); 198 202 } 199 } catch (MalformedURLException e) { 200 throw new IOException(e); 203 file.appendChild(support.createTextNode(fileString)); 201 204 } 202 205 }
Note:
See TracChangeset
for help on using the changeset viewer.
