Code example for File

Methods: createNewFiledeleteexistsgetAbsolutePath

0
	 * @throws Exception 
	 */ 
	private void createOutputFile() throws Exception 
	{ 
		outputFile = new File(System.getProperty("java.io.tmpdir") + File.separator + "r_output_tmp_"
				+ System.nanoTime() + ".txt");
		if (outputFile.exists())
		{ 
			boolean delete = outputFile.delete();
			if (!delete)
			{ 
				throw new Exception("Deletion of tmp file " + outputFile.getAbsolutePath() + " failed");
			} 
		} 
		boolean create = outputFile.createNewFile();
		if (!create)
		{ 
			throw new Exception("Creation of tmp file " + outputFile.getAbsolutePath() + " failed");
		} 
	} 
 
	/** 
	 * Helper function to perform startup depending on the underlying OS. 
Connect your IDE to all the code out there  Get Codota for Java