Mega Code Archive

 
Categories / Java / File Input Output
 

Get all path information from java io File

import java.io.File; import java.io.IOException; class PathInfo {   public static void main(String[] args) throws IOException {     File f = new File(args[0]);     System.out.println("Absolute path = " + f.getAbsolutePath());     System.out.println("Canonical path = " + f.getCanonicalPath());     System.out.println("Name = " + f.getName());     System.out.println("Parent = " + f.getParent());     System.out.println("Path = " + f.getPath());     System.out.println("Absolute? = " + f.isAbsolute());   } }