dsmiley commented on code in PR #4672:
URL: https://github.com/apache/solr/pull/4672#discussion_r3669305621
##########
solr/core/src/java/org/apache/solr/core/ConfigSetService.java:
##########
Review Comment:
I was hoping you'd put this in SolrJ somewhere. It would be useful for
clients who want to submit zips! I can say it'd help me where I work, allowing
us to remove some similar code.
##########
solr/core/src/java/org/apache/solr/core/ConfigSetService.java:
##########
@@ -75,6 +81,65 @@ public static boolean isFileForbiddenInConfigSets(String
filePath) {
return lastDot >= 0 &&
USE_FORBIDDEN_FILE_TYPES.contains(filePath.substring(lastDot + 1));
}
+ /**
+ * Zips the contents of {@code rootPath} into an in-memory archive. Hidden
files and directories
+ * (as determined by {@link Files#isHidden}) are skipped, directory entries
are written for
+ * non-empty subdirectories, and zip entry names are normalized to use
{@code /} separators
+ * regardless of platform.
+ *
+ * @param rootPath the directory to zip
+ * @param validateFileTypes if true, a file with a forbidden extension (see
{@link
+ * #isFileForbiddenInConfigSets}) causes an {@link IOException} instead
of being silently
Review Comment:
an IOException doesn't seem appropriate for such a problem
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]