Tabnine Logo
AtmosObject.getSystemMetadata
Code IndexAdd Tabnine to your IDE (free)

How to use
getSystemMetadata
method
in
org.jclouds.atmos.domain.AtmosObject

Best Java code snippets using org.jclouds.atmos.domain.AtmosObject.getSystemMetadata (Showing top 20 results out of 315)

origin: org.jclouds.api/atmos

 public void run() {
   try {
    AtmosObject object = future.get();
    checkNotNull(object.getSystemMetadata(), object + " has no content metadata");
    if (object.getSystemMetadata().getContentMD5() != null) {
      if (Arrays.equals(toSearch, object.getSystemMetadata().getContentMD5())) {
       queue.put(true);
      }
    } else {
      logger.debug("object %s has no content md5", object.getSystemMetadata().getObjectID());
    }
   } catch (InterruptedException e) {
    Throwables.propagate(e);
   } catch (ExecutionException e) {
    Throwables.propagate(e);
   }
 }
}, userExecutor);
origin: io.cloudsoft.jclouds.api/atmos

 public void run() {
   try {
    AtmosObject object = future.get();
    checkNotNull(object.getSystemMetadata(), object + " has no content metadata");
    if (object.getSystemMetadata().getContentMD5() != null) {
      if (Arrays.equals(toSearch, object.getSystemMetadata().getContentMD5())) {
       queue.put(true);
      }
    } else {
      logger.debug("object %s has no content md5", object.getSystemMetadata().getObjectID());
    }
   } catch (InterruptedException e) {
    Throwables.propagate(e);
   } catch (ExecutionException e) {
    Throwables.propagate(e);
   }
 }
}, userExecutor);
origin: jclouds/legacy-jclouds

 public void run() {
   try {
    AtmosObject object = future.get();
    checkNotNull(object.getSystemMetadata(), object + " has no content metadata");
    if (object.getSystemMetadata().getContentMD5() != null) {
      if (Arrays.equals(toSearch, object.getSystemMetadata().getContentMD5())) {
       queue.put(true);
      }
    } else {
      logger.debug("object %s has no content md5", object.getSystemMetadata().getObjectID());
    }
   } catch (InterruptedException e) {
    Throwables.propagate(e);
   } catch (ExecutionException e) {
    Throwables.propagate(e);
   }
 }
}, userExecutor);
origin: io.cloudsoft.jclouds.api/atmos

@Override
public String apply(Object input) {
 checkArgument(checkNotNull(input, "input") instanceof AtmosObject,
    "this function is only valid for AtmosObjects!");
 AtmosObject object = AtmosObject.class.cast(input);
 return checkNotNull(object.getContentMetadata().getName() != null ? object.getContentMetadata().getName()
    : object.getSystemMetadata().getObjectName(), "objectName");
}
origin: org.apache.jclouds.api/atmos

@Override
public String apply(Object input) {
 checkArgument(checkNotNull(input, "input") instanceof AtmosObject,
    "this function is only valid for AtmosObjects!");
 AtmosObject object = AtmosObject.class.cast(input);
 return checkNotNull(object.getContentMetadata().getName() != null ? object.getContentMetadata().getName()
    : object.getSystemMetadata().getObjectName(), "objectName");
}
origin: Nextdoor/bender

@Override
public String apply(Object input) {
 checkArgument(checkNotNull(input, "input") instanceof AtmosObject,
    "this function is only valid for AtmosObjects!");
 AtmosObject object = AtmosObject.class.cast(input);
 return checkNotNull(object.getContentMetadata().getName() != null ? object.getContentMetadata().getName()
    : object.getSystemMetadata().getObjectName(), "objectName");
}
origin: apache/jclouds

@Override
public String apply(Object input) {
 checkArgument(checkNotNull(input, "input") instanceof AtmosObject,
    "this function is only valid for AtmosObjects!");
 AtmosObject object = AtmosObject.class.cast(input);
 return checkNotNull(object.getContentMetadata().getName() != null ? object.getContentMetadata().getName()
    : object.getSystemMetadata().getObjectName(), "objectName");
}
origin: jclouds/legacy-jclouds

@Override
public String apply(Object input) {
 checkArgument(checkNotNull(input, "input") instanceof AtmosObject,
    "this function is only valid for AtmosObjects!");
 AtmosObject object = AtmosObject.class.cast(input);
 return checkNotNull(object.getContentMetadata().getName() != null ? object.getContentMetadata().getName()
    : object.getSystemMetadata().getObjectName(), "objectName");
}
origin: org.jclouds.api/atmos

@Override
public String apply(Object input) {
 checkArgument(checkNotNull(input, "input") instanceof AtmosObject,
    "this function is only valid for AtmosObjects!");
 AtmosObject object = AtmosObject.class.cast(input);
 return checkNotNull(object.getContentMetadata().getName() != null ? object.getContentMetadata().getName()
    : object.getSystemMetadata().getObjectName(), "objectName");
}
origin: com.amysta.jclouds.api/atmos

