mirror of https://github.com/apache/jclouds.git
JCLOUDS-40 unasync Fallback.
This commit is contained in:
parent
6db35d20bd
commit
0c9b49baf5
|
@ -18,17 +18,12 @@ package org.jclouds.googlecloudstorage.fallback;
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import static com.google.common.base.Throwables.propagate;
|
import static com.google.common.base.Throwables.propagate;
|
||||||
import static com.google.common.util.concurrent.Futures.immediateFuture;
|
|
||||||
import org.jclouds.Fallback;
|
import org.jclouds.Fallback;
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
|
||||||
|
|
||||||
public final class GCSFallbacks {
|
public final class GCSFallbacks {
|
||||||
|
|
||||||
public static final class NullOnBucketAlreadyExists implements Fallback<Object> {
|
public static final class NullOnBucketAlreadyExists implements Fallback<Object> {
|
||||||
public ListenableFuture<Object> create(Throwable t) throws Exception {
|
|
||||||
return immediateFuture(createOrPropagate(t));
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object createOrPropagate(Throwable t) throws Exception {
|
public Object createOrPropagate(Throwable t) throws Exception {
|
||||||
if (checkNotNull(t, "throwable") instanceof IllegalStateException) {
|
if (checkNotNull(t, "throwable") instanceof IllegalStateException) {
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in New Issue