Java Temp Folder Create getTempFolder(String TEMP_FOLDER_NAME)

Here you can find the source of getTempFolder(String TEMP_FOLDER_NAME)

Description

get Temp Folder

License

Open Source License

Declaration

public static File getTempFolder(String TEMP_FOLDER_NAME) throws IOException 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2015 Pivotal, Inc.//from   ww  w .  j  ava  2s. c  om
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Pivotal, Inc. - initial API and implementation
 *******************************************************************************/

import java.io.File;
import java.io.IOException;

public class Main {
    public static File getTempFolder(String TEMP_FOLDER_NAME) throws IOException {
        File tempFolder = File.createTempFile(TEMP_FOLDER_NAME, null);
        tempFolder.delete();
        tempFolder.mkdirs();
        if (!tempFolder.exists()) {
            throw new IOException("Failed to create temporary jar file when packaging application for deployment: "
                    + tempFolder.getAbsolutePath());
        }
        return tempFolder;
    }
}

Related

  1. getTempFolder()
  2. getTempFolder()
  3. getTempFolder()
  4. getTempFolder()
  5. GetTempFolder()
  6. getTempFolderPath()
  7. getTempFolderPath()
  8. getTempPath()
  9. getTempPath()