Java FileWriter Write saveToTempFile(File folder, String content, String fileType)

Here you can find the source of saveToTempFile(File folder, String content, String fileType)

Description

save To Temp File

License

Open Source License

Declaration

public static File saveToTempFile(File folder, String content, String fileType) throws IOException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.BufferedWriter;
import java.io.File;

import java.io.FileWriter;
import java.io.IOException;

import java.util.UUID;

public class Main {
    public static File saveToTempFile(File folder, String content, String fileType) throws IOException {
        String uuid = UUID.randomUUID().toString();
        File f = new File(folder, uuid + "." + fileType);
        BufferedWriter out = new BufferedWriter(new FileWriter(f));
        out.write(content);//from  w  w w. j  a va  2s .c  o  m
        out.close();
        return f;
    }
}

Related

  1. saveToFile(String fileName, String str)
  2. saveToFile(String location, File tempFile)
  3. saveToFile(String path, String line)
  4. saveToFile(String prefix, Reader input)
  5. saveToJson(Object object, String file)
  6. saveTreeStructuredGroupList(ArrayList> treeStructuredGroupList, String filePath)
  7. saveTxt(String line, String filename, boolean isEndSave)
  8. saveTxtFile(String fileName, String content)