Java Best practices
Monday, 18 April 2011
How to get the parent directory of a file in java?
Use file.getParent() method for this:
File file = new File("C:/File/demo.txt")
;
String strParentDirectory = file.getParent()
;
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment