@@ -0,0 +1,1490 @@
+/*%0A * Copyright 2012-present Facebook, Inc.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22); you may%0A * not use this file except in compliance with the License. You may obtain%0A * a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the%0A * License for the specific language governing permissions and limitations%0A * under the License.%0A */%0A%0Apackage com.facebook.buck.util;%0A%0Aimport com.google.common.base.Supplier;%0A%0Aimport java.io.Closeable;%0Aimport java.io.IOException;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.Path;%0Aimport java.nio.file.attribute.FileAttribute;%0A%0Apublic class NamedTemporaryFile implements Closeable, Supplier%3CPath%3E %7B%0A  private final Path tempPath;%0A%0A  public NamedTemporaryFile(%0A      Path dir,%0A      String prefix,%0A      String suffix,%0A      FileAttribute%3C?%3E... attrs) throws IOException %7B%0A    tempPath = Files.createTempFile(dir, prefix, suffix, attrs);%0A  %7D%0A%0A  public NamedTemporaryFile(%0A      String prefix,%0A      String suffix,%0A      FileAttribute%3C?%3E... attrs) throws IOException %7B%0A    tempPath = Files.createTempFile(prefix, suffix, attrs);%0A  %7D%0A%0A  @Override%0A  public Path get() %7B%0A    return tempPath;%0A  %7D%0A%0A  @Override%0A  public void close() throws IOException %7B%0A    Files.delete(tempPath);%0A  %7D%0A%7D%0A

Introduce NamedTemporaryFile