Results 1 to 3 of 3
Thread: problem in file path
- 01-15-2010, 11:40 AM #1
Member
- Join Date
- Jan 2010
- Posts
- 61
- Rep Power
- 0
- 01-15-2010, 11:57 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,370
- Blog Entries
- 1
- Rep Power
- 25
Get the file, rename it and save with the new name. I don't know what's the use of dot, it could be real mess-up naming conversion.
- 01-15-2010, 12:26 PM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 28
A bit of File and String fiddling will do the job:
Java Code:File file= new File(<your file name here>); StringBuilder sb= new StringBuilder(file.getAbsoluteFile().toString()); int i= sb.lastIndexOf(file.getName()); sb.insert(i, '.'); System.out.println(sb.toString());
Jos
Similar Threads
-
file path
By ras_pari in forum Advanced JavaReplies: 2Last Post: 10-12-2009, 12:25 PM -
reading file from a path
By new_coder in forum New To JavaReplies: 5Last Post: 08-17-2009, 05:52 AM -
Weird path problem when reading properties file
By jerry_popperq in forum New To JavaReplies: 0Last Post: 03-18-2009, 04:32 PM -
How to set Image file path
By anil.bharadia in forum AWT / SwingReplies: 1Last Post: 01-28-2009, 10:10 PM -
file path
By Arsench in forum New To JavaReplies: 7Last Post: 10-30-2008, 06:39 AM
Bookmarks