public static boolean deleteFilesOnly(final Collection<File> files) {
        final Optional<File> notAFile = files.stream().filter(f -> f.exists() && !f.isFile()).findAny();

        if (notAFile.isPresent()) {
            LOGGER.warn(format("Found unexpected directory %s. Will not delete.", notAFile.get().getAbsolutePath()));
            return false;
        }

        return files.stream().map(RemoteLogSegmentFileset::deleteQuietly).reduce(true, Boolean::logicalAnd);
    }
Creates a fileset instance for the physical set of files located under the given topic-partition directory.
The fileset MUST exist on the file system with the given uuid.

@param tpDirectory The topic-partition directory which this fileset's segment belongs to.
@param uuid The expected UUID of the fileset.
@return A new fileset instance.
storage/src/test/java/org/apache/kafka/server/log/remote/storage/RemoteLogSegmentFileset.java