UTF-16 and file names

Hi,
On Windows (2K & XP atleast) you can have file names containing characters that are represented using UTF-16. E.g. The unicode character \ubf3f (decimal equivalent 48959). Below is a snippet of code that attempts to create a file containing this character.
File f = new File ("c:/temp", "\ubf3f.txt");
FileWriter w = new FileWriter(f);
w.write("a");
w.close();
And the result is the following:
java.io.FileNotFoundException: d:\temp\?.txt (The filename, directory name, or volume label syntax is incorrect)
     at java.io.FileOutputStream.open(Native Method)
     at java.io.FileOutputStream.<init>(FileOutputStream.java:97)
     at java.io.FileOutputStream.<init>(FileOutputStream.java:57)
     at java.io.FileOutputStream.<init>(FileOutputStream.java:127)
     at java.io.FileWriter.<init>(FileWriter.java:58)
Clearly java is unable to interpret the file name. So I created the file on windows directly and it was fine. Then I tried to do a file.exists() test and it returned false. So either ways, I'm unable to work with this file in java.
Appreciate if some one can throw some light on why this is happening and what needs to be done to solve it.
Pradeep

Forgot to mention that the java version is 1.3.1_03-b03. Before posting I searched the bug database but couldn't find something that was related. If some one finds it, please do post the bug number.
Thanks,
Pradeep

