Skip to content

Commit

Permalink
code style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
heuermh committed Jun 17, 2024
1 parent 9afd7cd commit 3bff422
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 29 deletions.
20 changes: 0 additions & 20 deletions src/main/java/com/github/heuermh/cooper/Cooper.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,13 @@
import java.util.Arrays;
import java.util.List;

import java.util.concurrent.Callable;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import picocli.AutoComplete.GenerateCompletion;

import picocli.CommandLine.Command;
import picocli.CommandLine.HelpCommand;
import picocli.CommandLine.ITypeConverter;
import picocli.CommandLine.Parameters;
import picocli.CommandLine.ScopeType;

import software.amazon.awssdk.regions.Region;

import software.amazon.awssdk.services.s3.S3Client;

import software.amazon.awssdk.services.s3.model.ListObjectsV2Request;
import software.amazon.awssdk.services.s3.model.ListObjectsV2Response;
import software.amazon.awssdk.services.s3.model.S3Exception;
import software.amazon.awssdk.services.s3.model.S3Object;

import software.amazon.awssdk.services.s3.paginators.ListObjectsV2Iterable;

/**
* Cooper.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ final class HumanReadableFormatter {
/** Cached decimal format. */
private final DecimalFormat decimalFormat;

/** Multi-byte units, in binary. See https://en.wikipedia.org/wiki/Byte#Multiple-byte_units. */
/**
* Multi-byte units, in binary.
* See <a href="https://en.wikipedia.org/wiki/Byte#Multiple-byte_units">Multi-byte units</a>.
*/
static final String[] UNITS = new String[] { "Bytes", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB" };


Expand Down
10 changes: 2 additions & 8 deletions src/main/java/com/github/heuermh/cooper/Ls.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,14 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import picocli.AutoComplete.GenerateCompletion;

import picocli.CommandLine.Command;
import picocli.CommandLine.HelpCommand;
import picocli.CommandLine.ITypeConverter;
import picocli.CommandLine.ScopeType;

import software.amazon.awssdk.regions.Region;

import software.amazon.awssdk.services.s3.S3Client;

import software.amazon.awssdk.services.s3.model.ListObjectsV2Request;
import software.amazon.awssdk.services.s3.model.ListObjectsV2Response;
import software.amazon.awssdk.services.s3.model.S3Exception;
import software.amazon.awssdk.services.s3.model.S3Object;

import software.amazon.awssdk.services.s3.paginators.ListObjectsV2Iterable;
Expand Down Expand Up @@ -76,7 +70,7 @@ public final class Ls implements Callable<Integer> {
private List<String> uris;

/** Logger. */
private Logger logger = LoggerFactory.getLogger(Ls.class);
private final Logger logger = LoggerFactory.getLogger(Ls.class);

/** Human readable formatter. */
static final HumanReadableFormatter FORMATTER = new HumanReadableFormatter();
Expand Down Expand Up @@ -107,7 +101,7 @@ public Integer call() throws Exception {
ListObjectsV2Request.Builder requestBuilder = ListObjectsV2Request.builder()
.bucket(bucket);

if (prefix != null && prefix.trim().length() > 0) {
if (prefix != null && !prefix.trim().isEmpty()) {
requestBuilder = requestBuilder.prefix(prefix);
}

Expand Down

0 comments on commit 3bff422

Please sign in to comment.