mirror of
https://github.com/apache/jclouds.git
synced 2025-02-10 12:06:14 +00:00
Issue 463: updated to guava r08
This commit is contained in:
parent
1431b635ed
commit
c339c484f4
@ -110,7 +110,7 @@
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>r07</version>
|
||||
<version>r08</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.findbugs</groupId>
|
||||
|
@ -21,7 +21,8 @@ package org.jclouds.rest.binders;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static com.google.common.net.InternetDomainName.isValid;
|
||||
import static com.google.common.net.InternetDomainName.fromLenient;
|
||||
import static com.google.common.net.InternetDomainName.isValidLenient;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Provider;
|
||||
@ -51,9 +52,9 @@ public class BindAsHostPrefix implements Binder {
|
||||
@SuppressWarnings("unchecked")
|
||||
public <R extends HttpRequest> R bindToRequest(R request, Object payload) {
|
||||
checkNotNull(payload, "hostprefix");
|
||||
checkArgument(isValid(request.getEndpoint().getHost()), "this is only valid for hostnames: " + request);
|
||||
checkArgument(isValidLenient(request.getEndpoint().getHost()), "this is only valid for hostnames: " + request);
|
||||
UriBuilder builder = uriBuilderProvider.get().uri(request.getEndpoint());
|
||||
InternetDomainName name = InternetDomainName.from(request.getEndpoint().getHost()).child(payload.toString());
|
||||
InternetDomainName name = fromLenient(request.getEndpoint().getHost()).child(payload.toString());
|
||||
builder.host(name.name());
|
||||
return (R) request.toBuilder().endpoint(builder.build()).build();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user