Tabnine Logo
StorageBucket
Code IndexAdd Tabnine to your IDE (free)

How to use
StorageBucket
in
org.jets3t.service.model

Best Java code snippets using org.jets3t.service.model.StorageBucket (Showing top 20 results out of 315)

origin: net.java.dev.jets3t/jets3t

/**
 * Create a bucket with the Access Control List settings of the bucket object (if any).
 * <p>
 * <b>Caution:</b> Performing this operation unnecessarily when a bucket already
 * exists may cause OperationAborted errors with the message "A conflicting conditional
 * operation is currently in progress against this resource.". To avoid this error, use the
 * {@link #getOrCreateBucket(String)} in situations where the bucket may already exist.
 * <p>
 * This method cannot be performed by anonymous services.
 *
 * @param bucket
 * the bucket to create, including optional ACL settings.
 * @return
 * the created bucket object. <b>Note:</b> the object returned has minimal information about
 * the bucket that was created, including only the bucket's name.
 * @throws ServiceException
 */
public StorageBucket createBucket(StorageBucket bucket) throws ServiceException
{
  return createBucketImpl(bucket.getName(), bucket.getLocation(), bucket.getAcl());
}
origin: net.java.dev.jets3t/jets3t

/**
 * Sets the bucket's creation date - this should only be used internally by JetS3t
 * methods that retrieve information directly from a service.
 *
 * @param creationDate
 */
