mirror of
https://github.com/google/nomulus.git
synced 2025-07-01 00:33:34 +02:00
Run automatic Java 8 conversion over codebase
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=171174380
This commit is contained in:
parent
44df5da771
commit
5edb7935ed
190 changed files with 2312 additions and 3096 deletions
|
@ -22,7 +22,6 @@ import static javax.servlet.http.HttpServletResponse.SC_OK;
|
|||
|
||||
import com.google.api.services.bigquery.model.TableFieldSchema;
|
||||
import com.google.appengine.tools.cloudstorage.GcsFilename;
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.base.Throwables;
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
|
@ -130,16 +129,7 @@ public final class IcannReportingStagingAction implements Runnable {
|
|||
}
|
||||
|
||||
private Iterable<String> getHeaders(ImmutableSet<TableFieldSchema> fields) {
|
||||
return Iterables.transform(
|
||||
fields,
|
||||
new Function<TableFieldSchema, String>() {
|
||||
@Override
|
||||
public String apply(TableFieldSchema schema) {
|
||||
// Change from '_' delimiters (Bigquery-compatible) to '-' (ICANN specification)
|
||||
return schema.getName().replace('_', '-');
|
||||
}
|
||||
}
|
||||
);
|
||||
return Iterables.transform(fields, schema -> schema.getName().replace('_', '-'));
|
||||
}
|
||||
|
||||
private void stageActivityReports (
|
||||
|
|
|
@ -32,11 +32,9 @@ import google.registry.request.Response;
|
|||
import google.registry.request.auth.Auth;
|
||||
import google.registry.util.FormattingLogger;
|
||||
import google.registry.util.Retrier;
|
||||
import google.registry.xml.XmlException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.concurrent.Callable;
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
|
@ -82,16 +80,16 @@ public final class IcannReportingUploadAction implements Runnable {
|
|||
gcsFilename.getObjectName(),
|
||||
gcsFilename.getBucketName());
|
||||
|
||||
retrier.callWithRetry(new Callable<Void>() {
|
||||
@Override
|
||||
public Void call() throws IOException, XmlException {
|
||||
final byte[] payload = readReportFromGcs(gcsFilename);
|
||||
icannReporter.send(payload, tld, yearMonth, reportType);
|
||||
response.setContentType(PLAIN_TEXT_UTF_8);
|
||||
response.setPayload(
|
||||
String.format("OK, sending: %s", new String(payload, StandardCharsets.UTF_8)));
|
||||
return null;
|
||||
}}, IOException.class);
|
||||
retrier.callWithRetry(
|
||||
() -> {
|
||||
final byte[] payload = readReportFromGcs(gcsFilename);
|
||||
icannReporter.send(payload, tld, yearMonth, reportType);
|
||||
response.setContentType(PLAIN_TEXT_UTF_8);
|
||||
response.setPayload(
|
||||
String.format("OK, sending: %s", new String(payload, StandardCharsets.UTF_8)));
|
||||
return null;
|
||||
},
|
||||
IOException.class);
|
||||
}
|
||||
|
||||
private byte[] readReportFromGcs(GcsFilename reportFilename) throws IOException {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue