Skip to content

Commit b35382e

Browse files
committed
Update dependencies
1 parent 49e4082 commit b35382e

38 files changed

+246
-698
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ $RECYCLE.BIN/
5959
# Windows shortcuts
6060
*.lnk
6161

62-
/simplelocalize.yml
62+
/simplelocalize-sample.yml
6363
/dependency-reduced-pom.xml
6464
/build-far-jar.sh
6565
/build-quick.sh

src/main/java/io/simplelocalize/cli/SimplelocalizeCliCommand.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,9 @@ public void startAutoTranslation(
352352

353353
if (languageKeys != null)
354354
{
355-
AutoTranslationConfiguration autoTranslationConfiguration = new AutoTranslationConfiguration();
356-
autoTranslationConfiguration.setLanguageKeys(languageKeys);
355+
AutoTranslationConfiguration autoTranslationConfiguration = AutoTranslationConfiguration.builder()
356+
.languageKeys(languageKeys)
357+
.build();
357358
configuration.setAutoTranslation(autoTranslationConfiguration);
358359
}
359360

src/main/java/io/simplelocalize/cli/client/HttpClientFactory.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ public static HttpClient createHttpClient()
3838
ProxySelector proxySelector = getProxySelector(proxyConfigOptional);
3939
builder.proxy(proxySelector);
4040

41-
String proxyUsername = proxyConfigOptional.getUsername();
42-
String proxyPassword = proxyConfigOptional.getPassword();
41+
String proxyUsername = proxyConfigOptional.username();
42+
String proxyPassword = proxyConfigOptional.password();
4343
boolean hasProxyAuthentication = proxyUsername != null && proxyPassword != null;
4444
if (hasProxyAuthentication)
4545
{
@@ -63,8 +63,8 @@ private static String getSystemProxyVariable()
6363

6464
private static ProxySelector getProxySelector(ProxyConfiguration proxyConfigOptional)
6565
{
66-
String host = proxyConfigOptional.getHost();
67-
Integer port = proxyConfigOptional.getPort();
66+
String host = proxyConfigOptional.host();
67+
Integer port = proxyConfigOptional.port();
6868
InetSocketAddress proxyAddress = new InetSocketAddress(host, port);
6969
return ProxySelector.of(proxyAddress);
7070
}

src/main/java/io/simplelocalize/cli/client/SystemProxySelector.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,11 @@ public static ProxyConfiguration getHttpProxyValueOrNull(String httpProxyValue)
6363
username = usernameAndPassword[0];
6464
password = usernameAndPassword[1];
6565
}
66-
return new ProxyConfiguration()
67-
.setHost(host)
68-
.setPort(port)
69-
.setUsername(username)
70-
.setPassword(password);
66+
return ProxyConfiguration.builder()
67+
.host(host)
68+
.port(port)
69+
.username(username)
70+
.password(password)
71+
.build();
7172
}
7273
}
Lines changed: 3 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,10 @@
11
package io.simplelocalize.cli.client.dto;
22

3+
import lombok.Builder;
4+
35
import java.util.List;
46

7+
@Builder(setterPrefix = "with")
58
public record DownloadRequest(String format, String languageKey, String customerId, List<String> options, String sort)
69
{
7-
public static final class DownloadRequestBuilder
8-
{
9-
private String format;
10-
private String languageKey;
11-
private String customerId;
12-
private List<String> options;
13-
private String sort;
14-
15-
private DownloadRequestBuilder()
16-
{
17-
}
18-
19-
public static DownloadRequestBuilder builder()
20-
{
21-
return new DownloadRequestBuilder();
22-
}
23-
24-
public DownloadRequestBuilder withFormat(String downloadFormat)
25-
{
26-
this.format = downloadFormat;
27-
return this;
28-
}
29-
30-
public DownloadRequestBuilder withLanguageKey(String languageKey)
31-
{
32-
this.languageKey = languageKey;
33-
return this;
34-
}
35-
36-
public DownloadRequestBuilder withCustomerId(String customerId)
37-
{
38-
this.customerId = customerId;
39-
return this;
40-
}
41-
42-
public DownloadRequestBuilder withOptions(List<String> downloadOptions)
43-
{
44-
this.options = downloadOptions;
45-
return this;
46-
}
47-
48-
public DownloadRequestBuilder withSort(String sort)
49-
{
50-
this.sort = sort;
51-
return this;
52-
}
53-
54-
public DownloadRequest build()
55-
{
56-
return new DownloadRequest(
57-
this.format,
58-
this.languageKey,
59-
this.customerId,
60-
this.options,
61-
this.sort
62-
);
63-
}
64-
}
6510
}
Lines changed: 3 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,11 @@
11
package io.simplelocalize.cli.client.dto;
22

33

4+
import lombok.Builder;
5+
46
import java.nio.file.Path;
57

