summaryrefslogtreecommitdiff
path: root/java/com/google/devtools/build/android/desugar/InputFileProvider.java
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2017-03-22 10:00:51 -0700
committerColin Cross <ccross@android.com>2017-03-22 10:00:51 -0700
commit0b3c15f840b5f81fe86a5fa04e356855d89626c7 (patch)
tree4287a03003b29b55dd87bd3e9d99701fcf99f34f /java/com/google/devtools/build/android/desugar/InputFileProvider.java
parenta81405c6ddb7334c1a0feb0e7e10447279f713e8 (diff)
parent172122c125f4b4b3eb402b0d5606a7862a28fd47 (diff)
downloaddesugar-0b3c15f840b5f81fe86a5fa04e356855d89626c7.tar.gz
Merge remote-tracking branch 'aosp/upstream-master' into master
* aosp/upstream-master: Add expansion functions to options parser Add support to write desugared outputs to a directory RELNOTES: n/a Add name of missing class to ClassNotFoundException Add support to read inputs from directories Create "internal" category of command-line options. Refactor options converter logic Add a flag (--only_desugar_javac9_for_lint) to disable desugaring lambda expressions for Android Lint. Test: m -j ANDROID_COMPILE_WITH_JACK=false checkbuild
Diffstat (limited to 'java/com/google/devtools/build/android/desugar/InputFileProvider.java')
-rw-r--r--java/com/google/devtools/build/android/desugar/InputFileProvider.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/java/com/google/devtools/build/android/desugar/InputFileProvider.java b/java/com/google/devtools/build/android/desugar/InputFileProvider.java
new file mode 100644
index 0000000..c2b6353
--- /dev/null
+++ b/java/com/google/devtools/build/android/desugar/InputFileProvider.java
@@ -0,0 +1,36 @@
+// Copyright 2017 The Bazel Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+package com.google.devtools.build.android.desugar;
+
+import java.io.Closeable;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.zip.ZipEntry;
+
+/** Input file provider allows to iterate on relative path filename of a directory or a jar file. */
+interface InputFileProvider extends Closeable, Iterable<String> {
+
+ /**
+ * Return a ZipEntry for {@code filename}. If the provider is a {@link ZipInputFileProvider}, the
+ * method returns the existing ZipEntry in order to keep its metadata, otherwise a new one is
+ * created.
+ */
+ ZipEntry getZipEntry(String filename);
+
+ /**
+ * This method returns an input stream allowing to read the file {@code filename}, it is the
+ * responsibility of the caller to close this stream.
+ */
+ InputStream getInputStream(String filename) throws IOException;
+}