Skip to content

Commit

Permalink
Bump org.gaul:modernizer-maven-plugin from 2.9.0 to 3.0.0 (#76)
Browse files Browse the repository at this point in the history
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Francesco Chicchiriccò <[email protected]>
  • Loading branch information
dependabot[bot] and ilgrosso authored Dec 30, 2024
1 parent e25f841 commit a3ec5b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
<plugin>
<groupId>org.gaul</groupId>
<artifactId>modernizer-maven-plugin</artifactId>
<version>2.9.0</version>
<version>3.0.0</version>
<configuration>
<javaVersion>${targetJdk}</javaVersion>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.gson.GsonFactory;
import java.awt.Desktop;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
Expand Down Expand Up @@ -101,8 +102,8 @@ public static void main(final String[] args) {
sa.run(args);
}

private void getConfigurationMap(final File clientJson) throws IOException, URISyntaxException {
GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new FileReader(clientJson));
private void getConfigurationMap(final Path clientJson) throws IOException, URISyntaxException {
GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, Files.newBufferedReader(clientJson));
CONFIG_MAP.put("clientId", clientSecrets.getDetails().getClientId());
CONFIG_MAP.put("clientSecret", clientSecrets.getDetails().getClientSecret());

Expand Down Expand Up @@ -142,12 +143,12 @@ public ServletRegistrationBean codeProcessorServlet() {
@Override
public void run(final String... args) throws IOException, URISyntaxException {
if (args.length == 1) {
File clientJson = new File(args[0]);
if (clientJson.isDirectory()) {
clientJson = new File(clientJson, CLIENTSECRETS_LOCATION);
Path clientJson = Paths.get(args[0]);
if (Files.isDirectory(clientJson)) {
clientJson = clientJson.resolve(CLIENTSECRETS_LOCATION);
}

if (clientJson.exists() && clientJson.isFile()) {
if (Files.isReadable(clientJson) && Files.isRegularFile(clientJson)) {
getConfigurationMap(clientJson);
} else {
LOG.error("Invalid client secret path: {}", clientJson);
Expand Down

0 comments on commit a3ec5b3

Please sign in to comment.