src/main/java/org/embulk/input/gcs/GcsFileInputPlugin.java in embulk-input-gcs-0.1.1 vs src/main/java/org/embulk/input/gcs/GcsFileInputPlugin.java in embulk-input-gcs-0.1.2
- old
+ new
@@ -58,12 +58,11 @@
@Config("service_account_email")
public String getServiceAccountEmail();
@Config("application_name")
- // @todo I want to set default applicaiton name like "embulk-input-gcs". But string format cause JsonParseException.
- @ConfigDefault("1000000000")
+ @ConfigDefault("\"Embulk GCS input plugin\"")
public String getApplicationName();
@Config("p12_keyfile_fullpath")
public String getP12KeyfileFullpath();
@@ -140,11 +139,11 @@
)
.setServiceAccountPrivateKeyFromP12File(new File(task.getP12KeyfileFullpath()))
.build();
return cred;
} catch (IOException e) {
- log.warn("Could not load client secrets file " + task.getP12KeyfileFullpath());
+ log.warn(String.format("Could not load client secrets file %s", task.getP12KeyfileFullpath()));
} catch (GeneralSecurityException e) {
log.warn ("Google Authentication was failed");
}
return null;
}
@@ -203,11 +202,11 @@
listObjects.setPageToken(lastKey);
do {
Objects objects = listObjects.execute();
List<StorageObject> items = objects.getItems();
if (items == null) {
- log.info("No file was found in bucket:" + bucket + " prefix:" + prefix);
+ log.info(String.format("No file was found in bucket:%s prefix:%s", bucket, prefix));
break;
}
for (StorageObject o : items) {
if (log.isDebugEnabled()) {
log.debug("filename: " + o.getName());
@@ -219,10 +218,10 @@
}
lastKey = objects.getNextPageToken();
listObjects.setPageToken(lastKey);
} while (lastKey != null);
} catch (Exception e) {
- log.warn("Could not get file list from bucket:" + bucket);
+ log.warn(String.format("Could not get file list from bucket:%s", bucket));
log.warn(e.getMessage());
}
return builder.build();
}