0

i have problem, how to read file in temp and get filename ?

  tempFile = File.createTempFile("MyFile.txt", ".tmp" );
  System.out.print("Created temporary file with name ");
  System.out.println(tempFile.getAbsolutePath());
Isaac
  • 16,458
  • 5
  • 57
  • 81
  • possible duplicate of [Best way to read a text file](http://stackoverflow.com/questions/4716503/best-way-to-read-a-text-file) – Smutje Jun 30 '14 at 06:13

1 Answers1

0
  1. Reading a file in a temporary directory is done in exactly the same way as non-temporary files are read.

  2. getAbsolutePath() returns the absolute path name of the file. If by "file name" you refer to just the "file" portion of the path name, use the getName() method.

Isaac
  • 16,458
  • 5
  • 57
  • 81