Here you can find the source of getTempFileWithFullPath()
public static List<String> getTempFileWithFullPath() throws IOException
//package com.java2s; /*//from ww w .ja v a2s. c o m * Copyright (c) 2014 Mastek Ltd. All rights reserved. * * This file is part of JBEAM. JBEAM is free software: you can * redistribute it and/or modify it under the terms of the GNU Lesser * General Public License as published by the Free Software Foundation. * * JBEAM 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 Lesser General * Public License for the specific language governing permissions and * limitations. * * You should have received a copy of the GNU Lesser General Public * License along with JBEAM. If not, see <http://www.gnu.org/licenses/>. */ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; public class Main { public static List<String> getTempFileWithFullPath() throws IOException { File file = File.createTempFile("OnlineReport", ".pdf"); List<String> fileDetails = new ArrayList<String>(2); fileDetails.add(file.getParentFile().getAbsolutePath().replace("\\", "/")); fileDetails.add(file.getName()); file.delete(); return fileDetails; } }