public void setCreationDate(Date creationDate) {
  addMetadata(METADATA_HEADER_CREATION_DATE, creationDate);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jets3t

/**
 * @return
 * the bucket's creation date, or null if it is unknown.
 */
public Date getCreationDate() {
  return (Date) getMetadata(METADATA_HEADER_CREATION_DATE);
}
origin: net.java.dev.jets3t/jets3t

@Override
public String toString() {
  return "StorageBucket [name=" + getName() + "] Metadata=" + getMetadataMap();
}
origin: iterate-ch/cyberduck

final Path bucket = new Path(PathNormalizer.normalize(b.getName()), EnumSet.of(Path.Type.volume, Path.Type.directory));
if(b.getOwner() != null) {
  bucket.attributes().setOwner(b.getOwner().getId());
bucket.attributes().setCreationDate(b.getCreationDate().getTime());
if(b.isLocationKnown()) {
  bucket.attributes().setRegion(b.getLocation());
  if(!b.isLocationKnown()) {
    location = session.getFeature(Location.class).getLocation(bucket).getIdentifier();
    location = b.getLocation();
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jets3t

bucket.setName(bucketName);
bucket.setLocation(location);
bucket.setAcl(acl);
bucket.replaceAllMetadata(map);
return bucket;
origin: net.java.dev.jets3t/jets3t

/**
 * Throws an exception if a bucket is null or contains a null/empty name.
 * @param bucket
 * @param action
 * the action being attempted which this assertion is applied, for debugging purposes.
 * @throws ServiceException
 */
protected void assertValidBucket(StorageBucket bucket, String action) throws ServiceException {
  if (bucket == null || bucket.getName() == null || bucket.getName().length() == 0) {
    throw new ServiceException("The action " + action
      + " cannot be performed with an invalid bucket: " + bucket);
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jets3t

  @Override
  public void endElement(String name, String elementText) {
    // Listing details.
    if (name.equals("ID")) {
      bucketsOwner.setId(elementText);
    } else if (name.equals("DisplayName")) {
      bucketsOwner.setDisplayName(elementText);
    }
    // Bucket item details.
    else if (name.equals("Bucket")) {
      if (log.isDebugEnabled()) {
        log.debug("Created new bucket from listing: " + currentBucket);
      }
      currentBucket.setOwner(bucketsOwner);
      buckets.add(currentBucket);
    } else if (name.equals("Name")) {
      currentBucket.setName(elementText);
    } else if (name.equals("CreationDate")) {
      elementText += ".000Z";
      try {
        currentBucket.setCreationDate(ServiceUtils.parseIso8601Date(elementText));
      } catch (ParseException e) {
        throw new RuntimeException(
          "Non-ISO8601 date for CreationDate in list buckets output: "
          + elementText, e);
      }
    }
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jets3t

/**
 * Applies access control settings to a bucket. The ACL settings must be included
 * inside the bucket.
 *
 * This method can be performed by anonymous services, but can only succeed if the
 * bucket's existing ACL already allows write access by the anonymous user.
 * In general, you can only access the ACL of a bucket if the ACL already in place
 * for that bucket allows you to do so.
 *
 * @param bucket
 * a bucket with ACL settings to apply.
 * @throws ServiceException
 */
public void putBucketAcl(StorageBucket bucket) throws ServiceException {
  assertValidBucket(bucket, "Put Bucket Access Control List");
  putBucketAcl(bucket.getName(), bucket.getAcl());
}
origin: net.java.dev.jets3t/jets3t

if (storageService.getProviderCredentials() == null) {
  bucket = new StorageBucket(bucketName);
} else {
      bucket = storageService.createBucket(new StorageBucket(bucketName));
    } catch (ServiceException e) {
        bucket = new StorageBucket(bucketName);
      } catch (ServiceException e2) {
origin: net.java.dev.jets3t/jets3t

bucket.setName(bucketName);
bucket.setLocation(location);
bucket.setAcl(acl);
bucket.replaceAllMetadata(map);
return bucket;
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jets3t

/**
 * Throws an exception if a bucket is null or contains a null/empty name.
 * @param bucket
 * @param action
 * the action being attempted which this assertion is applied, for debugging purposes.
 * @throws ServiceException
 */
protected void assertValidBucket(StorageBucket bucket, String action) throws ServiceException {
  if (bucket == null || bucket.getName() == null || bucket.getName().length() == 0) {
    throw new ServiceException("The action " + action
      + " cannot be performed with an invalid bucket: " + bucket);
  }
}
origin: net.java.dev.jets3t/jets3t

  @Override
  public void endElement(String name, String elementText) {
    // Listing details.
    if (name.equals("ID")) {
      bucketsOwner.setId(elementText);
    } else if (name.equals("DisplayName")) {
      bucketsOwner.setDisplayName(elementText);
    }
    // Bucket item details.
    else if (name.equals("Bucket")) {
      if (log.isDebugEnabled()) {
        log.debug("Created new bucket from listing: " + currentBucket);
      }
      currentBucket.setOwner(bucketsOwner);
      buckets.add(currentBucket);
    } else if (name.equals("Name")) {
      currentBucket.setName(elementText);
    } else if (name.equals("CreationDate")) {
      elementText += ".000Z";
      try {
        currentBucket.setCreationDate(ServiceUtils.parseIso8601Date(elementText));
      } catch (ParseException e) {
        throw new RuntimeException(
          "Non-ISO8601 date for CreationDate in list buckets output: "
          + elementText, e);
      }
    }
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jets3t

@Override
public String toString() {
  return "StorageBucket [name=" + getName() + "] Metadata=" + getMetadataMap();
}
origin: net.java.dev.jets3t/jets3t

/**
 * Applies access control settings to a bucket. The ACL settings must be included
 * inside the bucket.
 *
 * This method can be performed by anonymous services, but can only succeed if the
 * bucket's existing ACL already allows write access by the anonymous user.
 * In general, you can only access the ACL of a bucket if the ACL already in place
 * for that bucket allows you to do so.
 *
 * @param bucket
 * a bucket with ACL settings to apply.
 * @throws ServiceException
 */
public void putBucketAcl(StorageBucket bucket) throws ServiceException {
  assertValidBucket(bucket, "Put Bucket Access Control List");
  putBucketAcl(bucket.getName(), bucket.getAcl());
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jets3t

if (storageService.getProviderCredentials() == null) {
  bucket = new StorageBucket(bucketName);
} else {
      bucket = storageService.createBucket(new StorageBucket(bucketName));
    } catch (ServiceException e) {
        bucket = new StorageBucket(bucketName);
      } catch (ServiceException e2) {
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jets3t

/**
 * Create a bucket with the Access Control List settings of the bucket object (if any).
 * <p>
 * <b>Caution:</b> Performing this operation unnecessarily when a bucket already
 * exists may cause OperationAborted errors with the message "A conflicting conditional
 * operation is currently in progress against this resource.". To avoid this error, use the
 * {@link #getOrCreateBucket(String)} in situations where the bucket may already exist.
 * <p>
 * This method cannot be performed by anonymous services.
 *
 * @param bucket
 * the bucket to create, including optional ACL settings.
 * @return
 * the created bucket object. <b>Note:</b> the object returned has minimal information about
 * the bucket that was created, including only the bucket's name.
 * @throws ServiceException
 */
public StorageBucket createBucket(StorageBucket bucket) throws ServiceException
{
  return createBucketImpl(bucket.getName(), bucket.getLocation(), bucket.getAcl());
}
origin: net.java.dev.jets3t/jets3t

public static void registerMBeans(StorageBucket[] buckets) {
  if (!isEnabled) {
    return;
  }
  for (int i=0; i<buckets.length; i++) {
    getInstance(buckets[i].getName());
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jets3t

/**
 * Sets the bucket's creation date - this should only be used internally by JetS3t
 * methods that retrieve information directly from a service.
 *
 * @param creationDate
 */
public void setCreationDate(Date creationDate) {
  addMetadata(METADATA_HEADER_CREATION_DATE, creationDate);
}
origin: net.java.dev.jets3t/jets3t

/**
 * @return
 * the bucket's creation date, or null if it is unknown.
 */
public Date getCreationDate() {
  return (Date) getMetadata(METADATA_HEADER_CREATION_DATE);
}
org.jets3t.service.modelStorageBucket

Javadoc

A generic storage bucket.

Most used methods

  • getLocation
  • getName
  • <init>
  • addMetadata
  • getAcl
  • getMetadata
  • getMetadataMap
  • replaceAllMetadata
  • setAcl
    Sets the bucket's Access Control List - this should only be used internally by JetS3t methods that r
  • setCreationDate
    Sets the bucket's creation date - this should only be used internally by JetS3t methods that retriev
  • setLocation
    Set's the bucket's location. This method should only be used internally by JetS3t methods that retri
  • setName
  • setLocation,
  • setName,
  • setOwner,
  • getCreationDate,
  • getOwner,
  • isLocationKnown

Popular in Java

  • Making http requests using okhttp
  • getResourceAsStream (ClassLoader)
  • compareTo (BigDecimal)
  • setContentView (Activity)
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now