Skip to content

Commit f39c610

Browse files
committed
source formatting
1 parent f64efd2 commit f39c610

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

core/src/main/java/org/openstack4j/openstack/heat/utils/Template.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ private void getFileContents() {
4444
@SuppressWarnings("unchecked")
4545
Map<String, Object> content = (Map<String, Object>) yaml.load(getTplContent());
4646
try {
47-
resolveTempalteGetFiles(content);
47+
resolveTemplateGetFiles(content);
4848
resolveTemplateType(content);
4949
} catch (IOException e) {
5050
e.printStackTrace();
@@ -79,7 +79,6 @@ private void resolveTemplateType(Map<?,?> map) throws MalformedURLException, IOE
7979
}
8080
}
8181

82-
8382
if (value instanceof Map<?,?>){
8483
resolveTemplateType((Map<?,?>)value);
8584
} else if (value instanceof List<?>) {
@@ -92,7 +91,7 @@ private void resolveTemplateType(Map<?,?> map) throws MalformedURLException, IOE
9291
}
9392
}
9493

95-
private void resolveTempalteGetFiles(Map<?,?> map) throws IOException {
94+
private void resolveTemplateGetFiles(Map<?,?> map) throws IOException {
9695
for(Object key : map.keySet()){
9796
// Ignore if the key is not string. Actually not happening
9897
if(!(key instanceof String)) {
@@ -111,11 +110,11 @@ private void resolveTempalteGetFiles(Map<?,?> map) throws IOException {
111110

112111
Object subMap = map.get(skey);
113112
if (subMap instanceof Map<?,?>){
114-
resolveTempalteGetFiles((Map<?,?>)subMap);
113+
resolveTemplateGetFiles((Map<?,?>)subMap);
115114
} else if (subMap instanceof List<?>) {
116115
for (Object item : (List<?>) subMap) {
117116
if (item instanceof Map<?, ?>) {
118-
resolveTempalteGetFiles((Map<?, ?>) item);
117+
resolveTemplateGetFiles((Map<?, ?>) item);
119118
}
120119
}
121120
}
@@ -158,5 +157,4 @@ public Map<String, String> getFiles() {
158157
public void setFiles(Map<String, String> files) {
159158
this.files = files;
160159
}
161-
162160
}

core/src/main/java/org/openstack4j/openstack/heat/utils/TemplateUtils.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
package org.openstack4j.openstack.heat.utils;
22

3+
import static org.openstack4j.core.transport.ClientConstants.URI_SEP;
4+
35
import java.io.File;
46
import java.io.IOException;
57
import java.net.MalformedURLException;
68
import java.net.URI;
79
import java.net.URISyntaxException;
810
import java.net.URL;
911

12+
import org.openstack4j.core.transport.ClientConstants;
13+
1014
import com.google.common.base.Charsets;
1115
import com.google.common.io.Resources;
1216

@@ -21,9 +25,9 @@ public static String readToString(URL url) throws IOException {
2125
}
2226

2327
public static URL baseUrl(String url) throws MalformedURLException {
24-
String baseUrl = url.substring(0, url.lastIndexOf("/") + 1);
25-
if(! baseUrl.endsWith("/")) {
26-
baseUrl += "/";
28+
String baseUrl = url.substring(0, url.lastIndexOf(URI_SEP) + 1);
29+
if(! baseUrl.endsWith(URI_SEP)) {
30+
baseUrl += URI_SEP;
2731
}
2832
return new URL(baseUrl);
2933
}

0 commit comments

Comments
 (0)