@Test public void testSimpleCopy() throws IOException { mFileFilter = new FileFilter( mPackagedJarExpansionSubStreams, mPackagingOptions); assertFalse(new File(mMergedFolder, "foo/text.properties").exists()); File changedFile = createFile(mExpandedJar1, "foo/text.properties"); mFileFilter.handleChanged(mMergedFolder, changedFile); assertTrue(new File(mMergedFolder, "foo/text.properties").exists()); }
void handleChanged(@NonNull File outputDir, @NonNull File changedFile) throws IOException { String archivePath = getArchivePath(changedFile); PackagingFileAction action = getPackagingAction(archivePath); switch (action) { case EXCLUDE: return; case MERGE: mergeAll(outputDir, archivePath); return; case PICK_FIRST: copy(changedFile, outputDir, archivePath); return; case NONE: copy(changedFile, outputDir, archivePath); } }
FileFilter implements ZipEntryFilter { void handleChanged(@NonNull File outputDir, @NonNull File changedFile) throws IOException { String archivePath = getArchivePath(changedFile); PackagingFileAction action = getPackagingAction(archivePath); switch (action) { case EXCLUDE: return; case MERGE: mergeAll(outputDir, archivePath); return; case PICK_FIRST: copy(changedFile, outputDir, archivePath); return; case NONE: copy(changedFile, outputDir, archivePath); } } }
FileFilter implements ZipEntryFilter { void handleChanged(@NonNull File outputDir, @NonNull File changedFile) throws IOException { String archivePath = getArchivePath(changedFile); PackagingFileAction action = getPackagingAction(archivePath); switch (action) { case EXCLUDE: return; case MERGE: mergeAll(outputDir, archivePath); return; case PICK_FIRST: copy(changedFile, outputDir, archivePath); return; case NONE: copy(changedFile, outputDir, archivePath); } } FileFilter(
            @NonNull List<SubStream> expandedFolders,
            @Nullable PackagingOptions packagingOptions); }
FileFilter implements ZipEntryFilter { void handleChanged(@NonNull File outputDir, @NonNull File changedFile) throws IOException { String archivePath = getArchivePath(changedFile); PackagingFileAction action = getPackagingAction(archivePath); switch (action) { case EXCLUDE: return; case MERGE: mergeAll(outputDir, archivePath); return; case PICK_FIRST: copy(changedFile, outputDir, archivePath); return; case NONE: copy(changedFile, outputDir, archivePath); } } FileFilter(
            @NonNull List<SubStream> expandedFolders,
            @Nullable PackagingOptions packagingOptions); @Override boolean checkEntry(@NonNull String archivePath); void handleRemoved(@NonNull File outputDir, @NonNull String removedFilePath); }
FileFilter implements ZipEntryFilter { void handleChanged(@NonNull File outputDir, @NonNull File changedFile) throws IOException { String archivePath = getArchivePath(changedFile); PackagingFileAction action = getPackagingAction(archivePath); switch (action) { case EXCLUDE: return; case MERGE: mergeAll(outputDir, archivePath); return; case PICK_FIRST: copy(changedFile, outputDir, archivePath); return; case NONE: copy(changedFile, outputDir, archivePath); } } FileFilter(
            @NonNull List<SubStream> expandedFolders,
            @Nullable PackagingOptions packagingOptions); @Override boolean checkEntry(@NonNull String archivePath); void handleRemoved(@NonNull File outputDir, @NonNull String removedFilePath);  }