Java Temp Directory Get getTempDir()

Here you can find the source of getTempDir()

Description

get Temp Dir

License

Open Source License

Declaration

public static IPath getTempDir() 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2004, 2006 IBM Corporation and others.
 * 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:/*w  w  w  . j  a  va 2 s.c  om*/
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

import java.io.IOException;
import org.eclipse.core.runtime.*;

public class Main {
    public static IPath getTempDir() {
        String tempPath = System.getProperty("java.io.tmpdir");
        try {
            tempPath = new java.io.File(tempPath).getCanonicalPath();
        } catch (IOException e) {
            //ignore and use non-canonical path
        }
        return new Path(tempPath);
    }
}

Related

  1. getTempDir()
  2. getTempDir()
  3. getTempDir()
  4. getTempDir()
  5. getTempDir()
  6. getTempDir()
  7. getTempDir(File baseDir)
  8. getTempDir(final String directory, final String prefix, boolean autodelete)
  9. getTempDir(Object fileID, String fileName)