Package com.google.appengine.api.datastore

Examples of com.google.appengine.api.datastore.Blob


                entity = ds.get(key);
            } catch (EntityNotFoundException e) {
                // Ok, we were a bit optimistic; we'll create a new one later
            }
            if (entity != null) {
                Blob blob = (Blob) entity.getProperty(PROPERTY_DATA);
                serializedAC = blob.getBytes();
                // bring it to memcache
                memcache.put(AC_BASE + session.getId(), serializedAC,
                        Expiration.byDeltaSeconds(session
                                .getMaxInactiveInterval()),
                        MemcacheService.SetPolicy.ADD_ONLY_IF_NOT_PRESENT);
View Full Code Here


    byte[] content = Utilities.getFile(this.URL);
    if (content != null) {
      Document d = Utilities.getXMLFromString(content);
      Long t = getMarketTime(d);
      this.timestamp = t;
      this.filecontent = new Blob(content);
      this.lastretrieved = (new Date()).getTime();
    } else {
      this.filecontent = null;
      this.lastretrieved = (long) 0;
      this.timestamp = (long) 0;
View Full Code Here

      if (file == null) {
        print("Cound not retrieve CSV file:" + url);
        return false;
      }

      this.fileCSV = new Blob(file);
      this.lastretrievedCSV = now;
    } else {
      print("Cached:" + this.id);

      print("Cached:" + DateFormat.getDateTimeInstance().format(this.lastretrievedCSV));
View Full Code Here

      if (file == null) {
        print("Cound not retrieve XML file:" + url);
        return false;
      }

      this.fileXML = new Blob(file);
      this.lastretrievedXML = now;
    }
    return true;
  }
View Full Code Here

      if (file == null) {
        print("Cound not retrieve Trades file:" + url);
        return false;
      }

      this.fileTrades = new Blob(file);
      this.lastretrievedTrades = now;
    }
    return true;
  }
View Full Code Here

    }
  }

  private boolean fetchTradesForContract(String contractid) {

    Blob b = storeTradesfile(contractid);
    boolean fetchedTrades = fetchContractTrades(b, contractid);
    if (!fetchedTrades) {
      return true;

    }
View Full Code Here

            memcache.put(id, bytes, expires);

            DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
            Entity entity = new Entity(AC_BASE, id);
            entity.setProperty(PROPERTY_EXPIRES, expire.getTime());
            entity.setProperty(PROPERTY_DATA, new Blob(bytes));
            ds.put(entity);

        } catch (DeadlineExceededException e) {
            getLogger().log(Level.WARNING, "DeadlineExceeded for {0}",
                    session.getId());
View Full Code Here

                entity = ds.get(key);
            } catch (EntityNotFoundException e) {
                // Ok, we were a bit optimistic; we'll create a new one later
            }
            if (entity != null) {
                Blob blob = (Blob) entity.getProperty(PROPERTY_DATA);
                serializedAC = blob.getBytes();
                // bring it to memcache
                memcache.put(
                        AC_BASE + session.getId(),
                        serializedAC,
                        Expiration
View Full Code Here

  private byte[] fromEntity(Entity entity) {
    assert entity != null;
    if (entity.hasProperty(PROPERTY_CONTENTS) == false) {
      return null;
    }
    Blob contents = (Blob) entity.getProperty(PROPERTY_CONTENTS);
    return contents.getBytes();
  }
View Full Code Here

  private Entity toEntity(String path, byte[] contents) {
    assert path != null;
    assert contents != null;
    Key key = createKey(path);
    Entity entity = new Entity(key);
    entity.setUnindexedProperty(PROPERTY_CONTENTS, new Blob(contents));
    entity.setUnindexedProperty(PROPERTY_VERSION, CURRENT_VERSION);
    return entity;
  }
View Full Code Here

TOP

Related Classes of com.google.appengine.api.datastore.Blob

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.