congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
LifecycleConfig
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jets3t

  public void endRule(String text) {
    config.addRule(latestRule);
  }
}
origin: iterate-ch/cyberduck

Integer expiration = null;
String storageClass = null;
for(LifecycleConfig.Rule rule : status.getRules()) {
  if(rule.getTransition() != null) {
    storageClass = rule.getTransition().getStorageClass();
origin: net.java.dev.jets3t/jets3t

@Override
public void setLifecycleConfigImpl(String bucketName, LifecycleConfig config)
  throws S3ServiceException
{
  Map<String, String> requestParameters = new HashMap<String, String>();
  requestParameters.put("lifecycle", "");
  String xml;
  String xmlMd5Hash;
  try {
    xml = config.toXml();
    xmlMd5Hash = ServiceUtils.toBase64(
      ServiceUtils.computeMD5Hash(xml.getBytes(Constants.DEFAULT_ENCODING)));
  } catch (Exception e) {
    throw new S3ServiceException("Unable to build LifecycleConfig XML document", e);
  }
  Map<String, Object> metadata = new HashMap<String, Object>();
  metadata.put("Content-MD5", xmlMd5Hash);
  try {
    performRestPut(bucketName, null, metadata, requestParameters,
      new StringEntity(xml, "text/plain", Constants.DEFAULT_ENCODING),
      true);
  } catch (ServiceException se) {
    throw new S3ServiceException(se);
  } catch (UnsupportedEncodingException e) {
    throw new S3ServiceException("Unable to encode XML document", e);
  }
}
origin: iterate-ch/cyberduck

@Override
public void setConfiguration(final Path file, final LifecycleConfiguration configuration) throws BackgroundException {
  final Path container = containerService.getContainer(file);
  try {
    if(configuration.getTransition() != null || configuration.getExpiration() != null) {
      final LifecycleConfig config = new LifecycleConfig();
      // Unique identifier for the rule. The value cannot be longer than 255 characters. When you specify an empty prefix, the rule applies to all objects in the bucket
      final LifecycleConfig.Rule rule = config.newRule(
          String.format("%s-%s", PreferencesFactory.get().getProperty("application.name"), new AlphanumericRandomStringService().random()), StringUtils.EMPTY, true);
      if(configuration.getTransition() != null) {
        rule.newTransition().setDays(configuration.getTransition());
      }
      if(configuration.getExpiration() != null) {
        rule.newExpiration().setDays(configuration.getExpiration());
      }
      session.getClient().setLifecycleConfig(container.getName(), config);
    }
    else {
      session.getClient().deleteLifecycleConfig(container.getName());
    }
  }
  catch(ServiceException e) {
    throw new S3ExceptionMappingService().map("Failure to write attributes of {0}", e, container);
  }
}
origin: net.java.dev.jets3t/jets3t

for (Rule rule: this.getRules()) {
  XMLBuilder b = builder.elem("Rule");
  if (rule.id != null && rule.id.length() > 0) {
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jets3t

@Override
public void setLifecycleConfigImpl(String bucketName, LifecycleConfig config)
  throws S3ServiceException
{
  Map<String, String> requestParameters = new HashMap<String, String>();
  requestParameters.put("lifecycle", "");
  String xml;
  String xmlMd5Hash;
  try {
    xml = config.toXml();
    xmlMd5Hash = ServiceUtils.toBase64(
      ServiceUtils.computeMD5Hash(xml.getBytes(Constants.DEFAULT_ENCODING)));
  } catch (Exception e) {
    throw new S3ServiceException("Unable to build LifecycleConfig XML document", e);
  }
  Map<String, Object> metadata = new HashMap<String, Object>();
  metadata.put("Content-MD5", xmlMd5Hash);
  try {
    performRestPut(bucketName, null, metadata, requestParameters,
      new StringEntity(xml, "text/plain", Constants.DEFAULT_ENCODING),
      true);
  } catch (ServiceException se) {
    throw new S3ServiceException(se);
  } catch (UnsupportedEncodingException e) {
    throw new S3ServiceException("Unable to encode XML document", e);
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jets3t

for (Rule rule: this.getRules()) {
  XMLBuilder b = builder.elem("Rule");
  if (rule.id != null && rule.id.length() > 0) {
origin: net.java.dev.jets3t/jets3t

  public void endRule(String text) {
    config.addRule(latestRule);
  }
}
org.jets3t.service.modelLifecycleConfig

Javadoc

Represents the lifecycle configuraton of a bucket.

Most used methods

  • getRules
  • addRule
  • toXml
  • <init>
  • newRule

Popular in Java

  • Making http requests using okhttp
  • getApplicationContext (Context)
  • getExternalFilesDir (Context)
  • startActivity (Activity)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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