/** * Reads files and builds an incremental relative file set. Each individual file in * {@code files} may be a file or directory. If it is a directory, then all files in the * directory are added as if {@link #fromDirectory(File)} had been invoked; if it is a file, * then it is assumed to be a zip file and all files in the zip are added as if * {@link #fromZip(File)} had been invoked. * * <p>The status of each file is set to {@link FileStatus#NEW}. This method is used to construct * an initial set of files and is, therefore, an incremental update from zero. * * @param files the files and directories * @return the file set * @throws IOException failed to read the files */ @NonNull public static ImmutableMap<RelativeFile, FileStatus> fromZipsAndDirectories( @NonNull Iterable<File> files) throws IOException { Set<ImmutableMap<RelativeFile, FileStatus>> sets = Sets.newHashSet(); for (File f : files) { if (f.isFile()) { sets.add(fromZip(f)); } else { sets.add(fromDirectory(f)); } } return union(sets); }
javaResourceFile.isFile() ? IncrementalRelativeFileSets.fromZip(javaResourceFile) : IncrementalRelativeFileSets.fromDirectory(javaResourceFile)); } catch (Zip64NotSupportedException e) { updatedJavaResourcesBuilder.putAll( } else { updatedAtomMetadata = IncrementalRelativeFileSets.fromDirectory(getAtomMetadataFolder());
} else { allAtomMetadataFiles = IncrementalRelativeFileSets.fromDirectory(getAtomMetadataFolder());