Here you can find the source of createTempFile(String name)
public static Path createTempFile(String name) throws IOException
//package com.java2s; /******************************************************************************* * Copyright (c) 2014, 2015 IBH SYSTEMS GmbH. * 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. ja v a2 s. c om * IBH SYSTEMS GmbH - initial API and implementation *******************************************************************************/ import java.io.IOException; import java.net.URLEncoder; import java.nio.file.Files; import java.nio.file.Path; public class Main { public static Path createTempFile(String name) throws IOException { if (name != null) { name = URLEncoder.encode(name, "UTF-8"); } return Files.createTempFile("blob-", "-" + name); } }