Examples of Blob


Examples of org.apache.stanbol.enhancer.servicesapi.Blob

            includedContentPartList = new ArrayList<Map.Entry<UriRef,Blob>>();
            Set<String> ignoreContentPartUris = getIgnoredContentURIs(properties);
            nextContentPartEntry:
            for(Entry<UriRef,Blob> entry : getContentParts(ci,Blob.class).entrySet()){
                if(!ignoreContentPartUris.contains(entry.getKey().getUnicodeString())){
                    Blob blob = entry.getValue();
                    MediaType blobMediaType = MediaType.valueOf(blob.getMimeType());
                    for(MediaType included : includeMediaTypes) {
                        if(blobMediaType.isCompatible(included)){
                            includedContentPartList.add(entry);
                            continue nextContentPartEntry;
                        }
View Full Code Here

Examples of org.b3log.latke.repository.Blob

                                  HttpServletResponse.SC_BAD_REQUEST,
                                  fail, cause);
                        return;
                    }

                    final Blob blob = new Blob(contentBytes);
                    final JSONObject file = new JSONObject();
                    final String id = Ids.genTimeMillisId();
                    file.put(Keys.OBJECT_ID, id);

                    file.put(File.FILE_CONTENT_TYPE, item.getContentType());
View Full Code Here

Examples of org.cruxframework.crux.core.client.file.Blob

          @Override
          public void onSuccess(IDBObjectRetrieveEvent event)
          {
            try
            {
              Blob file = event.getObject().cast();
              callback.onSuccess(file);
              callback.setDb(null);
            }
            catch (Exception e)
            {
View Full Code Here

Examples of org.eclipse.egit.github.core.Blob

        } catch (IOException e) {
          debug("Exception closing stream", e);
        }
    }

    Blob blob = new Blob().setEncoding(ENCODING_BASE64);
    String encoded = EncodingUtils.toBase64(output.toByteArray());
    blob.setContent(encoded);

    try {
      if (isDebug())
        debug(MessageFormat.format("Creating blob from {0}",
            file.getAbsolutePath()));
View Full Code Here

Examples of org.jboss.capedwarf.server.api.io.Blob

            return true;

        if (value instanceof Blob == false)
            return false;

        Blob blob = (Blob) value;
        byte[] bytes = blob.getBytes();
        int length = bytes.length;
        return length >= min && length <= max;
    }
View Full Code Here

Examples of org.jbpm.lob.Blob

    if (blob==null) return null;
    return blob.extractBytes();
  }

  public void setObject(Object value) {
    this.blob = new Blob((byte[])value);
  }
View Full Code Here

Examples of org.jclouds.blobstore.domain.Blob

        @Override
        public Map.Entry<Integer , byte[]> call () throws Exception {
            byte[] data = mByteCache.getIfPresent(mBucketId);
            if (data == null) {
                // long time = System.currentTimeMillis();
                Blob blob = mStore.getBlob(mContainerName, Integer.toString(mBucketId));
                if (blob == null) {
                    data = new byte[SIZE_PER_BUCKET];
                    // // DEBUG CODE
                    // download.write(Integer.toString(mBucketId) + ", empty, "
                    // + (System.currentTimeMillis() - time) + "\n");
                    // download.flush();
                } else {
                    data = ByteStreams.toByteArray(blob.getPayload().getInput());
                    // download.write(Integer.toString(mBucketId) + "," +
                    // data.length + " , "
                    // + (System.currentTimeMillis() - time) + "\n");
                    // download.flush();
                    while (data.length < SIZE_PER_BUCKET) {
                        blob = mStore.getBlob(mContainerName, Integer.toString(mBucketId));
                        data = ByteStreams.toByteArray(blob.getPayload().getInput());
                        // // DEBUG CODE
                        // download.write(Integer.toString(mBucketId) + "," +
                        // data.length + " , "
                        // + (System.currentTimeMillis() - time) + "\n");
                        // download.flush();
View Full Code Here

Examples of org.jclouds.blobstore.representations.Blob

      BlobStore blobStore = getBlobStore();
      blobStore.createContainerInLocation(null, "container");
      blobStore.createDirectory("container", "one");

      blobStore.putBlob("container", blobStore.blobBuilder("myblob").payload("testcontent").build());
      Blob representation = ToBlob.INSTANCE.apply(blobStore.getBlob("container", "myblob"));
      assertNotNull(representation);
      assertNotNull(representation.getBlobMetadata());
   }
View Full Code Here

Examples of org.lilyproject.repository.api.Blob

        // TODO do we want the mediatype to include the parameters?
        String mediaType = headers.getMediaType().getType() + "/" + headers.getMediaType().getSubtype();

        long length = Long.parseLong(lengthHeader);
        Blob blob = new Blob(mediaType, length, null);

        if (length == 0 && is == null) {
            // Apparently when the length is 0, no InputStream is provided, therefore the following
            is = new NullInputStream(0);
        }
View Full Code Here

Examples of org.nuxeo.ecm.core.api.Blob

        if (!ARTICLE_TYPE.equals(doc.getType())) {
            return;
        }

        Blob image = (Blob) doc.getPropertyValue(CONTENT_PICTURE_PICTURE_PROPERTY);
        if (image == null) {
            return;
        }

        ImagingService service;
        try {
            service = Framework.getService(ImagingService.class);
        } catch (Exception e) {
            throw new ClientException("Failed to get ImagingService", e);
        }

        ImageInfo info = service.getImageInfo(image);
        int width = info.getWidth();
        int height = info.getHeight();
        float wScale = (float) RESIZED_IMAGE_WIDTH / width;
        float hscale = (float) RESIZED_IMAGE_HEIGHT / height;
        float scale = Math.min(wScale, hscale);

        if (scale < 1) {
            image = service.resize(image, "jpg", (int) (width * scale),
                    (int) (height * scale), info.getDepth());
            image.setMimeType("image/jpeg"); // XXX : Should be automatic
            doc.setPropertyValue(CONTENT_PICTURE_PICTURE_PROPERTY,
                    (Serializable) image);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.