Skip to content

Commit f41ea33

Browse files
committed
change user agent - remove spaces. stricter layer parameter check. fix underlay method signature
1 parent 0eb24b4 commit f41ea33

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed

cloudinary-core/src/main/java/com/cloudinary/Transformation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public Transformation overlay(AbstractLayerBuilder<?> value) {
138138
return param("overlay", value);
139139
}
140140

141-
public Transformation underlay(Object value) {
141+
public Transformation underlay(String value) {
142142
return param("underlay", value);
143143
}
144144

cloudinary-core/src/main/java/com/cloudinary/transformation/TextLayerBuilder.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,17 @@ public String toString() {
107107
protected String textStyleIdentifier() {
108108
ArrayList<String> components = new ArrayList<String>();
109109

110-
if (this.fontWeight != null && !this.fontWeight.equals("normal"))
110+
if (StringUtils.isNotBlank(this.fontWeight) && !this.fontWeight.equals("normal"))
111111
components.add(this.fontWeight);
112-
if (this.fontStyle != null && !this.fontStyle.equals("normal"))
112+
if (StringUtils.isNotBlank(this.fontStyle) && !this.fontStyle.equals("normal"))
113113
components.add(this.fontStyle);
114-
if (this.textDecoration != null && !this.textDecoration.equals("none"))
114+
if (StringUtils.isNotBlank(this.textDecoration) && !this.textDecoration.equals("none"))
115115
components.add(this.textDecoration);
116-
if (this.textAlign != null)
116+
if (StringUtils.isNotBlank(this.textAlign))
117117
components.add(this.textAlign);
118-
if (this.stroke != null && !this.stroke.equals("none"))
118+
if (StringUtils.isNotBlank(this.stroke) && !this.stroke.equals("none"))
119119
components.add(this.stroke);
120-
if (this.letterSpacing != null)
120+
if (StringUtils.isNotBlank(this.letterSpacing))
121121
components.add("letter_spacing_" + this.letterSpacing);
122122

123123
if (this.fontFamily == null && this.fontSize == null && components.isEmpty()) {

cloudinary-http42/src/main/java/com/cloudinary/http42/ApiStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public ApiResponse callApi(HttpMethod method, Iterable<String> uri, Map<String,
9191
break;
9292
}
9393
request.setHeader("Authorization", "Basic " + Base64Coder.encodeString(apiKey + ":" + apiSecret));
94-
request.setHeader("User-Agent", Cloudinary.USER_AGENT + " Apache HTTP Components/4.2");
94+
request.setHeader("User-Agent", Cloudinary.USER_AGENT + " ApacheHTTPComponents/4.2");
9595

9696
HttpResponse response = client.execute(request);
9797

cloudinary-http42/src/main/java/com/cloudinary/http42/UploaderStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public Map callApi(String action, Map<String, Object> params, Map options, Objec
5858
}
5959

6060
HttpPost postMethod = new HttpPost(apiUrl);
61-
postMethod.setHeader("User-Agent", Cloudinary.USER_AGENT + " Apache HTTP Components/4.2");
61+
postMethod.setHeader("User-Agent", Cloudinary.USER_AGENT + " ApacheHTTPComponents/4.2");
6262

6363
if (options.get("content_range") != null) {
6464
postMethod.setHeader("Content-Range", (String) options.get("content_range"));

cloudinary-http43/src/main/java/com/cloudinary/http43/ApiStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void init(Api api) {
4242
super.init(api);
4343

4444
HttpClientBuilder clientBuilder = HttpClients.custom();
45-
clientBuilder.useSystemProperties().setUserAgent(Cloudinary.USER_AGENT + " Apache HTTP Components/4.3");
45+
clientBuilder.useSystemProperties().setUserAgent(Cloudinary.USER_AGENT + " ApacheHTTPComponents/4.3");
4646

4747
// If the configuration specifies a proxy then apply it to the client
4848
if (api.cloudinary.config.proxyHost != null && api.cloudinary.config.proxyPort != 0) {

cloudinary-http43/src/main/java/com/cloudinary/http43/UploaderStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void init(Uploader uploader) {
3535
super.init(uploader);
3636

3737
HttpClientBuilder clientBuilder = HttpClients.custom();
38-
clientBuilder.useSystemProperties().setUserAgent(Cloudinary.USER_AGENT + " Apache HTTP Components/4.3");
38+
clientBuilder.useSystemProperties().setUserAgent(Cloudinary.USER_AGENT + " ApacheHTTPComponents/4.3");
3939

4040
// If the configuration specifies a proxy then apply it to the client
4141
if (cloudinary().config.proxyHost != null && cloudinary().config.proxyPort != 0) {

cloudinary-http44/src/main/java/com/cloudinary/http44/ApiStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void init(Api api) {
4242
super.init(api);
4343

4444
HttpClientBuilder clientBuilder = HttpClients.custom();
45-
clientBuilder.useSystemProperties().setUserAgent(Cloudinary.USER_AGENT + " Apache HTTP Components/4.4");
45+
clientBuilder.useSystemProperties().setUserAgent(Cloudinary.USER_AGENT + " ApacheHTTPComponents/4.4");
4646

4747
// If the configuration specifies a proxy then apply it to the client
4848
if (api.cloudinary.config.proxyHost != null && api.cloudinary.config.proxyPort != 0) {

cloudinary-http44/src/main/java/com/cloudinary/http44/UploaderStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void init(Uploader uploader) {
3535
super.init(uploader);
3636

3737
HttpClientBuilder clientBuilder = HttpClients.custom();
38-
clientBuilder.useSystemProperties().setUserAgent(Cloudinary.USER_AGENT + " Apache HTTP Components/4.4");
38+
clientBuilder.useSystemProperties().setUserAgent(Cloudinary.USER_AGENT + " ApacheHTTPComponents/4.4");
3939

4040
// If the configuration specifies a proxy then apply it to the client
4141
if (cloudinary().config.proxyHost != null && cloudinary().config.proxyPort != 0) {

0 commit comments

Comments
 (0)