mirror of
https://github.com/google/nomulus
synced 2026-02-12 07:41:34 +00:00
Read from bloom filter for premium pricing checks
This also cleans up the PremiumList API so that it only has one method for checking premium prices, which is by TLD, rather than two. I will be refactoring a lot of the static methods currently residing in the PremiumList class into a separate utils class, but I don't want to include too many changes in this one CL. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=148475345
This commit is contained in:
@@ -75,11 +75,8 @@ abstract class CreateOrUpdatePremiumListCommand extends ConfirmingCommand
|
||||
protected void init() throws Exception {
|
||||
name = isNullOrEmpty(name) ? convertFilePathToName(inputFile) : name;
|
||||
List<String> lines = Files.readAllLines(inputFile, UTF_8);
|
||||
// Try constructing the premium list locally to check up front for validation errors.
|
||||
new PremiumList.Builder()
|
||||
.setName(name)
|
||||
.setPremiumListMapFromLines(lines)
|
||||
.build();
|
||||
// Try constructing and parsing the premium list locally to check up front for validation errors
|
||||
new PremiumList.Builder().setName(name).build().parse(lines);
|
||||
inputLineCount = lines.size();
|
||||
}
|
||||
|
||||
@@ -108,7 +105,7 @@ abstract class CreateOrUpdatePremiumListCommand extends ConfirmingCommand
|
||||
getCommandPath(),
|
||||
params.build(),
|
||||
MediaType.FORM_DATA,
|
||||
requestBody.getBytes());
|
||||
requestBody.getBytes(UTF_8));
|
||||
|
||||
return extractServerResponse(response);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user