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

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

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

origin: jclouds/legacy-jclouds

  @Override
  public <R extends HttpRequest> R bindToRequest(R request, Object input) {
   checkArgument(checkNotNull(input, "input") instanceof AtmosObject, "this binder is only valid for AtmosObject!");
   checkNotNull(request, "request");

   AtmosObject object = AtmosObject.class.cast(input);
   checkNotNull(object.getPayload(), "object payload");
   checkArgument(object.getPayload().getContentMetadata().getContentLength() != null,
      "contentLength must be set, streaming not supported");
   return metaBinder.bindToRequest(request, object.getUserMetadata());
  }
}
origin: org.jclouds.api/atmos

  @Override
  public <R extends HttpRequest> R bindToRequest(R request, Object input) {
   checkArgument(checkNotNull(input, "input") instanceof AtmosObject, "this binder is only valid for AtmosObject!");
   checkNotNull(request, "request");

   AtmosObject object = AtmosObject.class.cast(input);
   checkNotNull(object.getPayload(), "object payload");
   checkArgument(object.getPayload().getContentMetadata().getContentLength() != null,
      "contentLength must be set, streaming not supported");
   return metaBinder.bindToRequest(request, object.getUserMetadata());
  }
}
origin: jclouds/legacy-jclouds

 public UserMetadata apply(BlobMetadata from) {
   return blob2ObjectInfo.apply(from).getUserMetadata();
 }
}, userExecutor);
origin: apache/jclouds

  @Override
  public <R extends HttpRequest> R bindToRequest(R request, Object input) {
   checkArgument(checkNotNull(input, "input") instanceof AtmosObject, "this binder is only valid for AtmosObject!");
   checkNotNull(request, "request");

   AtmosObject object = AtmosObject.class.cast(input);
   checkNotNull(object.getPayload(), "object payload");
   checkArgument(object.getPayload().getContentMetadata().getContentLength() != null,
      "contentLength must be set, streaming not supported");
   byte[] contentMD5 = object.getContentMetadata().getContentMD5();
   if (contentMD5 != null) {
     request = (R) request.toBuilder()
        .addHeader(AtmosHeaders.CHECKSUM, "MD5/0/" +
           BaseEncoding.base16().encode(contentMD5))
        .build();
   }
   return metaBinder.bindToRequest(request, object.getUserMetadata());
  }
}
origin: io.cloudsoft.jclouds.api/atmos

  @Override
  public <R extends HttpRequest> R bindToRequest(R request, Object input) {
   checkArgument(checkNotNull(input, "input") instanceof AtmosObject, "this binder is only valid for AtmosObject!");
   checkNotNull(request, "request");

   AtmosObject object = AtmosObject.class.cast(input);
   checkNotNull(object.getPayload(), "object payload");
   checkArgument(object.getPayload().getContentMetadata().getContentLength() != null,
      "contentLength must be set, streaming not supported");
   byte[] contentMD5 = object.getContentMetadata().getContentMD5();
   if (contentMD5 != null) {
     request = (R) request.toBuilder()
        .addHeader(AtmosHeaders.CHECKSUM, "MD5/0/" +
           BaseEncoding.base16().encode(contentMD5))
        .build();
   }
   return metaBinder.bindToRequest(request, object.getUserMetadata());
  }
}
origin: com.amysta.jclouds.api/atmos

  @Override
  public <R extends HttpRequest> R bindToRequest(R request, Object input) {
   checkArgument(checkNotNull(input, "input") instanceof AtmosObject, "this binder is only valid for AtmosObject!");
   checkNotNull(request, "request");

   AtmosObject object = AtmosObject.class.cast(input);
   checkNotNull(object.getPayload(), "object payload");
   checkArgument(object.getPayload().getContentMetadata().getContentLength() != null,
      "contentLength must be set, streaming not supported");
   byte[] contentMD5 = object.getContentMetadata().getContentMD5();
   if (contentMD5 != null) {
     request = (R) request.toBuilder()
        .addHeader(AtmosHeaders.CHECKSUM, "MD5/0/" +
           BaseEncoding.base16().encode(contentMD5))
        .build();
   }
   return metaBinder.bindToRequest(request, object.getUserMetadata());
  }
}
origin: org.apache.jclouds.api/atmos

  @Override
  public <R extends HttpRequest> R bindToRequest(R request, Object input) {
   checkArgument(checkNotNull(input, "input") instanceof AtmosObject, "this binder is only valid for AtmosObject!");
   checkNotNull(request, "request");

   AtmosObject object = AtmosObject.class.cast(input);
   checkNotNull(object.getPayload(), "object payload");
   checkArgument(object.getPayload().getContentMetadata().getContentLength() != null,
      "contentLength must be set, streaming not supported");
   byte[] contentMD5 = object.getContentMetadata().getContentMD5();
   if (contentMD5 != null) {
     request = (R) request.toBuilder()
        .addHeader(AtmosHeaders.CHECKSUM, "MD5/0/" +
           BaseEncoding.base16().encode(contentMD5))
        .build();
   }
   return metaBinder.bindToRequest(request, object.getUserMetadata());
  }
}
origin: Nextdoor/bender

  @Override
  public <R extends HttpRequest> R bindToRequest(R request, Object input) {
   checkArgument(checkNotNull(input, "input") instanceof AtmosObject, "this binder is only valid for AtmosObject!");
   checkNotNull(request, "request");

   AtmosObject object = AtmosObject.class.cast(input);
   checkNotNull(object.getPayload(), "object payload");
   checkArgument(object.getPayload().getContentMetadata().getContentLength() != null,
      "contentLength must be set, streaming not supported");
   byte[] contentMD5 = object.getContentMetadata().getContentMD5();
   if (contentMD5 != null) {
     request = (R) request.toBuilder()
        .addHeader(AtmosHeaders.CHECKSUM, "MD5/0/" +
           BaseEncoding.base16().encode(contentMD5))
        .build();
   }
   return metaBinder.bindToRequest(request, object.getUserMetadata());
  }
}
origin: jclouds/legacy-jclouds

