Here you can find the source of createTempFile(String filePrefix, String fileSuffix)
Parameter | Description |
---|---|
filePrefix | a parameter |
fileSuffix | a parameter |
Parameter | Description |
---|---|
IOException | an exception |
public static File createTempFile(String filePrefix, String fileSuffix) throws IOException
//package com.java2s; /**// w w w . j av a2 s .c o m * Licensed to Cloudera, Inc. under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Cloudera, Inc. licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import java.io.File; import java.io.IOException; public class Main { static File baseDir; /** * This wraps the standard create temp file and forces everything into the * same baseDir. This makes clean up after testing really trivial. * * @param filePrefix * @param fileSuffix * @return * @throws IOException */ public static File createTempFile(String filePrefix, String fileSuffix) throws IOException { return File.createTempFile(filePrefix, fileSuffix, baseDir); } }