Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump org.gaul:modernizer-maven-plugin from 2.9.0 to 3.0.0 #76

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading