Package com.android.builder.merge
Class LazyIncrementalFileMergerInput
java.lang.Object
com.android.builder.merge.LazyIncrementalFileMergerInput
- All Implemented Interfaces:
IncrementalFileMergerInput,OpenableCloseable,Closeable,AutoCloseable
Implementation of an
IncrementalFileMergerInput that lazily loads required data.
In general, this is constructed not directly using the constructor (which absolutely can be
used), but using the factory methods in LazyIncrementalFileMergerInputs.
-
Constructor Summary
ConstructorsConstructorDescriptionLazyIncrementalFileMergerInput(String name, com.android.tools.build.apkzlib.utils.CachedSupplier<Map<RelativeFile, com.android.ide.common.resources.FileStatus>> updates, com.android.tools.build.apkzlib.utils.CachedSupplier<Set<RelativeFile>> files) Creates a new input. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()com.google.common.collect.ImmutableSet<String>Obtains all OS-independent paths of all files that in this input, regardless of being changed or not.com.android.ide.common.resources.FileStatusgetFileStatus(String path) Obtains the status of a path in this input.getName()Obtains the name of this input.com.google.common.collect.ImmutableSet<String>Obtains all OS-independent paths of all files that were changed in this input.voidopen()Opens the object.Opens a path for reading.
-
Constructor Details
-
LazyIncrementalFileMergerInput
public LazyIncrementalFileMergerInput(@NonNull String name, @NonNull com.android.tools.build.apkzlib.utils.CachedSupplier<Map<RelativeFile, com.android.ide.common.resources.FileStatus>> updates, @NonNull com.android.tools.build.apkzlib.utils.CachedSupplier<Set<RelativeFile>> files) Creates a new input.- Parameters:
name- the input nameupdates- the file and how they were updatedfiles- all files
-
-
Method Details
-
getUpdatedPaths
Description copied from interface:IncrementalFileMergerInputObtains all OS-independent paths of all files that were changed in this input.- Specified by:
getUpdatedPathsin interfaceIncrementalFileMergerInput- Returns:
- the paths, may be empty if no paths were changed
-
getAllPaths
Description copied from interface:IncrementalFileMergerInputObtains all OS-independent paths of all files that in this input, regardless of being changed or not.- Specified by:
getAllPathsin interfaceIncrementalFileMergerInput- Returns:
- the paths, may be empty if the relative tree of this input is empty
-
getName
Description copied from interface:IncrementalFileMergerInputObtains the name of this input.- Specified by:
getNamein interfaceIncrementalFileMergerInput- Returns:
- the name
-
getFileStatus
Description copied from interface:IncrementalFileMergerInputObtains the status of a path in this input.- Specified by:
getFileStatusin interfaceIncrementalFileMergerInput- Parameters:
path- the OS-independent path; the path may or not exist in the input- Returns:
- the status of the path or
nullif the path does not exist in the input or if the path has not been changed;nullis returned if and only if!getUpdatedPaths().contains(path)
-
openPath
Description copied from interface:IncrementalFileMergerInputOpens a path for reading. This method should only be called when the input is open.- Specified by:
openPathin interfaceIncrementalFileMergerInput- Parameters:
path- the path- Returns:
- the input stream that should be closed by the caller before
Closeable.close()is called
-
open
public void open()Description copied from interface:OpenableCloseableOpens the object.- Specified by:
openin interfaceOpenableCloseable
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-