8+
@Builder(setterPrefix = "with")
69
public record FileToUpload(Path path, String language, String namespace)
710
{
8-
9-
public static final class FileToUploadBuilder
10-
{
11-
private Path path;
12-
private String language;
13-
private String namespace;
14-
15-
private FileToUploadBuilder()
16-
{
17-
}
18-
19-
public static FileToUploadBuilder builder()
20-
{
21-
return new FileToUploadBuilder();
22-
}
23-
24-
public FileToUploadBuilder withPath(Path path)
25-
{
26-
this.path = path;
27-
return this;
28-
}
29-
30-
public FileToUploadBuilder withLanguage(String language)
31-
{
32-
this.language = language;
33-
return this;
34-
}
35-
36-
public FileToUploadBuilder withNamespace(String namespace)
37-
{
38-
this.namespace = namespace;
39-
return this;
40-
}
41-
42-
public FileToUpload build()
43-
{
44-
return new FileToUpload(
45-
this.path,
46-
this.language,
47-
this.namespace
48-
);
49-
}
50-
51-
@Override
52-
public String toString()
53-
{
54-
return "FileToUploadBuilder{" +
55-
"path=" + path +
56-
", language='" + language + '\'' +
57-
", namespace='" + namespace + '\'' +
58-
'}';
59-
}
60-
}
6111
}
Lines changed: 9 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,13 @@
11
package io.simplelocalize.cli.client.dto;
22

3-
import java.util.Objects;
4-
5-
public class ProxyConfiguration
3+
import lombok.Builder;
4+
5+
@Builder
6+
public record ProxyConfiguration(
7+
String host,
8+
Integer port,
9+
String username,
10+
String password
11+
)
612
{
7-
private String host;
8-
private Integer port;
9-
private String username;
10-
private String password;
11-
12-
public String getHost()
13-
{
14-
return host;
15-
}
16-
17-
public ProxyConfiguration setHost(String host)
18-
{
19-
this.host = host;
20-
return this;
21-
}
22-
23-
public Integer getPort()
24-
{
25-
return port;
26-
}
27-
28-
public ProxyConfiguration setPort(Integer port)
29-
{
30-
this.port = port;
31-
return this;
32-
}
33-
34-
public String getUsername()
35-
{
36-
return username;
37-
}
38-
39-
public ProxyConfiguration setUsername(String username)
40-
{
41-
this.username = username;
42-
return this;
43-
}
44-
45-
public String getPassword()
46-
{
47-
return password;
48-
}
49-
50-
public ProxyConfiguration setPassword(String password)
51-
{
52-
this.password = password;
53-
return this;
54-
}
55-
56-
@Override
57-
public boolean equals(Object o)
58-
{
59-
if (this == o) return true;
60-
if (o == null || getClass() != o.getClass()) return false;
61-
ProxyConfiguration that = (ProxyConfiguration) o;
62-
return Objects.equals(host, that.host) && Objects.equals(port, that.port) && Objects.equals(username, that.username) && Objects.equals(password, that.password);
63-
}
64-
65-
@Override
66-
public int hashCode()
67-
{
68-
return Objects.hash(host, port, username, password);
69-
}
70-
71-
@Override
72-
public String toString()
73-
{
74-
String redactedPassword = password == null ? null : "*****";
75-
return
76-
"host='" + host + '\'' +
77-
", port=" + port +
78-
", username='" + username + '\'' +
79-
", password='" + redactedPassword + '\'';
80-
}
8113
}
Lines changed: 3 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
package io.simplelocalize.cli.client.dto;
22

3+
import lombok.Builder;
4+
35
import java.nio.file.Path;
46
import java.util.List;
57

8+
@Builder(setterPrefix = "with")
69
public record UploadRequest(
710
Path path,
811
String languageKey,
@@ -12,72 +15,4 @@ public record UploadRequest(
1215
String customerId
1316
)
1417
{
15-
16-
public static final class UploadFileRequestBuilder
17-
{
18-
private Path uploadPath;
19-
private String languageKey;
20-
private String uploadFormat;
21-
private List<String> uploadOptions;
22-
private String namespace;
23-
private String customerId;
24-
25-
private UploadFileRequestBuilder()
26-
{
27-
}
28-
29-
public static UploadFileRequestBuilder builder()
30-
{
31-
return new UploadFileRequestBuilder();
32-
}
33-
34-
public UploadFileRequestBuilder withPath(Path uploadPath)
35-
{
36-
this.uploadPath = uploadPath;
37-
return this;
38-
}
39-
40-
public UploadFileRequestBuilder withLanguageKey(String languageKey)
41-
{
42-
this.languageKey = languageKey;
43-
return this;
44-
}
45-
46-
public UploadFileRequestBuilder withFormat(String uploadFormat)
47-
{
48-
this.uploadFormat = uploadFormat;
49-
return this;
50-
}
51-
52-
public UploadFileRequestBuilder withOptions(List<String> uploadOptions)
53-
{
54-
this.uploadOptions = uploadOptions;
55-
return this;
56-
}
57-
58-
public UploadFileRequestBuilder withNamespace(String namespace)
59-
{
60-
this.namespace = namespace;
61-
return this;
62-
}
63-
64-
public UploadFileRequestBuilder withCustomerId(String customerId)
65-
{
66-
this.customerId = customerId;
67-
return this;
68-
}
69-
70-
71-
public UploadRequest build()
72-
{
73-
return new UploadRequest(
74-
this.uploadPath,
75-
this.languageKey,
76-
this.uploadFormat,
77-
this.uploadOptions,
78-
this.namespace,
79-
this.customerId
80-
);
81-
}
82-
}
8318
}

0 commit comments

Comments
 (0)