Android File Temp Create createTempFile(String filePrefix, String fileSuffix)

Here you can find the source of createTempFile(String filePrefix, String fileSuffix)

Description

This wraps the standard create temp file and forces everything into the same baseDir.

License

Apache License

Parameter

Parameter Description
filePrefix a parameter
fileSuffix a parameter

Exception

Parameter Description
IOException an exception

Declaration

public static File createTempFile(String filePrefix, String fileSuffix)
        throws IOException 

Method Source Code

//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);
    }
}

Related

  1. aTempFile()
  2. createTemp(File file)
  3. createTemp(String path)
  4. createTempFile()
  5. createTempFile(File baseDir, String fileName)
  6. createTempFile(String pFilename)
  7. getTempFile()
  8. getTempFile(String dir, String fileExt)
  9. getTempFile(String prefix, String suffix)