Here you can find the source of getTempFile(File parent, String fileName)
Parameter | Description |
---|---|
parent | a parameter |
fileName | a parameter |
public static File getTempFile(File parent, String fileName)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { /**/*w w w. ja va2 s.c o m*/ * Getting a temp file object in the directory in temporal directory which is * referrenced by {@code System.getProperty("java.io.tmpdir")}. * @param parent * @param fileName * * @return */ public static File getTempFile(File parent, String fileName) { return new File(new File(getTempDirectory(), parent.getPath()), fileName); } /** * Getting a temp file object in the temporal directory which is referrenced by * {@code System.getProperty("java.io.tmpdir")}. * * @param fileName * @return */ public static File getTempFile(String fileName) { return new File(getTempDirectory(), fileName); } /** * Getting a temp file object of the temporal directory which is referrenced by * {@code System.getProperty("java.io.tmpdir")}. * * @return */ public static File getTempDirectory() { return new File(getTempDirectoryPathString()); } /** * Getting a string object of the temporal directory which is referrenced by * {@code System.getProperty("java.io.tmpdir")}. * * @return */ public static String getTempDirectoryPathString() { return System.getProperty("java.io.tmpdir"); } }