• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

JFileChooser

 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Can anyone know how to get the Absolute path of the file
For Eg.
I have file d:\java\test\book.xml
Output is

d:\java\test\book.xml

I have used the getAbsoluteFile() and there are so many API but not gettting the correct result it just show ing the file name , but i want this with its path


Regards
 
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use this

myFile.getCanonicalPath()

the method does throw exceptions. I can't remember which ones offhand, but it's in the API.

Cheers,
Rachel
 
Santosh Maskar
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rachel,

Thanks for the same it thorows the IOException


Regards
 
reply
    Bookmark Topic Watch Topic
  • New Topic