Ejemplo n.º 1
0
  /**
   * This implementation invokes {@link BlobUtilsImpl#directoryExists}
   *
   * @param container container name
   * @param directory virtual path
   */
  public ListenableFuture<Boolean> directoryExists(
      final String containerName, final String directory) {
    return org.jclouds.concurrent.Futures.makeListenable(
        service.submit(
            new Callable<Boolean>() {

              public Boolean call() throws Exception {
                return blobUtils.directoryExists(containerName, directory);
              }

              @Override
              public String toString() {
                return "directoryExists(" + containerName + "," + directory + ")";
              }
            }),
        service);
  }
Ejemplo n.º 2
0
  /**
   * This implementation invokes {@link BlobUtilsImpl#countBlobs}
   *
   * @param container container name
   */
  @Override
  public ListenableFuture<Long> countBlobs(
      final String containerName, final ListContainerOptions options) {
    return org.jclouds.concurrent.Futures.makeListenable(
        service.submit(
            new Callable<Long>() {
              public Long call() throws Exception {
                return blobUtils.countBlobs(containerName, options);
              }

              @Override
              public String toString() {
                return "countBlobs(" + containerName + ")";
              }
            }),
        service);
  }
Ejemplo n.º 3
0
  /**
   * This implementation invokes {@link #deleteAndEnsurePathGone}
   *
   * @param container bucket name
   */
  @Override
  public ListenableFuture<Void> deleteContainer(final String container) {
    return org.jclouds.concurrent.Futures.makeListenable(
        service.submit(
            new Callable<Void>() {

              public Void call() throws Exception {
                deleteAndEnsurePathGone(container);
                return null;
              }

              @Override
              public String toString() {
                return "deleteContainer(" + container + ")";
              }
            }),
        service);
  }
Ejemplo n.º 4
0
  /**
   * This implementation invokes {@link BlobUtilsImpl#deleteDirectory}.
   *
   * @param container container name
   */
  @Override
  public ListenableFuture<Void> deleteDirectory(
      final String containerName, final String directory) {
    return org.jclouds.concurrent.Futures.makeListenable(
        service.submit(
            new Callable<Void>() {

              public Void call() throws Exception {
                blobUtils.deleteDirectory(containerName, directory);
                return null;
              }

              @Override
              public String toString() {
                return "deleteDirectory(" + containerName + "," + directory + ")";
              }
            }),
        service);
  }
Ejemplo n.º 5
0
  /**
   * This implementation invokes {@link BlobUtilsImpl#clearContainer}
   *
   * @param container container name
   */
  @Override
  public ListenableFuture<Void> clearContainer(
      final String containerName, final ListContainerOptions options) {
    return org.jclouds.concurrent.Futures.makeListenable(
        service.submit(
            new Callable<Void>() {

              public Void call() throws Exception {
                blobUtils.clearContainer(containerName, options);
                return null;
              }

              @Override
              public String toString() {
                return "clearContainer(" + containerName + ")";
              }
            }),
        service);
  }