JFileChooser not returning files with their extensions intact?

I have now come across a very annoying problem: when I use a JFileChooser on Mac OS X, any files whose extensions are hidden are returned without the extension at all. For example, using a JFileChooser and selecting a TIFF image at /Users/me/image.tiff returns a file whose path is "/Users/me/image", completely leaving out the .tiff extension (So of course, the file doesn't exist). I discovered that this only happens when the "Hide file extension" option is selected in Finder for that file type.
I have heard that on a Macintosh, you should use java.awt.FileDialog instead, would this fix the problem? Or is there some other workaround that someone else knows? Thanks in advance.

Quytelda wrote:
I have now come across a very annoying problem: when I use a JFileChooser on Mac OS X, any files whose extensions are hidden are returned without the extension at all. For example, using a JFileChooser and selecting a TIFF image at /Users/me/image.tiff returns a file whose path is "/Users/me/image", completely leaving out the .tiff extension (So of course, the file doesn't exist). I discovered that this only happens when the "Hide file extension" option is selected in Finder for that file type.Please raise a [bug report|http://bugs.sun.com/] *(<- link).*
I have heard that on a Macintosh, you should use java.awt.FileDialog instead, would this fix the problem? What happened when you tried it? If it does solve the problem, mention it as a workaround in the bug report.

Similar Messages

  • Why cannot I not open file with .wmv extensions?

    I am not able to open file attachments that have a .wmv extension - I can open power point presentations. Am I missing an app or does Apple simply not recognize these as valid files? It seems to download, but then does not ever open.

    Nevermind, got it, thanks!

  • OneDrive stopped returning files with a "+" in its file name.

    Hi,
    My app creates a folder in OneDrive in the name of the app and saves a data file with the same name in it.  My app name contains a "+" in the name.  For example "Menu+ Inventory.dat"
    All was working well for last couple of years and suddenly OneDrive is not returning files with a "+" in its name for the last few days.  Many of my app users will loose data if the file couldn't be retrieved from OneDrive.
    // Runs a search query on SkyDrive to find a matching file.
    function searchForFile(path) {
    var whenFolderFound = _searchForFolder();
    var skyDriveSearchPath = "/me/skydrive/search?q=" + path;
    // Runs async search for the user-specified file.
    var whenFilesFound = WL.api({
    path: skyDriveSearchPath,
    method: "GET"
    }).then(function (response) {
    if (response != null) {
    return WinJS.Promise.wrap(response);
    } else {
    inMemoryFile = null;
    return WinJS.Promise.wrap(false);
    In the SkyDrive Roaming Data sample, in the above function, if the skyDriveSearchPath has the above mentioned filename, the response doesn't have the file.  The sample app will create the file, save data with that name, but does not read the file. It
    can read other files with no "+" in the file name.
    Is there a change in OneDrive naming specs recently? 

    Sorted. Well sort of. I still have the problem but I know why. Apparently O2 will not allow anyone to send an attachment which has a space in the name. They claim that this reduces spam - no idea why they think that will stop spam but there you go...

  • How do I add a filter in JFileChooser for files with no extension?

    Is it possible to have a filter with that filters out files with no extension in a JFileChooser?
    Any help is appreciated.
    Shankar

    When you override accept(File), get the filename from the File object, and parse out the extension. I don't remember there being an easy way to get the extension besides looking for a dot and parsing. If there's no extension, accept it.

  • I have a problem with the mac can not read video files with the extension IMOD. How can I solve this problem?

    I have a problem with the mac can not read video files with the extension IMOD. How can I solve this problem?

    By doing a Google search. 

  • How to Set JFilechooser to show file with the same extension in the filetyp

    How to Set JFilechooser to show file with the same extension in the filetypes??
    help

    I also don't understand, but if you mean how to display only files with a certain extension in your JFileChooser then you should have a look at the JFileChooser API:
    http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JFileChooser.html
    The introduction shows an example of how to do that.

  • Recover files with wdseml extension

    The folders of my profile were corrupted without apparent cause.
    These folders and their contents (looking directly with the MS-Explorer at Windows7) does not corresponds to the content displayed at Thunderbird folders, which displays or none or only some messages. Furthermore, any mozmsgs folders contains files with names large and unintelligible (as !%26!AAAAAAAAAAAYAAAAAAAAAAvE%2B1bgVJRKvZbGQVKNZEPCgAAAEAAAAEvN9Wl6jMtPvq8AQlPK8hwBAAAAAA%3D%3D%40gmail.com, for example).
    I deleted the indexes files (msf), but the problem persisted! I tried recover from ImportExportTools 3.1 extension. Unfortunately, also without results!
    How can I do to keep my message files? I have archived messages since 2004 and would not want that to happen.

    Thank you Matt!
    I ended up discovering that these files are files visualization of windows7 to search the archives of the Thunderbird.
    However, I also discovered that I missed the messages corresponding to these files. The corresponding files from Thunderbird simply disappeared. I tried several tools such as undelete / unerase and these files appear as neither deleted files. Somehow they were erased and overwritten.
    I found that files with the extension wdseml can be renamed to eml and read like a message, but the attachments were lost.
    I believe some updating Thunderbird may have caused this, since a recent update occurred. The date of this update is the same date of multiple files still present (see the MS-Explorer), precisely the date given by my lack of posts.
    This tragedy upsets/saddens me much. I ended up losing almost 50,000 messages, all stored and organized by topics since 2004! At least I can recover the text of these messages, even without its attachments.

  • Receiving multiple files with dual extension using file adapter

    Hi,
    The scenario where I am implementing requires multiple files of different names to be picked(ABC.txt) and dropped at destination(ABC.txt.pgp) up by my File Sender and Receiver adapters.  Any idea on about how the configuration for receiving multiple files with dual extension for receiver adapter is to be done?
    Note:- currently, The scenario is working fine without dual extension. i.e Its picking all files which starts with ABC and creating at destination as it is. even I configured as ABC.txt.pgp, but its not creating the second extension.
    Thanks in Advance
    Manmadha

    Hi,
    Try to concatenate '.pgp ' to the source file name to create the target file name for the receiver file adapter, by accessing the Adapter Specific Attributes using Java user defined function. This might work.
    Reference links:
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm">SAP Help - Accessing Adapter Specific Attributes</a>
    <a href="/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14 - XI: The same filename from a sender to a receiver file adapter - SP14</a>
    Regards,
    S.Santhosh Kumar

  • Files with .ejb extension

    Hi,
    I am using the <javadoc> task in an Ant build file. I have several EJB files with th extension .ejb that I want to have included in my javadocs.
    I have the following code:
    <target name="javadoc" description="Build Java Documentation">
            <javadoc destdir="${doc.dir}">
                    <fileset dir="src">
                            <include name="**/*.ejb" />
                    </fileset>
            </javadoc>
    </target>However, when I run this I get the following error:
    [javadoc] javadoc: Illegal package name: "C:\src\com\test\ejb\CommandInputEJB.ejb"I do need the .ejb file extension for another tool to work (Ejbgen). Is there a way to get this working?
    Thanks in advance for any help!
    Arjan Huijzer

    Hi Arjun
    I'm still learning all of this myself with Ant, but looking at your script, it does not appear to be complete. I understand that you need to have certain tags included. The Ant task documentation gives good information, but in brief, in the list of parameters, the required options are indicated. Your script as a minimum, must include either '<b>sourcepath</b>', '<b>sourcepatheref</b>', or '<b>sourcefiles</b>' and you then must include '<d>destdir</b>' (which you already use).
    You can find the documentation here:
    http://ant.apache.org/manual/CoreTasks/javadoc.html
    I have never included external files such as the EJB ones you are using, but I have written my own script for generating JavaDoc HTML output. Feel free to use it if it helps.
    It uses an external file for the package list (sourcepath), called from the property:
    <i> <property name="JDOCSOURCELIST" value="JDOCSourceList.properties" /> </i>
    This is the same as the -sourcepath option of the standard JavaDoc docelt. It is formatted:
    <code>
    com.supersaus.server
    com.supersaus.server.factories
    \\\\S5\\Documentation\\com\\supersaus\\common\\Association.java
    \\\\S5\\Documentation\\com\\supersaus\\common\\CData.java
    </code>
    Other properties used in the script are:
    <code>
    <property name="JDOCDIRECTORY" value="JavaDocOutput" />
    <property name="SOURCECODEROOT" value="\\\\S5\\Documentation" />
    <property name="STYLESHEET" value="./stylesheet.css" />
    <property name="BOTTOM" value="Supersaus 2004" />
    <property name="DOCTITLE" value="Supersaus Common Files" />
    <property name="LINK" value="http://java.sun.com/j2se/1.4.2/docs/api" />
    <property name="OVERVIEW" value="doc-files\\Saus_Overview.htm" />
    </code>
    The main ant target is built up as follows:
    <code>
    <!-- Generate the JavaDoc HTML. -->
    <target name="BuildJavaDoc">
    <splash/> <!-- Add Ant progress bar -->
    <echo message="Please wait whilst the document is generated into the folder ${JDOCDIRECTORY}" />
         <!-- call javadoc -->
         <javadoc destdir="${JDOCDIRECTORY}"
         sourcePath="${SOURCECODEROOT}"
              packageList="${JDOCSOURCELIST}"
              maxmemory="180M"
              stylesheetfile="${STYLESHEET}"
              bottom="${BOTTOM}"
              Doctitle="${DOCTITLE}"
              Windowtitle="${DOCTITLE}"
              Overview="${OVERVIEW}" >
              <Link href="${LINK}"/>
         </javadoc>
    </target>
    </code>
    Hope all this helps?
    Best wishes and good luck
    Supersaus

  • File with pls extension opens with data modeler instead of sql developer

    Hello,
    I have both SQL Developer and Data Modeler installed as separate installations. If I  click in  the Windows File navigator on a file with the extension pls, the SQL Developer should open since the pls extension has been connected to SQL Developer.
    If I have neither SQLD nor DM open, SQLD opens -> ok
    If I have only SQLD open, the file is opened in SQLD -> ok
    If I have only DM open, the file is opened in DM -> not ok
    If I have both SQLD and DM open, the last started application opens the file -> sometimes ok
    Is it possible to manage the opening of a pls to open always in SQL Developer?
    Joop

    This is quite an old problem which I have seen with JDeveloper and SQLDeveloper so it may be framework related. I don't currently have both installed to check it out, but as it has been around a long time I doubt it has gone away.
    SQL files would open in either JDeveloper or SQL Developer following the pattern Joop described. Java files would only ever open in JDeveloper.    IIRC there was never a SQL file association for JDeveloper and SQLDeveloper was always the default.

  • How to output a postscript file with .ps extension name in jsp?

    Hi,
    I could use a servlet to output a postscript file with .ps file extension name. But I tried to do the same with jsp, for some reason, jsp always outputs a file with .jsp extension name though the content is postscript. Could anyone help me on this? Here is my jsp code:
    <%@page contentType="application/postscript"%>
    <%@page pageEncoding="UTF-8"%>
    <%@page import="java.util.*" %>
    <%@page import="java.io.*" %>
    <jsp:useBean id="corresv" class="oiintranet.CorresVBean" scope="request"/>
    <%
    response.setContentType("application/postscript");
    String corresId = request.getParameter("Id");
    corresv.setCorresId(corresId);
    PrintWriter output = response.getWriter();
    output = corresv.getResult(output);
    output.flush();
    %>
    In the bean corresv:
    public class CorresVBean extends BaseBean {
    private String corresId;
    public void setCorresId(String s) {
    this.corresId = s;
    public PrintWriter getResult(PrintWriter output) {
    //get postscript file content from a socket, one string line each time until reaches "X_END"
    String str;
    while ((str = in.readLine()) != null) {
    if (str.equals("X_END")) break;
    output.println (str);
    output.close();
    }catch(Exception e) {
    e.printStackTrace();
    return output;
    Thank you in advance.
    Geraldine

    Hi
    Every time u want to make a file u need to make its extension. I am talking
    about general scenario like word, excel so even when u make spool file
    so u need to give extension.
    like
    Spool temp.sql
    it will save u r file as sql file.
    hope it will help
    regards

  • Files with eml extension

    Hi there;
    I've encountered files with the extension eml.
    I am not able to see these files in any directory but they are occupying a huge amount of my tablespaces and HDDs. Each of which file is about 10MB.
    Does anyone know about these files?
    Thanks;
    Sasan Ebadian

    I'm not sure, but i think that this extension file it's from MS Outlock.

  • Spotlight content search : excludes files with .php5 extension

    My Spotlight does not find strings in files with .php5 extension. It probably does not consider these as text files.
    How can I change that ?

    I guess I found the right page :
    http://developer.apple.com/documentation/Carbon/Conceptual/understandingutis/understand_utis_intro/chapter_1_section_1.html#//appleref/doc/uid/TP40001319-CH201-SW1

  • Display jsp files with .html extension

    my problem is very straight forward i want all my jsp pages to be shown with .html extension. like if i have a page test.jsp and I access it through a hyperlink Test then in the browser's address bar i want it test.html .. any ideas ..

    That's is one odd request. The source for the page still shows that they're loading a .jsp file. To do what you want, you'd have to write javascript for every such link that handled that type of request.
    However, if you actually want all files with .html extensions to be processed like jsps you can:
    1. you can remap the JSP servlet in your web.xml file to another extension (though i'm not sure if thats part of the spec)
    2. you can also use the <jsp-property-group> element in web.xml to specify other files as JSPs. (thats definitely in the spec)

  • Search and find jpg files with uppercase extension

    Macbook pro 13 inch retina display with OS X Yosemite.
    Some of the images I'm working on are being saved with all uppercase extension .JPG.
    My questions is:
    1) Does anyone know why this is happening?
    2) Is there a way to search all the files that have the uppercase extension .JPG?
    3) How could I change all the files with uppercase extension .JPG either individually or batch all the files automatically?
    4) Is there a way to have my files saved with the normal lowercase .jpg extension for future files?
    Thank you.

    Which program are you using to edit your jpeg images?
    On a normal Mac with HFS Journaled disk format, there is not any difference with upper case or lower case file names - only if you have formatted the disk as a "HFS Journaled Case Sensitive" can you have two files that differ only in case. For example on a disk with normal formatting, if you had a file called abc.jpg you could not create another file called abc.JPG (you will get an error if you try), but on a disk that was formatted as HFS Journaled Case Sensitive you could have both files.
    So in your case the upper case files would be opened if you typed in the lower or upper case name.
    Do you have a few files with this upper case issue or lots?
    If you have only a few just rename them in Finder (Yosemite Finder now has a nice rename feature) - just highlight all the files you want to rename then right-click or control-click and select the item in the options dialog that appears named "Rename xx items" where xx is the number of items you had highlighted.
    If you have a lot let me know and will tell you a different way that is easier but involves using the command line in Terminal.
    Is it possible you accidentally had the caps lock key pressed when you typed in a name? In any event it doesn't really matter how they got the upper case name, simply changing the names to lower case should fix the problem so that it doesn't happen again.

Maybe you are looking for

  • URGENT:::::::::::::::::posting extended idoc

    i have extended orders05... created a purchase order and idoc was successully generated . i've generated an inbound idoc using we19 tool. my idoc shows status 51.. the error msg reads that there are entries to be made in required fields.... i've alre

  • How can I get rid of checkbox on shut down window

    This is the most irritating thing I have ever seen on Apple software since the 520K Mac. How can I keep it from appearing?

  • Preserving File Name

    Is there any way to force Contribute to overwrite files? We update our site daily and as a result, each time new images are loaded contribute adds a number to the end of the file, there are hundreds of "old files" example 'image_134.jpg. Is it not po

  • Change of Source System in OBIA 7.9.6.4

    hi All Our Client has decided to change the source system from EBS R11 to EBS R12.So they have completed EBS migration to R12.I have been asigned a job to configure the existing bi apps for the source EBS R12 which previosly was using EBS R11. Can an

  • Trouble making a CLR Function - Part 2

    I successfully made a CLR split function in c# and registered it in sql server.  Now I added another function to the assembly called FormatString. First I had to drop the function Split, and then the assembly CLRHelper, then I added the assembly and