public void testGood() {
 AtmosObject object = injector.getInstance(AtmosObject.Factory.class).create(null);
 Payload payload = Payloads.newStringPayload("");
 object.setPayload(payload);
 object.getUserMetadata().getListableMetadata().put("apple", "bear");
 object.getUserMetadata().getListableMetadata().put("sushi", "king");
 HttpRequest request = HttpRequest.builder().method("GET").endpoint("http://localhost").build();
 request = binder.bindToRequest(request, object);
 assertEquals(request.getFirstHeaderOrNull("x-emc-listable-meta"), "apple=bear,sushi=king");
}
origin: apache/jclouds

public void testGood() {
 AtmosObject object = injector.getInstance(AtmosObject.Factory.class).create(null);
 Payload payload = Payloads.newStringPayload("");
 object.setPayload(payload);
 object.getUserMetadata().getListableMetadata().put("apple", "bear");
 object.getUserMetadata().getListableMetadata().put("sushi", "king");
 HttpRequest request = HttpRequest.builder().method("GET").endpoint("http://localhost").build();
 request = binder.bindToRequest(request, object);
 assertEquals(request.getFirstHeaderOrNull("x-emc-listable-meta"), "apple=bear,sushi=king");
}
origin: jclouds/legacy-jclouds

  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);
   return to;
  }
}
origin: org.jclouds.api/atmos

  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);
   return to;
  }
}
origin: io.cloudsoft.jclouds.api/atmos

  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);
   return to;
  }
}
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: com.amysta.jclouds.api/atmos

  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: 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: apache/jclouds

for (Entry<String, String> entry : from.getUserMetadata().getMetadata().entrySet()) {
  String key = entry.getKey().toLowerCase();
  if (!systemMetadata.contains(key))
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: apache/jclouds

private void createOrReplaceObject(String name, Object data, HashCode hashCode, String metadataValue) throws Exception {
 // Test PUT with string data, ETag hash, and a piece of metadata
 AtmosObject object = getApi().newObject();
 object.getContentMetadata().setName(name);
 object.setPayload(Payloads.newPayload(data));
 object.getContentMetadata().setContentLength(16L);
 object.getContentMetadata().setContentMD5(hashCode.asBytes());
 object.getContentMetadata().setContentType("text/plain");
 object.getUserMetadata().getMetadata().put("Metadata", metadataValue);
 replaceObject(object);
}
origin: jclouds/legacy-jclouds

private void createOrReplaceObject(String name, Object data, String metadataValue) throws Exception {
 // Test PUT with string data, ETag hash, and a piece of metadata
 AtmosObject object = getApi().newObject();
 object.getContentMetadata().setName(name);
 object.setPayload(Payloads.newPayload(data));
 object.getContentMetadata().setContentLength(16l);
 Payloads.calculateMD5(object);
 object.getContentMetadata().setContentType("text/plain");
 object.getUserMetadata().getMetadata().put("Metadata", metadataValue);
 replaceObject(object);
}
org.jclouds.atmos.domainAtmosObjectgetUserMetadata

Popular methods of AtmosObject

  • getContentMetadata
  • getPayload
  • getSystemMetadata
  • setPayload
  • getAllHeaders
  • setAllHeaders

Popular in Java

  • Reactive rest calls using spring rest template
  • getContentResolver (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getExternalFilesDir (Context)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • ImageIO (javax.imageio)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top Vim plugins
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