diff --git a/core/src/main/java/google/registry/reporting/icann/IcannReportingStager.java b/core/src/main/java/google/registry/reporting/icann/IcannReportingStager.java index 557d9b616..887687a93 100644 --- a/core/src/main/java/google/registry/reporting/icann/IcannReportingStager.java +++ b/core/src/main/java/google/registry/reporting/icann/IcannReportingStager.java @@ -259,8 +259,8 @@ public class IcannReportingStager { tld, Ascii.toLowerCase(reportType.toString()), DateTimeFormat.forPattern("yyyyMM").print(yearMonth)); - String reportBucketname = String.format("%s/%s", reportingBucket, subdir); - final BlobId gcsFilename = BlobId.of(reportBucketname, reportFilename); + final BlobId gcsFilename = + BlobId.of(reportingBucket, String.format("%s/%s", subdir, reportFilename)); gcsUtils.createFromBytes(gcsFilename, reportBytes); logger.atInfo().log("Wrote %d bytes to file location %s", reportBytes.length, gcsFilename); return reportFilename; @@ -268,8 +268,8 @@ public class IcannReportingStager { /** Creates and stores a manifest file on GCS, indicating which reports were generated. */ void createAndUploadManifest(String subdir, ImmutableList filenames) throws IOException { - String reportBucketname = String.format("%s/%s", reportingBucket, subdir); - final BlobId gcsFilename = BlobId.of(reportBucketname, MANIFEST_FILE_NAME); + final BlobId gcsFilename = + BlobId.of(reportingBucket, String.format("%s/%s", subdir, MANIFEST_FILE_NAME)); StringBuilder manifestString = new StringBuilder(); filenames.forEach((filename) -> manifestString.append(filename).append("\n")); gcsUtils.createFromBytes(gcsFilename, manifestString.toString().getBytes(UTF_8)); diff --git a/core/src/main/java/google/registry/reporting/icann/IcannReportingUploadAction.java b/core/src/main/java/google/registry/reporting/icann/IcannReportingUploadAction.java index a6b1c2dc7..353c0e368 100644 --- a/core/src/main/java/google/registry/reporting/icann/IcannReportingUploadAction.java +++ b/core/src/main/java/google/registry/reporting/icann/IcannReportingUploadAction.java @@ -145,10 +145,10 @@ public final class IcannReportingUploadAction implements Runnable { String.format( "icann/monthly/%d-%02d", cursorTimeMinusMonth.getYear(), cursorTimeMinusMonth.getMonthOfYear()); - String reportBucketname = String.format("%s/%s", reportingBucket, reportSubdir); String filename = getFileName(cursorType, cursorTime, tldStr); - final BlobId gcsFilename = BlobId.of(reportBucketname, filename); - logger.atInfo().log("Reading ICANN report %s from bucket %s", filename, reportBucketname); + final BlobId gcsFilename = + BlobId.of(reportingBucket, String.format("%s/%s", reportSubdir, filename)); + logger.atInfo().log("Reading ICANN report %s from bucket %s", filename, reportingBucket); // Check that the report exists try { verifyFileExists(gcsFilename);