195395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler// Copyright 2017 The Bazel Authors. All rights reserved. 295395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler// 395395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler// Licensed under the Apache License, Version 2.0 (the "License"); 495395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler// you may not use this file except in compliance with the License. 595395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler// You may obtain a copy of the License at 695395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler// 795395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler// http://www.apache.org/licenses/LICENSE-2.0 895395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler// 995395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler// Unless required by applicable law or agreed to in writing, software 1095395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler// distributed under the License is distributed on an "AS IS" BASIS, 1195395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1295395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler// See the License for the specific language governing permissions and 1395395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler// limitations under the License. 1495395ef8bc57dab3c5b356b5fd91c3d175c33d0fGooglerpackage com.google.devtools.build.android.desugar; 1595395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler 1695395ef8bc57dab3c5b356b5fd91c3d175c33d0fGooglerimport java.io.IOException; 1795395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler 1895395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler/** Output file provider allows to write files in directory or jar files. */ 1995395ef8bc57dab3c5b356b5fd91c3d175c33d0fGooglerinterface OutputFileProvider extends AutoCloseable { 2095395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler 2159adc3acdd6a3dd50fa2ffae0cba2370209c86d6kmb /** Filename to use to write out dependency metadata for later consistency checking. */ 2259adc3acdd6a3dd50fa2ffae0cba2370209c86d6kmb public static final String DESUGAR_DEPS_FILENAME = "META-INF/desugar_deps"; 2359adc3acdd6a3dd50fa2ffae0cba2370209c86d6kmb 2495395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler /** 2595395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler * Copy {@code filename} from {@code inputFileProvider} to this output. If input file provider is 2695395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler * a {@link ZipInputFileProvider} then the metadata of the zip entry are kept. 2795395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler */ 2895395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler void copyFrom(String filename, InputFileProvider inputFileProvider) throws IOException; 2995395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler 3095395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler /** Write {@code content} in {@code filename} to this output */ 3195395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler void write(String filename, byte[] content) throws IOException; 3295395ef8bc57dab3c5b356b5fd91c3d175c33d0fGoogler} 33