Package com.google.appengine.api.blobstore

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


  @Test
  public void testImagesServiceFromBlob() throws IOException{
    BlobKey key = persistBlob();
   
    Image i = (Image) ImagesServiceFactory.makeImageFromBlob(new BlobKey("abc"));
    BlobInfo blobInfo = new BlobInfoFactory().loadBlobInfo(key);
    if( blobInfo != null && blobInfo.getSize() > 0){
      System.out.println("Exists");
    } else {
      System.out.println("Does not exist");
    }
View Full Code Here


    dh.clearAll();
   
    MemcacheServiceFactory.getMemcacheService().clearAll();
   
    Iterator<BlobInfo> infos = new BlobInfoFactory().queryBlobInfos();
    HashSet<BlobKey> toDelete = new HashSet<BlobKey>();
    while(infos.hasNext()){
      toDelete.add(infos.next().getBlobKey());
    }
    BlobstoreServiceFactory.getBlobstoreService().delete(toDelete.toArray(new BlobKey[]{}));
View Full Code Here

   
    return image;
  }

  private void checkBlobExists(BlobKey key){
    if(new BlobInfoFactory().loadBlobInfo(key) == null){
      throw new IllegalArgumentException("Blob does not exist for key: " + key.getKeyString());
    }
  }
View Full Code Here

        if (gsObjectName.contains("fake")) { //GCS Local File Upload Implementation is broken
            log.warning("Using hacked blobstore-gcs hybrid test because the local gcs implementation is broken");
            String blobKeyString = gsObjectName.substring(gsObjectName.indexOf("-") + 1, gsObjectName.lastIndexOf("-"));
            DatastoreService datastoreService = DatastoreServiceFactory.getDatastoreService();
            BlobInfoFactory blobInfoFactory = new BlobInfoFactory(datastoreService);
            mimeType = blobInfoFactory.loadBlobInfo(new BlobKey(blobKeyString)).getContentType();

            ByteArrayInputStream bais = new ByteArrayInputStream(BlobstoreServiceFactory.getBlobstoreService().fetchData(new BlobKey(blobKeyString), 0, BlobstoreService.MAX_BLOB_FETCH_SIZE - 1));
            IOUtils.copyStream(bais, outputStream);
            outputStream.write("_123".getBytes());
        } else {
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.