How to get the long file name from an 8.3 name in Windows.

Because of a legacy string limitation, I have a list of files in 8.3 format. The actual files are saved with long names. How can I get the long name from the short name?
In JavaScript, I would get a file system object and get the file object from there with the short name. Then it's no problem to get the full name. But I don't see anything in Java that matches that. ???
Ideas?
Frank Perry, MSEE

Here is what I did.
String displayName = "somefi~1.txt";
File fO = new File("c:\\"); // I have a more involved path but that's not important here.
String stPath = fO.getPath() + displayName;
File fD = new File(stPath); // get the file using the short name.
File fDc = new File(fD.getCanonicalPath()); // get another file using the cononical name
String FulldisplayName = fDc.getName(); // get the long name from there.
It's roundabout but it works. Since getName() on the file read with the short name only returns the name used to get the file, I open it twice. The alternative is to parse the cononical name for the file name but that's clumbsy too.
Frank

Similar Messages

  • How to get the default selection color from JTable

    Hi, there,
    I have a question for how to get the default selection color from JTable. I am currently implementing the customized table cell renderer, but I do want to set the selection color in the table exactly the same of default table cell renderer. The JTable.getSelectionBackgroup() did not works for me, it returned dark blue which made the text in the table unreadable. Anyone know how to get the window's default selection color?
    Thanks,
    -Jenny

    The windows default selection color is dark blue. Try selecting any text on this page. The difference is that the text gets changed to a white font so you can actually see the text.
    If you don't like the default colors that Java uses then use the UIManager to change the defaults. The following program shows all the properties controlled by the UIManager:
    http://www.discoverteenergy.com/files/ShowUIDefaults.java
    Any of the properties can be changed for the entire application by using:
    UIManager.put( "propertyName", value );

  • How to get the ard file of crystal reports

    Hi all,
    I have downloaded crystal reports from sap market place but i dont have .ard file for that how to transfer that reports into sap. How to get the ard file please help me out.
    Thanks & Regards,
    Murtuza Ahmed.

    When you click on your SAPCrystalSetup.exe and select the path to your add-on folder it will install the files and your ard file will be situated in your add-on folder.  Then you can start SAP up and install it from SAP. 
    So if your SAP install is in your local drive your ard file for crystal reports should be here C:\Program Files\SAP\SAP Business One\AddOns\SAP_CR
    Hope this helps.

  • How to get the wsdl file

    hi all,
    here java people have given wsdl file to me, how to do the scenario,
    and how to get the wsdl file from the java people.
    regards,
    priya

    Hello Priya,
    Go to http://<hostname>:50000/wsnavigator or any other UDDI server and search for the web service to be invoked
    There you can find the Webservice Definition (WSDL) file.
    Check this weblog:
    Invoke Webservices using SAPXI
    regards
    Gangaprasad

  • How to get the byte[] size dynamically from the StreamMessage object

    Hi all,
    Using JMS, I am receiving the FDF file as StreamMessage from the queue and attaching it to the PDF file which is present in the local system.
    For that, I have written the code as follows:
    {color:#0000ff} Message msg = jmsTemplate.receive();
    if(msg !=null && msg instanceof StreamMessage)
    StreamMessage message = (StreamMessage) msg;{color}
    {color:#ff6600}//hardcoded the byte array size value
    {color}{color:#0000ff} byte[] bytes = new byte[{color:#ff0000}856{color}];
    System.out.println("read msg="+message.readBytes(bytes));{color}
    {color:#0000ff}PdfReader pdfreader = new PdfReader("D:\\Managing_Workflows_No_Comment.pdf");
    PdfStamper stamp = new PdfStamper(pdfreader, new FileOutputStream("D:\\12345.pdf"));
    FdfReader fdfreader = new FdfReader(bytes);
    stamp.addComments(fdfreader);
    {color} {color:#0000ff} stamp.close();
    {color}{color:#000000}The above code is working fine except with the hardcoded of {color:#ff0000}byte array{color}{color:#ff0000} size value{color} which is given in {color:#ff0000}RED{color} in color.
    Can anybody know, {color:#000000}*how to get the byte[] size dynamically from the StreamMessage*{color} object ?
    Any help would be highly beneficial for me !!!!
    Thanks and Regards,
    Ganesh Kumar{color}

    When you create your stream message you could add an property to your message, something like streamSize that would contain the number of bytes in your stream message. Then you could get this property from the message before declaring your array.
    Tom

  • How to get the backup of photos from  i cloud id ?

    plz provide me the answers as soon as possible.

    BALAJI_PRASANNA wrote:
    Hello,
    I am very new to Labview. Í have an image of an LED and wanted to find the luminance value. I got the luminance image from the IMAQ ExtractSingleColorPlane but the value is not displaying. I just wanted to know how to get the value of luminance from the IMAQ ExtractSingleColorPlane. I have attached what i have done below.
    Thanks in advance.
    Before learning about LabVIEW, learn about images.  An Image (in LabVIEW) is a "representation of an image", that is, the wire itself doesn't really have a "value", but "points to" a collection of data that can be "imaged" (i.e. looked at as through it were a picture), "manipulated" (for example, extracting a color plane, basically getting the "red channel", an image looking as through it were viewed through a red filter), and possibly returning arrays of numbers representing the intensity of the light at a certain position in the picture.  
    BS

  • Anyone knows how to get the photos after IMG_9999 from iphone? :-(ps:... i got them all in my camera roll but when i connected to the computer there's nothing after IMG_9999..

    anyone knows how to get the photos after IMG_9999 from iphone? :-(ps:... i got them all in my camera roll but when i connected to the computer there's nothing after IMG_9999.. many thanks :-)

    They show in the camera roll, just not your computer?
    Have you checked every folder that is in the DCIM folder?

  • VISA: How to get the CSV file through C/C++ code?

    How to get the CSV file through C/C++ code?
    I'm communicating with a USB oscilloscope using VISA.

    Thank you for your reply.
    I am using Apache Commons File Upload. Here is the code where I got the "fi".
         DiskFileUpload fu = new DiskFileUpload();
              fu.setSizeMax(1000000000);
              List fileItems = fu.parseRequest(request);
             Iterator itr = fileItems.iterator();
              FileItem fi = (FileItem)itr.next();
              if(!fi.isFormField())
                File tempFileRef  = new File(fi.getName());
         System.out.println("Field = "+tempFileRef.getAbsolutePath());
         }

  • How to Get the excel sheet formula from the server side into the j2me app?

    How to Get the excel sheet formula from the server side into the j2me application?
    Here the excel sheet is in server side.i want to do get the excel sheet values (only some part of the excel sheet based on some conditions) from server side into j2me.In j2me I want to done some client side validation based on the formula of excel sheet.Then i resend the new updated data to the server.
    But here deosn't know any mehtod to get the excel sheet formula from server side.So kindly help me to get the excel sheet formula from the server.
    So how to get the excel sheet formula frome the server side into j2me Application...
    Plz guide me to solve this issue...
    thanks & regards, Sivakumar.J

    You should not post a thread more than once. You've crossposted this question to another forum. I have deleted that one.

  • How to get the Output File Name as One of the Field Value From Payload

    Hi All,
    I want to get the Output file name as one of the Field value from payload.
    Example:
    Source XML
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_TEST xmlns:ns0="http://sample.com">
    - <Header>
      <NAME>Bopanna</NAME>
      </Header>
      </ns0:MT_TEST>
    I want to get the Output file name as " Bopanna.xml"
    Please suggest me on this.
    Regards
    Bopanna

    Hi,
    There are couple of links already available for this. Just for info see the below details,
    The Output file name could be used from the field value of payload. For this you need to use the UDF DynamicFile name with below code,
    //       Description: Function to create dynamic Filename
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
    conf.put(key,a);
    return "";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
    conf.put(key,a);
    return "";
    With this udf map it with the MessageType as
    (File Name field from Payload) > DynamicFileConfiguration>MTReceiver
    Thanks
    Swarup

  • How to get the right file name in an attachment

    I have design a program to get the attach file from an attachment. But when I click the link to save the file, the default name of the file is 'attach' whenever I get different files. Who know what is the problem, please tell me the truth.
    Here are some codes of the program.
    download.jsp
    <%="test.doc"%>
    web.xml
    <servlet-mapping>
    <servlet-name>AttachmentServlet</servlet-name>
    <url-pattern>attachment</url-pattern>
    </servlet-mapping>
    AttachmentServlet.java
    public void doGet
    Message msg = folder.getMessage(msgNum);
    // the message I get is right and the name of the file in
    // the attach in this message is right too.(I have printed)
    Multipart multipart = (Multipart)msg.getContent();
    Part part = multipart.getBodyPart(partNum);
    ContentType ct = new ContentType(sct);
    response.setContentType(ct.getBaseType());
    InputStream is = part.getInputStream();
    int i;
    while ((i = is.read()) != -1) {
    out.write(i);
    out.flush();
    out.close();

    The trick that I used is to append the URL with the name of the file. So if your url is "http://domain.com/attach", use "http://domain.com/attach/filename.doc". IE and Netscape parse the URL to determine what the filename is, so by placing this text at the end, you essentially let the browsers know what the filename is. :)
    I have design a program to get the attach file from an
    attachment. But when I click the link to save the
    file, the default name of the file is 'attach'
    whenever I get different files. Who know what is the
    problem, please tell me the truth.
    Here are some codes of the program.<< snip >>

  • How to get the EXCEL file from web site (b2b) into SAP system?

    Hi Guys,
    I have a requirement of saving the excel file that has been send to SAP system from a B2B site.
    Currently there is a call to the SAP system from the B2B site via an RFC function ,this RFC functions gets the excel file as an input to the SAP system,i need to store this Excel file in the SAP  (as an excel file itself).
    How can i acheive this?
    Please suggest.
    Thanks ,
    Swati

    You can extract a date portion and  assign to the variable and then compare with GETDATE()
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to get the upload file from a html form ?

    I have a <input type=file ...> control in my form, and the user use that
              control to submit a file
              to my web server. The porblem is the getParameter() function of
              HttpServletRequest only return the
              filename. Does anyone know how to get the file body ?
              Frances
              

    http://www.servlets.com/jsp/examples/ch04/index.html#ex04_17
              Frances Fan <[email protected]> wrote:
              > I have a <input type=file ...> control in my form, and the user use that
              > control to submit a file
              > to my web server. The porblem is the getParameter() function of
              > HttpServletRequest only return the
              > filename. Does anyone know how to get the file body ?
              > Frances
              Dimitri
              

  • How to get the XML file if we are using the Product short name.

    Hi,
    Till now I have used Short name of the Concurrent Program for Code while creating a Data Definition. Now saw a seeded template which has given the Code by Product short name. If we have the concurrent program then it is easy to refer the fields by checking the XML file. In this case how to find the XML file or how to refer all the fields if we have given code with Product short name. I saw this for iReceivables(ARI). Anybody please help me.
    Thanks.

    Hi Siva
    Just to clarify, rather than the short name of the conc program there is a shipped data definition that just uses the product short name? What is the data def so I can check it.
    Regards, Tim

  • How to get the SQL file name in SQL*plus

    hi all,
         I have created two sql file at C drive as "c:\Createtable.sql" and "c:\Deletetable.sql"
    afterwards i open
    C:\>sqlplus
    SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jan 30 11:37:10 2008
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Enter user-name: scott/tiger
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> @C:\Createtable.sql'
    Table created.
    SQL> @'C:\Deletetable.sql'
    Table dropped.
    SQL>My problem is to get the name of the file as "c:\createtable.sql" and "C:\Deletetable.sql" in sql*plus enviornment.
    Thanks & Regards
    Singh

    Dear Damorgan,
         >>your version number to three decimal places
         My Oracle DB Version i have already stated in my previous post is 10.2.0.1.0
    Actually my problem is to get the sql files name we run in sqlplus enviornment with @ symbol. like
    i have created one sql file in c drive as
    "C:\Createtable.sql"
    afterwords i have connected to sqlplus as
    sql> conn scott/tiger
    sql>@c:\createtable.sql
    Now i want some query to get the name of the file which is run.
    In actual my problem is as
    i have suppose 10 or more SQL files in some folder ( sql1.sql, sql2.sql, sql3.sql ....).
    i created one file to call all the 10 sql files (main.sql)
    i have also one track_table which will keep track that which sql file is runned.
    I want some automated script which will insert the record in that track_table....... for that i need the name of sql file which is runned.
    Hope this will help you.
    Thanks & Regards
    Singh

Maybe you are looking for

  • Update cell Sprite in DataGrid

    Hi, I have a datagrid with a LOT of sprites (1700 circles, squares, and triangles) that I created in an itemRenderer in Actionscript using Peter Ent's excellent tutorial on custom item renderers. http://www.adobe.com/devnet/flex/articles/itemrenderer

  • JSP and servlets

    Am I correct in assuming that JSP is an extention of servlets and that to learn JSP in effect means learning about servlets? My point is, is JSP the superior technology a bit like learning JDK1.4 is now a pointless excercise as it has been superceded

  • Image not part of popup link

    I have an old WinHelp project that I am converting to HTML Help. The project opened up in RH6 HTML quite nicely, but the output generated from the new project has some issues. I have a few pages with small image 'buttons' to the left of a string. The

  • Function ToDate uses an invalid format 'yyyyMMdd' for parameter format. Try rewriting the formula.

    How can I convert a date format such as "20140730" using TO_DATE()?? I have tried to create a calculated dimension with ToDate function but it seems Lumira didn't support with that specific format. Thanks, Raymond

  • Query for duplicate data

    Hi guy, Plz Help me out for this query. i have tabe tb_adhc_hrrs which hireid,hiere_name,email, pagerno filed i want to all the dulicate value of pager no for example select pagerno,count(hirerid) from tb_adhoc_hrrs group by pagerno having count(*)>1