mirror of
https://github.com/google/nomulus.git
synced 2025-06-26 22:34:55 +02:00
Export Premium names to Drive
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=212509587
This commit is contained in:
parent
dbb1f1649d
commit
80b0e6297b
10 changed files with 393 additions and 7 deletions
|
@ -1057,6 +1057,13 @@ public final class RegistryConfig {
|
|||
return config.registryPolicy.allocationTokenCustomLogicClass;
|
||||
}
|
||||
|
||||
/** Returns the disclaimer text for the exported premium terms. */
|
||||
@Provides
|
||||
@Config("premiumTermsExportDisclaimer")
|
||||
public static String providePremiumTermsExportDisclaimer(RegistryConfigSettings config) {
|
||||
return formatComments(config.registryPolicy.reservedTermsExportDisclaimer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the header text at the top of the reserved terms exported list.
|
||||
*
|
||||
|
@ -1065,13 +1072,7 @@ public final class RegistryConfig {
|
|||
@Provides
|
||||
@Config("reservedTermsExportDisclaimer")
|
||||
public static String provideReservedTermsExportDisclaimer(RegistryConfigSettings config) {
|
||||
return Splitter.on('\n')
|
||||
.omitEmptyStrings()
|
||||
.trimResults()
|
||||
.splitToList(config.registryPolicy.reservedTermsExportDisclaimer)
|
||||
.stream()
|
||||
.map(s -> "# " + s)
|
||||
.collect(Collectors.joining("\n"));
|
||||
return formatComments(config.registryPolicy.reservedTermsExportDisclaimer);
|
||||
}
|
||||
|
||||
/** Returns the clientId of the registrar used by the {@code CheckApiServlet}. */
|
||||
|
@ -1412,5 +1413,11 @@ public final class RegistryConfig {
|
|||
static final Supplier<RegistryConfigSettings> CONFIG_SETTINGS =
|
||||
memoize(YamlUtils::getConfigSettings);
|
||||
|
||||
private static String formatComments(String text) {
|
||||
return Splitter.on('\n').omitEmptyStrings().trimResults().splitToList(text).stream()
|
||||
.map(s -> "# " + s)
|
||||
.collect(Collectors.joining("\n"));
|
||||
}
|
||||
|
||||
private RegistryConfig() {}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue