Skip to content

Commit

Permalink
Fix version in LocalGcdHelper and check for null values when removing…
Browse files Browse the repository at this point in the history
… URL scheme
  • Loading branch information
Ajay Kannan committed Oct 5, 2015
1 parent 4d2fe25 commit e0aaaba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,12 @@ private static boolean includesScheme(String url) {
}

private static String removeScheme(String url) {
if (url.startsWith("https://")) {
return url.substring("https://".length());
} else if (url.startsWith("http://")) {
return url.substring("http://".length());
if (url != null) {
if (url.startsWith("https://")) {
return url.substring("https://".length());
} else if (url.startsWith("http://")) {
return url.substring("http://".length());
}
}
return url;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,7 @@ public static void main(String... args) throws IOException, InterruptedException
public static boolean isActive(String projectId) {
try {
StringBuilder urlBuilder = new StringBuilder("http://localhost:").append(PORT);
urlBuilder.append("/datastore/" + com.google.datastore.v1beta3.client.DatastoreFactory.VERSION
+ "/projects/").append(projectId).append(":lookup");
urlBuilder.append("/datastore/v1beta3/projects/").append(projectId).append(":lookup");
URL url = new URL(urlBuilder.toString());
try (BufferedReader reader =
new BufferedReader(new InputStreamReader(url.openStream(), UTF_8))) {
Expand Down

0 comments on commit e0aaaba

Please sign in to comment.