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());
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());
Reading a file in a temporary directory is done in exactly the same way as non-temporary files are read.
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.