@Override
public String apply(Object input) {
 checkArgument(checkNotNull(input, "input") instanceof AtmosObject,
    "this function is only valid for AtmosObjects!");
 AtmosObject object = AtmosObject.class.cast(input);
 return checkNotNull(object.getContentMetadata().getName() != null ? object.getContentMetadata().getName()
    : object.getSystemMetadata().getObjectName(), "objectName");
}
origin: Nextdoor/bender

  public MutableBlobMetadata apply(AtmosObject from) {
   if (from == null)
     return null;
   MutableBlobMetadata to = new MutableBlobMetadataImpl();
   to.setId(from.getSystemMetadata().getObjectID());
   to.setLastModified(from.getSystemMetadata().getLastUserDataModification());
   HttpUtils.copy(from.getContentMetadata(), to.getContentMetadata());
   to.setName(objectName.apply(from));
   to.setUri(from.getContentMetadata().getUri());
   to.setContainer(Iterables.get(Splitter.on('/').split(from.getContentMetadata().getPath()), 0));
   if (from.getAllHeaders().containsEntry("x-emc-groupacl", "other=READ"))
     to.setPublicUri(shareUrl.apply(from.getContentMetadata().getPath()));
   if (from.getSystemMetadata().getType() == FileType.DIRECTORY) {
     to.setType(StorageType.FOLDER);
   } else {
     to.setType(StorageType.BLOB);
   }
   Map<String, String> lowerKeyMetadata = Maps.newHashMap();
   for (Entry<String, String> entry : from.getUserMetadata().getMetadata().entrySet()) {
     String key = entry.getKey().toLowerCase();
     if (!systemMetadata.contains(key))
      lowerKeyMetadata.put(key, entry.getValue());
   }
   to.setUserMetadata(lowerKeyMetadata);
   to.setSize(from.getContentMetadata().getContentLength());
   return to;
  }
}
origin: org.apache.jclouds.api/atmos

/**
* First, calls {@link ParseSystemAndUserMetadataFromHeaders}.
* 
* Then, sets the object size based on the Content-Length header and adds the content to the
* {@link AtmosObject} result.
* 
* @throws org.jclouds.http.HttpException
*/
public AtmosObject apply(HttpResponse from) {
 checkNotNull(from, "http response");
 AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from));
 object.getContentMetadata().setName(object.getSystemMetadata().getObjectName());
 object.getContentMetadata().setPath(path);
 object.getContentMetadata().setUri(uri);
 object.getAllHeaders().putAll(from.getHeaders());
 object.setPayload(from.getPayload());
 object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from));
 object.getContentMetadata().setContentMD5(object.getSystemMetadata().getContentMD5());
 return object;
}
origin: apache/jclouds

/**
* First, calls {@link ParseSystemAndUserMetadataFromHeaders}.
* 
* Then, sets the object size based on the Content-Length header and adds the content to the
* {@link AtmosObject} result.
* 
* @throws org.jclouds.http.HttpException
*/
public AtmosObject apply(HttpResponse from) {
 checkNotNull(from, "http response");
 AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from));
 object.getContentMetadata().setName(object.getSystemMetadata().getObjectName());
 object.getContentMetadata().setPath(path);
 object.getContentMetadata().setUri(uri);
 object.getAllHeaders().putAll(from.getHeaders());
 object.setPayload(from.getPayload());
 object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from));
 object.getContentMetadata().setContentMD5(object.getSystemMetadata().getContentMD5());
 return object;
}
origin: jclouds/legacy-jclouds

private static void verifyMetadata(String metadataValue, AtmosObject getBlob) {
 assertEquals(getBlob.getContentMetadata().getContentLength(), Long.valueOf(16));
 assert getBlob.getContentMetadata().getContentType().startsWith("text/plain");
 assertEquals(getBlob.getUserMetadata().getMetadata().get("Metadata"), metadataValue);
 SystemMetadata md = getBlob.getSystemMetadata();
 assertEquals(md.getSize(), 16);
 assert md.getGroupID() != null;
 assertEquals(md.getHardLinkCount(), 1);
 assert md.getInceptionTime() != null;
 assert md.getLastAccessTime() != null;
 assert md.getLastMetadataModification() != null;
 assert md.getLastUserDataModification() != null;
 assert md.getObjectID() != null;
 assertEquals(md.getObjectName(), "object");
 assert md.getPolicyName() != null;
 assertEquals(md.getType(), FileType.REGULAR);
 assert md.getUserID() != null;
 try {
   Strings2.toStringAndClose(URI.create(
       "http://accesspoint.emccis.com/rest/objects/" + getBlob.getSystemMetadata().getObjectID()).toURL()
       .openStream());
   fail("shouldn't have worked, since it is private");
 } catch (IOException e) {
 }
}
origin: jclouds/legacy-jclouds

