Creates a temporary file.

@return absolute path of the temporary file.
@throws IOException
778080
private String createTempFile(final boolean verbose) throws IOException {
        final File tempFile = File.createTempFile("tempMetadata", ".xml");

        if (!verbose) {
            tempFile.deleteOnExit();
        }

        return tempFile.getAbsolutePath();
    }
194091
protected String createFile() throws IOException {
        generateNewBasename();
        String name = currentBasename + '.' + this.extension  +
            ((settings.getCompress())? DOT_COMPRESSED_FILE_EXTENSION: "") +
            OCCUPIED_SUFFIX;
        File dir = getNextDirectory(settings.calcOutputDirs());
        return createFile(new File(dir, name));
    }
828644
public WritableByteChannel create(URI path) throws IOException {
    logger.atFine().log("create(%s)", path);
    return create(path, CreateFileOptions.DEFAULT);
  }
617557
private static File createTempFile(Context ctx, String fileName) throws IOException {
        File storageDir = new File(ctx.getFilesDir(), "temp");
        storageDir.mkdir();
        return nonDuplicateFile(storageDir, fileName);
    }
245205
public File output() throws IOException {
        File o = new File(output);
        if (!o.exists() && !o.mkdirs()) {
            throw new IOException("Unable to create output folder '" + output + "'");
        }
        return o;
    }
1073757
public static synchronized File createSwapFile() throws IOException {
		File swapFile = createSwapFile(SWAP_FILE_PREFIX, SWAP_FILE_SUFFIX);
		// works reliably only on Unix platforms!
		swapFile.deleteOnExit();
		return swapFile;
	}
74734
public static File createTempDirectory(String _path, String _name, boolean _deleteOnExit) {

        File outputDir = new File(concatFilePath(_path, _name));
        if (!outputDir.exists()) {
            try {
                Files.createDirectory(Paths.get(outputDir.toString()));
            } catch (IOException _ex) {
                LOGGER.error("Error while creating temp directory: ", _ex);
            }
        } else {
            return null;
        }
        if (_deleteOnExit) {
            outputDir.deleteOnExit();
        }
        return outputDir;
    }
563089
public static File copy(InputStream stream) throws IOException
  {
    File file = createTempFile();
    copy(stream, new FileOutputStream(file));
    return file;
  }
709628
public static String getTempDir() {
        // default is user home directory
        String tempDir = System.getProperty("user.home");
        try{
            //create a temp file
            File temp = File.createTempFile("A0393939", ".tmp");
            //Get tempropary file path
            String absolutePath = temp.getAbsolutePath();
            tempDir = absolutePath.substring(0,absolutePath.lastIndexOf(File.separator));
        }catch(IOException e){}
        return tempDir;
    }
54450
private String getTempFilePath(File eFile) {
        String pathStr = this.tempPath + File.separator + eFile.getName() + ".tmp";

        for (int i = 1; i < 5; ++i) {
            File f = new File(pathStr);

            if (!f.exists()) {
                break;
            }

            pathStr = this.tempPath + File.separator + eFile.getName() + "-" + i + ".tmp";
        }

        return pathStr;
    }
1308443
private Path getTempDir() {
    if (this.tempDir == null) {
      if (this.dir != null) {
        this.tempDir = dir;
      } else {
        this.tempDir = getProject().getBaseDir().toPath();
      }
    }
    return tempDir;
  }
984518
public static File createTempFile(Context c, File root, String filename, String extension){
        File output = null;
        try {
            if(filename != null){
                if(!extension.contains("."))
                    extension = "." + extension;
                output = new File(root, filename + extension);
                output.createNewFile();
                //output = File.createTempFile(filename, extension, root);
                Log.i(TAG, "Created temp file: " + output.getAbsolutePath());
            }
            return output;
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }
1011139
public static RandomAccessFile createTemporaryFile
        (String prefix, String suffix, File directory) throws IOException {

        File file = File.createTempFile(prefix, suffix, directory);
        file.deleteOnExit();
        return new TemporaryFile(file);
    }
221902
public static File getTempDir() {
        final String str = System.getProperty(TEMP_DIR_KEY);
        if (str == null) {
            throw new IllegalStateException("System property '" + TEMP_DIR_KEY + "' not found!");
        }
        final String tempDirStr = str.trim();
        if (tempDirStr.length() == 0) {
            throw new IllegalStateException("System property '" + TEMP_DIR_KEY + "' is empty!");
        }
        final File dir = new File(tempDirStr);
        try {
            checkValidDir(dir);
        } catch (final IllegalArgumentException ex) {
            throw new IllegalStateException("System property '" + TEMP_DIR_KEY + "' is not valid! [" + ex.getMessage() + "]");
        }
        return dir;
    }
130784
private File createTmpFile(final String path) throws IOException {
        getLog().debug("Creating temporary file for: " + path);
        final File output = new File(System.getProperty("java.io.tmpdir"), "ansible-maven-plugin." + System.nanoTime());
        final FileOutputStream outputStream = new FileOutputStream(output);
        final InputStream inputStream = getClass().getResourceAsStream("/" + path);
        if (inputStream == null){
            throw new FileNotFoundException("Unable to locate: " + path);
        }
        copy(inputStream, outputStream);
        return output;
    }
655060
private FileWriter createTempFile(File tempfile) throws IOException,
            JournalException {
        boolean created = tempfile.createNewFile();
        if (!created) {
            throw new JournalException("Unable to create file '"
                    + tempfile.getPath() + "'.");
        }
        return new FileWriter(tempfile);
    }
544471
public static RandomAccessFile createTemporaryFile
        (String prefix, String suffix) throws IOException {

        return createTemporaryFile(prefix, suffix, null);
    }