Changeset 13691 in josm
- Timestamp:
- 2018-05-01T14:54:01+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java
r12894 r13691 134 134 for (final File file : files) { 135 135 if (file.exists()) { 136 this.files.add( file);136 this.files.add(Main.platform.resolveFileLink(file)); 137 137 } else if (file.getParentFile() != null) { 138 138 // try to guess an extension using the specified fileFilter -
trunk/src/org/openstreetmap/josm/tools/PlatformHook.java
r13647 r13691 358 358 // To be implemented if needed 359 359 } 360 361 /** 362 * Resolves a file link to its destination file. 363 * @param file file (link or regular file) 364 * @return destination file in case of a file link, file if regular 365 * @since 13691 366 */ 367 default File resolveFileLink(File file) { 368 // Override if needed 369 return file; 370 } 360 371 } -
trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java
r13647 r13691 34 34 import java.io.BufferedWriter; 35 35 import java.io.File; 36 import java.io.FileNotFoundException; 36 37 import java.io.IOException; 37 38 import java.io.InputStream; … … 80 81 import org.openstreetmap.josm.io.CertificateAmendment.NativeCertAmend; 81 82 import org.openstreetmap.josm.spi.preferences.Config; 83 84 import sun.awt.shell.Win32ShellFolderManager2; 82 85 83 86 /** … … 767 770 return null; 768 771 } 772 773 @Override 774 public File resolveFileLink(File file) { 775 if (file.getName().endsWith(".lnk")) { 776 try { 777 return new Win32ShellFolderManager2().createShellFolder(file).getLinkLocation(); 778 } catch (FileNotFoundException e) { 779 Logging.error(e); 780 } 781 } 782 return file; 783 } 769 784 }
Note:
See TracChangeset
for help on using the changeset viewer.