Changeset 14723 in josm for trunk/src/org
- Timestamp:
- 2019-01-23T22:20:29+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java
r14718 r14723 16 16 import java.util.Map; 17 17 import java.util.Set; 18 import java.util.stream.Collectors; 18 19 import java.util.zip.ZipEntry; 19 20 import java.util.zip.ZipOutputStream; … … 45 46 import org.openstreetmap.josm.tools.Logging; 46 47 import org.openstreetmap.josm.tools.MultiMap; 48 import org.openstreetmap.josm.tools.StreamUtils; 47 49 import org.openstreetmap.josm.tools.Utils; 48 50 import org.openstreetmap.josm.tools.XmlUtils; … … 214 216 * @see Path#relativize(Path) 215 217 */ 216 String relativize(final Path path) { 217 if (getOutput() == null) { 218 return path.toString(); 218 String relativize(Path path) { 219 final Path output = getOutput(); 220 if (output != null && path.startsWith(output.getParent())) { 221 path = output.getParent().relativize(path); 219 222 } 220 final Path sessionDirectory = getOutput().getParent(); 221 if (path.startsWith(sessionDirectory)) { 222 return sessionDirectory.relativize(path).toString(); 223 } else { 224 return path.toString(); 225 } 223 // path.toString() returns backslashes on Windows, see #17228 224 return StreamUtils.toStream(path) 225 .map(Object::toString) 226 .collect(Collectors.joining("/")); 226 227 } 227 228 }
Note:
See TracChangeset
for help on using the changeset viewer.