in src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/ContentTypeValidator.java [48:79]
public static AbstractModule module() {
return new AbstractModule() {
@Override
protected void configure() {
DynamicSet.bind(binder(), CommitValidationListener.class).to(ContentTypeValidator.class);
bind(ProjectConfigEntry.class)
.annotatedWith(Exports.named(KEY_BLOCKED_CONTENT_TYPE))
.toInstance(
new ProjectConfigEntry(
"Blocked Content Type",
null,
ProjectConfigEntryType.ARRAY,
null,
false,
"Pushes of commits that contain files with blocked content "
+ "types will be rejected."));
bind(ProjectConfigEntry.class)
.annotatedWith(Exports.named(KEY_BLOCKED_CONTENT_TYPE_ALLOWLIST))
.toInstance(
new ProjectConfigEntry(
"Blocked Content Type Allowlist",
"false",
ProjectConfigEntryType.BOOLEAN,
null,
false,
"If this option is checked, the entered content types are "
+ "interpreted as an allowlist. Otherwise commits that "
+ "contain one of these content types will be rejected."));
}
};
}