List of usage examples for java.io File getAbsolutePath
public String getAbsolutePath()
From source file:MainClass.java
public static void main(String[] a) { File myFile = new File("output.txt"); System.out.println(myFile.getAbsolutePath()); }
From source file:Main.java
public static void main(String[] args) { // create new files File f = new File("test.txt"); String path = f.getAbsolutePath(); System.out.print("Absolute Pathname " + path); }
From source file:Main.java
public static void main(String[] args) throws Exception { File f = File.createTempFile("temp_", null); System.out.println(f.getAbsolutePath()); f.deleteOnExit();//from w w w. j a va2s . c o m }
From source file:PathInfo.java
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()); }
From source file:Main.java
public static void main(String[] args) throws Exception { File root = new File("c:\\"); String[] extensions = { "xml", "java", "dat" }; boolean recursive = true; Collection files = FileUtils.listFiles(root, extensions, recursive); for (Iterator iterator = files.iterator(); iterator.hasNext();) { File file = (File) iterator.next(); System.out.println("File = " + file.getAbsolutePath()); }//from w w w.j a va 2s. c o m }
From source file:Main.java
public static void main(String[] args) throws Exception { File f = File.createTempFile("tmp", ".txt"); System.out.println("File path: " + f.getAbsolutePath()); // deletes file when the virtual machine terminate f.deleteOnExit();//from w ww. j a v a 2 s. c o m }
From source file:Main.java
public static void main(String[] args) throws Exception { File f = File.createTempFile("tmp", ".txt"); System.out.println("File path: " + f.getAbsolutePath()); // creates temporary file f = File.createTempFile("tmp", null); System.out.print("File path: " + f.getAbsolutePath()); }
From source file:cz.certicon.routing.web.Application.java
/** * @param args the command line arguments *///from ww w . j a v a 2 s. co m public static void main(String[] args) { String filePath = "C:\\Routing\\Data\\CZ"; if (args.length > 0) { filePath = args[0]; } File file = new File(filePath); Settings.GRAPH_FILE_PATH = file.getAbsolutePath() + File.separator + file.getName() + ".graph.xml"; Settings.COORDINATES_FILE_PATH = file.getAbsolutePath() + File.separator + file.getName() + ".coords.xml"; SpringApplication.run(Application.class, args); }
From source file:Main.java
public static void main(String[] argv) { final JFileChooser chooser = new JFileChooser(); File curDir = chooser.getCurrentDirectory(); chooser.setDialogTitle("" + curDir.getAbsolutePath()); chooser.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if (JFileChooser.DIRECTORY_CHANGED_PROPERTY.equals(evt.getPropertyName())) { File curDir = chooser.getCurrentDirectory(); chooser.setDialogTitle("" + curDir.getAbsolutePath()); }/*from w w w . j a v a 2s. c o m*/ } }); }
From source file:Main.java
public static void main(String[] args) throws Exception { File f = File.createTempFile("tmp", ".txt", new File("C:/")); System.out.println("File path: " + f.getAbsolutePath()); }