Similar Messages

  • Path and file name problem when I want to download files from html

    Hi all,
    I want to write a small program to allow users download files from jsp file
    but the following files don't work .
    <%@ page language="java" import="java.net.*,java.io.*"%>
    <%@ page import ="java.util.*"%>
    <%
    try
    String SContent = request.getParameter("click");
    String SDocName = "temp.doc"; //  out put file File Name
    ServletOutputStream stream= response.getOutputStream(); // Getting ServletOutputStream
    response.setContentType("application/msword"); // Setting content type
    response.setHeader("Content-disposition","attachment;filename=\"" +SDocName+"\""); // To pop dialog box
    BufferedInputStream in = new BufferedInputStream(new FileInputStream(SContent));
    int c;
    while ((c = in.read()) != -1){
               stream.write(c);
    in.close();
    stream.flush();
    catch(final IOException e)
    System.out.println ( "IOException." );
    catch(Exception e1)
    System.out.println ( "Exception." );
    %>I am so confuse, what is the path and file name I sould give ? for example my click should equal to http://******/Test/display.jsp?click=00-1

    Hi all,
    I got error at
    java.lang.IllegalStateException: getOutputStream() has already been called for this response
         org.apache.coyote.tomcat5.CoyoteResponse.getWriter(CoyoteResponse.java:599)
    if I want ot download file from html file.
    String SContent = request.getParameter("click");
    if I hard code like follow it work fine.
    String SContent ="C:/Project Coding.doc";
    what mistake I make.
    Thank you!

  • Get path and file name from Bfile

    Hi,
    I'm using Bfile to store images in a database. Is there a way to get the path and file name of the image from Bfile, because I need to pass that information into an image processing function.
    Many thanks.
    Sheldon

    Can you use FILEISOPEN in the DBMS_LOB package?
    See http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96591/adl03prg.htm#281893
    -- CJ

  • Definnig logical path and file names

    hallow experts,
    i wont to now about definnig logical path and file names,
    did some one have something that can help me in that
    regards

    Hi Rodrigo,
    Have a look at this link... i guess it explains what you are looking for...
    http://help.sap.com/saphelp_47x200/helpdata/en/8d/3e4ec2462a11d189000000e8323d3a/content.htm
    regards,
    Naveen

  • Path and file name

    I am running Illustrator CS4 on Windows XP.
    I have obtained a script that inserts the file name in the bottom left of the page
    // CODE BEGIN
    var pointTextRef = app.activeDocument.textFrames.add();
    pointTextRef.contents = app.activeDocument.name;
    pointTextRef.top = 20;
    pointTextRef.left = 10;
    // CODE END
    What I would like is that it inserts the path name as well ie
    "c:\temp\file.ai"
    rather than just the file name "file.ai"
    Is there anyone out there who can help me.
    Thank You

    Hi Mark,
    Thank you for this script.
    It works fine, just as I wanted.
    Much appreciated.
    Cheers
    Eddie Frankel
    Technical Officer
    Department of Primary Industries
    55 Collins Street
    Melbourne
    GPO Box 4440
    Melbourne
    Vic. 3001
    Phone: 03 9 658 4539
    Fax: 03 9 658 4555
    Email: [email protected]
    This e-mail and any attachments may contain information that is
    confidential, legally
    privileged and/or copyright. If you are not the intended recipient, any
    use, disclosure
    distribution or reliance on the information contained in this e-mail is
    unauthorised.
    You should only re-transmit or distribute the information if you are
    authorised to do so.
    If you have received this e-mail in error please notify the Department of
    Primary Industries
    by return e-mail and destroy all copies printed or held on any computer.
    DPI does not warranty that this e-mail and any attachments are free of
    viruses.
    Muppet Mark <[email protected]>
    02/10/2009 09:25 PM
    Please respond to
    [email protected]
    To
    eddie frankel <[email protected]>
    cc
    Subject
    path and file name
    I think you want is 'fullName'
    var docRef = app.activeDocument
    var pointTextRef = docRef.textFrames.add();
    pointTextRef.contents = docRef.name + '  ' + docRef.fullName;
    pointTextRef.top = 20;
    pointTextRef.left = 10;

  • Path and File name of the attachment

    Hello Srm Guys,
    Where should be the Path and File name of the attachment are stored for a shopping card Item.
    Thanks
    Ram

    Hello Ram,
    Execute the function module BBP_PROCDOC_ITEM_GETDETAIL by providing the item guid,object type . Now it will populate the  et_attach importing parameter with the attatchement details.
    In the ET_ATTATCH internal table , the field PHIO_FNAME/PHIO_PATH_FILE provides the physical storage location of the document.
    Hope this info will be helpful.
    Regards,
    Mani

  • How to show rating dots and file name underneath thumbnail in Bridge CS4 preview workspace?

    How to show rating dots and file name underneath thumbnail in Bridge CS4 preview workspace?

    Thank you! That was it. The option to change it is not available in preferences (though I believe it was in early CS versions). It's hidden in a dropdown menu associated with an icon at the top. It sure wasn't easy to find, and I probably would not have done so without your lead. Thanks again!

  • Need script to add path and file name to fillable  form

    I have a fillable pdf form that I would like to have a script that adds the path and file name to the form. This script would be in a field at the end of the document.
    I am a newbie to javascript and formcalc. The script will be the only one in the form.
    Thanks for any assistance.
    Lisa

    Hi,
    I have a sample that attach a file to the PDF and write in a text field the file name. I don´t know how to get the full path and it only works in Acrobat. To work in Adobe Reader is necessary the LC Reader Extensions to give some special permissions to the document. But, regard this, you still want the sample send me a email to [email protected]
    Best Regards,

  • Max length of VI file paths and file names

    Hi,
    Is there a maximum allowed length of VI file paths and file names in LabVIEW? I'm running LV 6.0.2i on NT and is trying to save a VI inside a LLB and LabVIEW crashes each time. I have also tried to copy the VI from the LLB to a temp folder with the Librarian VI, but LabVIEW crashes as well. The total length of the file path is around 260 characters and I strongly suspect the file path length in combination with LLB because when I use a shorter path the problem disappear. If I use a long path without LLB (just regular VIs) a warning appear "Invalid file name" instead of LabVIEW crashing.
    Does anybody know the solution to this problem or must I use shorter filepaths? Perhaps it depends on which platform I am running
    LV on?
    Sincerely,
    Mattias Ericsson

    "Mattias Ericsson" wrote in message
    news:[email protected]..
    > Hi,
    >
    > Is there a maximum allowed length of VI file paths and file names in
    > LabVIEW? I'm running LV 6.0.2i on NT and is trying to save a VI inside
    > a LLB and LabVIEW crashes each time. I have also tried to copy the VI
    > from the LLB to a temp folder with the Librarian VI, but LabVIEW
    > crashes as well. The total length of the file path is around 260
    > characters and I strongly suspect the file path length in combination
    > with LLB because when I use a shorter path the problem disappear. If I
    > use a long path without LLB (just regular VIs) a warning appear
    > "Invalid file name" instead of LabVIEW crashing.
    >
    > Does anybody know the solution to
    this problem or must I use shorter
    > filepaths? Perhaps it depends on which platform I am running LV on?
    I believe windows has a 255 character pathname (file+path) limit. We once
    had that problem because we had a long filename and a longer pathname.
    Moved the directory up a couple levels and problem solved.

  • Check image details like resolution, dimensions, color mode, file format, file size and file name

    I have 1000 images in a folder, i want to check their details like resolution, dimensions, color mode, file format, file size and file name into excel with nice user interface.
    Pls help me, m just learning ABCD in VB.

    The code in the file at the link below might give you a starting point. Firstly it gives you the opportunity to list all of the properties of a file type and then you can select the properties that you want and the second utility gives you the
    opportunity to list the selected properties for all files in a selected folder.
    Download and extract the file and open the file in Excel.
    Click the first button List Meta Data for One File (Run first)
    Navigate to and Select any ONE individual photo file. (Photo files because that is what you indicated you are working with.)
    You will be presented with a list of the available properties for the file. Where the Item value is blank, that property is not recorded for the particular file. Different file types have different properties and it is also dependent on how the file
    was created but generally if all of the files come from the same source then the same properties are recorded for all files from that source.
    Now insert a Y in column D for all of the required properties. (Don't select any with the Item value blank)
    Click the second button List Selected Meta Data for all Files in a Folder (Run after selecting the required properties).
    Next select a folder where the files reside. (You might need to back up to the folder if dialog is blank because it will not show individual files because the code only allows Folders.)
    You will be presented with a report listing all of the selected properties for all of the files in the selected folder.
    The user interface is not that great but you can improve on that if you want to with a Userform as you get to know VBA a little better.
    Download the file from here.
    https://onedrive.live.com/redir?resid=C2A7A5912D3D17B0!273&authkey=!ANf8R0Xf0-h3wJ8&ithint=file%2czip
    Regards, OssieMac

  • Logical Path and File Name

    Hi Everybody,
    How could I check the actual value of 2 variables which I defined with transaction \nFILE for the Logical Path and the logical file name?
    Background to this question is that I am experiencing problems in using them and want to check if the variables have correct values.....
    Thanks in advance
    FedeX.

    Hi FedeX,
    Did not get exactly what you wanted.
    May be you can try this: You can check the varibale values in the table V_PARAMVAL.
    Bye
    Dinesh

  • Search settings - default to current folder and "file name" ?

    99.9% of the time, when I enter something in the search bar of the Finder window, what I want to do is:
    1. search is the folder that I'm in
    2. search for the "file name", and
    3. then sort the results by "date modified".
    Currently, problem is:
    1. I can only change the search area (which defalts to "This Mac") after the search has begun.
    2. Likewise, the default is "content"
    3. There's not even an OPTION for "date modified". The "Last Opened" option is rarely useful.
    Please help!
    Thanks
    ip
    Message was edited by: ideapower

    Francine Schwieder wrote:
    The only one who can help us is Apple. Obviously you find this just as ridiculous as everyone else does who actually uses their computer to do things.
    While I usually think this kind of sweeping generalization is unjustified, here I do not. Spotlight has great potential, but "ridiculous" describes the implementation perfectly. I'm not terribly upset by the default to search "This Mac" -- it really isn't much of a hassle to have to click the folder button -- but the loss of the ability to choose any folder or group of folders is exactly the kind of "regressive functionality" that should have people flooding feedback with complaints.
    Just as ridiculous is the inability to show & sort on any of the metadata columns a normal Finder window offers. And if "Last Opened" is so useful in searches that it is the (unchangeable) default, why isn't it available in any other Finder view?
    Plus, does anybody really understand how the "File Name" option works? It rarely seems to make a difference -- I often enter a search phrase, look at the results, then switch to the File Name option & still see files that clearly do not have the search phrase or any part of it in their names.
    More: Try a search on Kind "Other" & enter the "Kind" info from a file's Get Info Box. Try "Application (Classic)" & note that it finds any you might have. But try "Application (Universal)" or "Application (PowerPC)" & you get ... nothing. Try just "Application (" & you get all apps. Try "Classic" & once again, any Classic apps show up, but try "Universal" or "PowerPC" & you get nothing. It's the same with many other file kinds -- sometimes the "Get Info" file kind string or some part of it works, sometimes not. Worse, the same is true for the "Kind" info taken directly from Finder windows. Try entering "Plain Text" in the Kind-Other search. I have hundreds of these but the search turns up exactly one, & it isn't even in my Documents folder.
    (Before anybody suggests it, yes I have rebuilt the Spotlight index repeatedly, using both the Privacy pane method & Terminal commands, & it makes no difference.)
    The point is not to rant but to demonstrate how poorly thought out & unreliable the app remains. I feel the problems are so obvious & widespread that we should not have to use the feedback page to tell Apple about them, but apparently we do. It really is as if it was designed by people that don't have a clue about what a search engine should do or how to integrate it into a user friendly environment.

  • Class name and file name

    if i have putiple classes in a single file then if a clas declared as public then the file name shoud me same as class name.... why?
    if i declare two public class in a same source fiel what will happen????????
    plz help................
    thanks in advance

    And i bet a million dollars that even you don't
    search the forum before posting anything . So stop
    suggesting that .Too bad that I wasn't included in the bet. You won't be coz you are a veteran and it's from you and the other veterans(I will include my peers as well) that i learnt a lot including good googling.
    It happens
    that I search the forum before I post an answer.
    Searching the forum using google is actually very
    effective.Yes and thats the very reason i didn't mention googling in that reply because i know that google gives the results from the threads in the forum as i myself have read a lot of posts at this forum using google and obtained solutions.But it's a different case when a person has to manually search the forum(without google) to see if a topic matches his needs and as i just mentioned off lately most of the posts come out with crappy headers like "Please Help Me" ; "Error" ; "Can't compile" ; "Help Needed" ; "What's wrong in this".How much sense does these headers make with respect to the what the post is really about.One can't expect a person to verify each such post with such crappy headers and read each's contentns.Just imagine how frustrating it is.Even the posters lose their cool when someone posts with such titles.Then just imagine what will be the condition of the person who is asked to check the forum before posting.But i totally endorse googling.There is no pardon or any sort of respite for a person who has posted without googling which would have fetched him top notch answers.
    Oh God!That looks really long!

  • In iMovie when I try to share a project to a file on an external hard drive it will work the first time but subsequently it says it is sharing but gives no time and file name and in fact just sits there not sharing the file.

    I have iMovie 10.0.4.  I want to transfer some old DV tape videos to MPEG 4 files to be stored on a 4 TB external drive. I successfully imported the video to iMovie, created a project by moving all captured files into a project and the first time I shared the project to a file  it worked as expected.  Every subsequent try to transfer another video would fail to transfer.  When I clicked save it gives the warning that it is too big for iCloud, iso I click create on this computer.  The progress circle comes up with no indication of progress.  The show activity drop down just says sharing to "file" no file name as in the first one and indicates no time remaining.  In fact it just sits there apparently doing nothing.  I'v tried it a half dozen times, deleted everything and started over.  It transfers the first project to file and then nothing on additional tries.  What do I have wrong, am I missing something?

    In iTunes 11 uncheck the preferences setting in in the iTunes Preferences panel "Advanced > Copy Files to iTunes Media folder when adding to Library"

  • ITunes 6.0 messing up ID3 tags and file names

    Hey guys, i have just upgraded to iTunes 6.0. I have noticed that this new version is messing up my mp3 file names. When i start up iTunes, there would be files that have their Title, artist and other info either missing, reverted to the original mp3 file name or changed to something else. This is incredibly annoying and troublesome as i have a lot of mp3 files. Does anyone else have this problem?

    Welcome to the world of Gracenotes. This is the database that Itunes reads to name your files. Apple pays a royalty to these clowns and this is what you get; misspellings and just plain wrong info.
    I constantly sort and edit my 1300 CD collection so I would suggest you learn to do the same within iTunes. If the author names are reversed, fix one then copy. Itunes will let you select and change multiple fields once you learn to do multiple selection..not hard but tedious at times.
    Apple needs to threaten to let us use the free CDDB for an alternate look up and a swap button on authors names, and so forth..

Maybe you are looking for

  • Client Merge! precautions to be taken from BW point of view

    Hi, We are in a process of merging two clients in R/3 which are typical source systems for BW! What are the steps that we should take care of while the client merge is on from R/3 side. these two clients are ofcourse very important for BW system as a

  • When I open a pdf in acrobat 9 or reader there is no toolbar on top. Anyone know how to fix this?

    When I open a pdf in acrobat 9 or reader there is no toolbar on top. Anyone know how to fix this?

  • Scrolling thumbnails Muse

    I am trying to create a thumbnail banner that can scroll across the page. I've tried doing it with lightbox widgets but none of them seem to have this functionality. Any ideas anybody? thanks Jaymack

  • L2 and L3 Forwarding Method in the Same WAE

          Hi Everyone,       Is possible to use simultaneously L2 and L3 Forwarding Method (WCCPv2) in the same WAE.       I wanna to design a cluster with 2 WAE using the same service group in a DC and I wanna support both the L2 and L3       Forwarding

  • Java script...Problem with Arrays...

    I am feeling quite lame! I am trying to get this dang thing working, it keeps giving me an error on line 15. I am just learning so please don't laugh!! This is supposed to be a javascript that will print the frequency of the roll of 2 dice. They prin