Package com.android.builder.merge
Class FilterIncrementalFileMergerInput
java.lang.Object
com.android.builder.merge.DelegateIncrementalFileMergerInput
com.android.builder.merge.FilterIncrementalFileMergerInput
- All Implemented Interfaces:
IncrementalFileMergerInput,OpenableCloseable,Closeable,AutoCloseable
IncrementalFileMergerInput that filters input based on a predicate over the accepted
paths. This input will effectively create a view with a subset of another input.-
Constructor Summary
ConstructorsConstructorDescriptionFilterIncrementalFileMergerInput(IncrementalFileMergerInput input, Predicate<String> pathsAccepted) Creates a new incremental input based on another input filtering all files whose OS-independent path are not accepted by the provided predicate. -
Method Summary
Modifier and TypeMethodDescriptioncom.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.com.google.common.collect.ImmutableSet<String>Obtains all OS-independent paths of all files that were changed in this input.Opens a path for reading.Methods inherited from class com.android.builder.merge.DelegateIncrementalFileMergerInput
close, getName, open
-
Constructor Details
-
FilterIncrementalFileMergerInput
public FilterIncrementalFileMergerInput(@NonNull IncrementalFileMergerInput input, @NonNull Predicate<String> pathsAccepted) Creates a new incremental input based on another input filtering all files whose OS-independent path are not accepted by the provided predicate.- Parameters:
input- the input to filterpathsAccepted- predicate that accepts only paths that should be in the output
-
-
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- Overrides:
getUpdatedPathsin classDelegateIncrementalFileMergerInput- 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- Overrides:
getAllPathsin classDelegateIncrementalFileMergerInput- Returns:
- the paths, may be empty if the relative tree of this input is empty
-
getFileStatus
Description copied from interface:IncrementalFileMergerInputObtains the status of a path in this input.- Specified by:
getFileStatusin interfaceIncrementalFileMergerInput- Overrides:
getFileStatusin classDelegateIncrementalFileMergerInput- 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- Overrides:
openPathin classDelegateIncrementalFileMergerInput- Parameters:
path- the path- Returns:
- the input stream that should be closed by the caller before
Closeable.close()is called
-