/**
* First, calls {@link ParseSystemAndUserMetadataFromHeaders}.
* 
* Then, sets the object size based on the Content-Length header and adds the content to the
* {@link AtmosObject} result.
* 
* @throws org.jclouds.http.HttpException
*/
public AtmosObject apply(HttpResponse from) {
 checkNotNull(from, "http response");
 AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from));
 object.getContentMetadata().setName(object.getSystemMetadata().getObjectName());
 object.getContentMetadata().setPath(path);
 object.getContentMetadata().setUri(uri);
 object.getAllHeaders().putAll(from.getHeaders());
 object.setPayload(from.getPayload());
 object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from));
 return object;
}
origin: org.jclouds.api/atmos

/**
* First, calls {@link ParseSystemAndUserMetadataFromHeaders}.
* 
* Then, sets the object size based on the Content-Length header and adds the content to the
* {@link AtmosObject} result.
* 
* @throws org.jclouds.http.HttpException
*/
public AtmosObject apply(HttpResponse from) {
 checkNotNull(from, "http response");
 AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from));
 object.getContentMetadata().setName(object.getSystemMetadata().getObjectName());
 object.getContentMetadata().setPath(path);
 object.getContentMetadata().setUri(uri);
 object.getAllHeaders().putAll(from.getHeaders());
 object.setPayload(from.getPayload());
 object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from));
 return object;
}
origin: apache/jclouds

private static void verifyMetadata(String metadataValue, AtmosObject getBlob) {
 assertEquals(getBlob.getContentMetadata().getContentLength(), Long.valueOf(16));
 assert getBlob.getContentMetadata().getContentType().startsWith("text/plain");
 assertEquals(getBlob.getUserMetadata().getMetadata().get("Metadata"), metadataValue);
 SystemMetadata md = getBlob.getSystemMetadata();
 assertEquals(md.getSize(), 16);
 assert md.getGroupID() != null;
 assertEquals(md.getHardLinkCount(), 1);
 assert md.getInceptionTime() != null;
 assert md.getLastAccessTime() != null;
 assert md.getLastMetadataModification() != null;
 assert md.getLastUserDataModification() != null;
 assert md.getObjectID() != null;
 assertEquals(md.getObjectName(), "object");
 assert md.getPolicyName() != null;
 assertEquals(md.getType(), FileType.REGULAR);
 assert md.getUserID() != null;
}
origin: Nextdoor/bender

/**
* First, calls {@link ParseSystemAndUserMetadataFromHeaders}.
* 
* Then, sets the object size based on the Content-Length header and adds the content to the
* {@link AtmosObject} result.
* 
* @throws org.jclouds.http.HttpException
*/
public AtmosObject apply(HttpResponse from) {
 checkNotNull(from, "http response");
 AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from));
 object.getContentMetadata().setName(object.getSystemMetadata().getObjectName());
 object.getContentMetadata().setPath(path);
 object.getContentMetadata().setUri(uri);
 object.getAllHeaders().putAll(from.getHeaders());
 object.setPayload(from.getPayload());
 object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from));
 return object;
}
origin: io.cloudsoft.jclouds.api/atmos

/**
* First, calls {@link ParseSystemAndUserMetadataFromHeaders}.
* 
* Then, sets the object size based on the Content-Length header and adds the content to the
* {@link AtmosObject} result.
* 
* @throws org.jclouds.http.HttpException
*/
public AtmosObject apply(HttpResponse from) {
 checkNotNull(from, "http response");
 AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from));
 object.getContentMetadata().setName(object.getSystemMetadata().getObjectName());
 object.getContentMetadata().setPath(path);
 object.getContentMetadata().setUri(uri);
 object.getAllHeaders().putAll(from.getHeaders());
 object.setPayload(from.getPayload());
 object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from));
 return object;
}
origin: com.amysta.jclouds.api/atmos

/**
* First, calls {@link ParseSystemAndUserMetadataFromHeaders}.
* 
* Then, sets the object size based on the Content-Length header and adds the content to the
* {@link AtmosObject} result.
* 
* @throws org.jclouds.http.HttpException
*/
public AtmosObject apply(HttpResponse from) {
 checkNotNull(from, "http response");
 AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from));
 object.getContentMetadata().setName(object.getSystemMetadata().getObjectName());
 object.getContentMetadata().setPath(path);
 object.getContentMetadata().setUri(uri);
 object.getAllHeaders().putAll(from.getHeaders());
 object.setPayload(from.getPayload());
 object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from));
 return object;
}
org.jclouds.atmos.domainAtmosObjectgetSystemMetadata

Popular methods of AtmosObject

  • getContentMetadata
  • getPayload
  • getUserMetadata
  • setPayload
  • getAllHeaders
  • setAllHeaders

Popular in Java

  • Parsing JSON documents to java classes using gson
  • compareTo (BigDecimal)
  • startActivity (Activity)
  • setRequestProperty (URLConnection)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • From CI to AI: The AI layer in your organization
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