Modify

Opened 12 years ago

Closed 10 years ago

#7896 closed defect (wontfix)

open file dialogue: files without extension not listed.

Reported by: skyper Owned by: team
Priority: minor Milestone:
Component: Core Version: latest
Keywords: open file extension java7 Cc:

Description

In the open file dialogue after setting type to "all files", files without extension are not listed eg can not be opened.

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2012-07-21 01:31:11
Last Changed Author: akks
Revision: 5355
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2012-07-20 18:48:22 +0200 (Fri, 20 Jul 2012)
Last Changed Rev: 5355

Identification: JOSM/1.5 (5355 en_GB)
Memory Usage: 136 MB / 910 MB (82 MB allocated, but free)
Java version: 1.6.0_24, Sun Microsystems Inc., OpenJDK 64-Bit Server VM
Operating system: Linux
Dataset consistency test: No problems found

Plugin: PicLayer (27883)
Plugin: conflation (0.1.6)
Plugin: jts (28415)
Plugin: mirrored_download (28418)
Plugin: restart (28438)
Plugin: undelete (28416)
Plugin: utilsplugin2 (28412)

Attachments (0)

Change History (12)

comment:1 by skyper, 12 years ago

Priority: normalminor

comment:2 by Don-vip, 12 years ago

And what should JOSM do when opening a file without extension ?

Last edited 12 years ago by Don-vip (previous) (diff)

in reply to:  2 comment:3 by skyper, 12 years ago

Replying to Don-vip:

And what should JOSM do when opening a file without extension ?

Try to open it with all known import methodes and show a warning if it can not open it or determine its type.

In my case, I did download a .xml without extension and did edit it (trying to revert manually).
JOSM does open the file with .xml or .osm as extension but refuses without.

I first was a bit surprised that my file was not listed.

I noticed that it does not work from the terminal but gives a warning.
Just remembered, I had a similar case with non-existing files.

Last edited 12 years ago by skyper (previous) (diff)

comment:4 by skyper, 12 years ago

It might be a easy solution but determining the file type from the extension seems to be not that good. On LINUX I would use "file".

comment:5 by Don-vip, 11 years ago

Keywords: java7 added

Starting from Java 7 a new method could be helpful (Files.probeContentType):
http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#probeContentType%28java.nio.file.Path%29

comment:6 by Don-vip, 10 years ago

Milestone: 14.05

comment:7 by ralfherberer78, 10 years ago

I just wanted to ask for this too - luckily I found this one here. My text:

Version 6383. The open dialog (ctrl+o) does not allow to open a file with no or an unknown extension. The last entry in the format drop down menu does only show "known" file formats.

I have a file named "data" (no extension) which is a gpx trace I would like to open (downloaded by wget from www.openstreetmap.org/trace/xxxx/data , hence this name). So JOSM should have a new "all files (*)" entry (and the old should be renamed to "all known (*.gpx, ...)").

Sure, I can rename to data.gpx. But the format of my file "data" should be recognizable from the content (or I would like to tell JOSM in a new dialog with a format list that it should be opened as gpx file).

comment:8 by mdk, 10 years ago

I think guessing the file content type is not a magic bullet. There are several different file types which are all XML. Also jar, odt and others are all zip files.

What about replacing the simple "Open" button in the Open dialog with a split button. The normal function stays the same, but the drop down list contains all possible "Open as xyz" actions. Normally the user knows exactly what he wants to open.

comment:9 by Don-vip, 10 years ago

Milestone: 14.0514.06

comment:10 by Don-vip, 10 years ago

Milestone: 14.0614.07

Move all tickets for which no work has been done yet to next milestone

comment:11 by Don-vip, 10 years ago

Milestone: 14.0714.08

move tickets to next milestone

comment:12 by Don-vip, 10 years ago

Milestone: 14.08
Resolution: wontfix
Status: newclosed

I tried to play with this new Java API but it does help at all as its implementation only returns types from known extensions... Implementing this requires too much effort for very little gain, so I won't do it. Please use extensions for your files.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.