Commit d903ff61 authored by Juan Rada's avatar Juan Rada

code review changes

parent b18c8cf8
Pipeline #75284 passed with stages
in 6 minutes and 8 seconds
......@@ -10,6 +10,9 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
public class File {
private static final String DIRECTORY_TYPE = "directory";
private static final String FILE_TYPE = "file";
@JsonIgnore
private long id;
......@@ -27,7 +30,7 @@ public class File {
@JsonProperty("type")
public String getType() {
return directory ? "directory" : "file";
return directory ? DIRECTORY_TYPE : FILE_TYPE;
}
@JsonProperty("attributes")
......
......@@ -20,13 +20,11 @@ public class DateUtils {
public String getFromEpochSeconds(long seconds) {
OffsetDateTime dateTime = Instant.ofEpochSecond(seconds).atOffset(ZoneOffset.UTC);
return String.format("%d-%02d-%02d", dateTime.getYear(), dateTime.getMonthValue(), dateTime.getDayOfMonth());
}
public String getFromEpochMilliseconds(long milliseconds) {
OffsetDateTime dateTime = Instant.ofEpochMilli(milliseconds).atOffset(ZoneOffset.UTC);
return String.format("%d-%02d-%02d %d:%02d:%02d", dateTime.getYear(), dateTime.getMonthValue(),
dateTime.getDayOfMonth(), dateTime.getHour(), dateTime.getMinute(), dateTime.getSecond());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment