Java Temp Directory Get getTempDirectory()

Here you can find the source of getTempDirectory()

Description

Getting path to tempo dir on server

License

Open Source License

Return

String

Declaration

public static String getTempDirectory() 

Method Source Code

//package com.java2s;
/**/*from  ww  w  .  ja v  a2 s. com*/
 * Copyright (C) 2015  University of Pittsburgh
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
    
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 * 
 * 
 * Utility class for getting access to *.conf files and to temporary saved
 * requested metadata files on server
 * 
 * @author opm1
 * @version 1
 * @since Dec 8, 2015
 * 
 */

import java.io.File;

public class Main {
    /**
     * Getting path to tempo dir on server
     * 
     * @return String
     */
    public static String getTempDirectory() {
        if (getHomeDirectory() == null)
            return System.getProperty("user.dir" + File.separator);
        else
            return (getHomeDirectory() + File.separator + "temp" + File.separator);
    }

    /**
     * 
     * @return CATALINA_HOME directory
     */
    public static String getHomeDirectory() {
        if (System.getProperty("catalina.home") == null)
            return (System.getenv("CATALINA_HOME"));
        else
            return (System.getProperty("catalina.home"));

    }
}

Related

  1. getTempDirectory()
  2. getTempDirectory()
  3. getTempDirectory()
  4. getTempDirectory()
  5. getTempDirectory()
  6. getTempDirectory()
  7. getTempDirectory()
  8. getTempDirectory()
  9. getTempDirectory()