Package com.google.appengine.api.blobstore

Examples of com.google.appengine.api.blobstore.BlobInfoFactory


        e.printStackTrace();
      }
    }

    public void run(Request r) throws IOException {
      BlobInfoFactory bif = new BlobInfoFactory(
          DatastoreServiceFactory.getDatastoreService());
      Iterator<BlobInfo> i = bif.queryBlobInfos();
      List<BlobInfo> res = new ArrayList();
      // System.out.println("VIEW BLOB BEGIN");
      while (i.hasNext()) {
        BlobInfo bi = i.next();
        res.add(bi);
View Full Code Here


      QueueFactory.getQueue("blob").add(TaskOptions.Builder.withUrl("/tasks/blobstore").param("task", GoogleDocumentsTaskTypes.DELETE).param("blobKey", key));
    }
  }

  public static BlobInfo getBlobInfo(String key) {
    return new BlobInfoFactory().loadBlobInfo(new BlobKey(key));
  }
View Full Code Here

  public static OrphanBlob getOrphantBlobByKey(String blobKey){
    return new ObjectifyGenericDAO<OrphanBlob>(OrphanBlob.class).getByProperty("blobKey", blobKey);
  }
  public static String getMimeType(String key) {
    return new BlobInfoFactory().loadBlobInfo(new BlobKey(key)).getContentType();
  }
View Full Code Here

  }

  public static byte[] getMediaFromBlob(String key) {
    byte[] byteArray = null;
    BlobKey blobKey = new BlobKey(key);
    BlobInfo blobInfo = new BlobInfoFactory().loadBlobInfo(blobKey);
    BlobstoreInputStream stream;
    try {
      stream = new BlobstoreInputStream(blobKey);
      byteArray = new byte[(int) blobInfo.getSize()];
      stream.read(byteArray);
View Full Code Here

    this.shardCount = shardCount;
  }

  @Override
  public List<? extends InputReader<byte[]>> createReaders() {
    long blobSize = new BlobInfoFactory().loadBlobInfo(new BlobKey(blobKey)).getSize();
    return split(blobKey, blobSize, shardCount);
  }
View Full Code Here

      response.setStatus(HttpServletResponse.SC_NOT_FOUND);
      LOGGER.warning("No blob found by filename " + fileName);

    } else {

      final BlobInfo blobInfo = new BlobInfoFactory()
          .loadBlobInfo(blobKey);
      if (blobInfo != null && blobInfo.getSize() > 0) {
        // process blob
        this.blobstoreService.serve(blobKey, response);
      } else {
View Full Code Here

    try {

      final BlobstoreService blobstoreService = BlobstoreServiceFactory
          .getBlobstoreService();

      BlobInfo info = new BlobInfoFactory().loadBlobInfo(csvBlobKey);

      byte[] bytes = blobstoreService.fetchData(csvBlobKey, 0,
          info.getSize());

      final ZipInputStream zipIn = new ZipInputStream(
View Full Code Here

      final Map<String, List<BlobKey>> blobKeysValues = blobstoreService
          .getUploads(request);
      for (final Entry<String, List<BlobKey>> blobKeyValues : blobKeysValues
          .entrySet()) {
        for (final BlobKey blobKey : blobKeyValues.getValue()) {
          final BlobInfo blobInfo = new BlobInfoFactory()
              .loadBlobInfo(blobKey);
          final long size = blobInfo.getSize();
          if (size > 0) {
            // process blob
            parameters.put(blobKeyValues.getKey(), blobKey);
View Full Code Here

            return null;
        }
        BlobstoreService blobstoreService =
            BlobstoreServiceFactory.getBlobstoreService();
        BlobKey blobKey = new BlobKey(blobKeyString);
        BlobInfo blobInfo = new BlobInfoFactory().loadBlobInfo(blobKey);
        response.setContentType(blobInfo.getContentType());
        response.setContentLength((int) blobInfo.getSize());
        response.setHeader(
            "Content-disposition",
            "attachment;" + blobInfo.getFilename());
View Full Code Here

    AttachmentMetadata metadata = getMetadata(id);
    if (metadata == null) {
      throw NotFoundException.withInternalMessage("Attachment id unknown: " + id);
    }
    BlobKey key = metadata.getBlobKey();
    BlobInfo info = new BlobInfoFactory().loadBlobInfo(key);
    String disposition = "attachment; filename=\""
        // TODO(ohler): Investigate what escaping we need here, and whether the
        // blobstore service has already done some escaping that we need to undo
        // (it seems to do percent-encoding on " characters).
        + info.getFilename().replace("\"", "\\\"").replace("\\", "\\\\")
View Full Code Here

TOP

Related Classes of com.google.appengine.api.blobstore.BlobInfoFactory

Copyright © 2018 www.massapicom. 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.