Пример #1
0
  protected StringBuffer getContent() {
    StringBuffer sb;

    if (mLoadedPage != null) {
      StringBuffer outSB = mLoadedPage.getUncompressedData(false);
      if (outSB == null) outSB = new StringBuffer("mLoadedPage.getUncompressedData is null");
      sb = outSB;
    } else {
      JConfig.log().logDebug("mLoadedPage is null, returning the 'real' cached copy!");
      GZip gz = getRealContent();
      if (gz != null) {
        sb = gz.getUncompressedData();
        JConfig.log().logDebug("Turned the uncompressed data into a StringBuffer!");
        if (sb == null) JConfig.log().logDebug(" Failed to uncompress for id " + getIdentifier());
      } else {
        sb = new StringBuffer("Error getting real content.");
      }
    }
    return (sb);
  }
Пример #2
0
  private GZip loadFile(File fp) {
    GZip localZip = new GZip();

    if (fp.exists()) {
      //  Okay, I don't allow loading auction data that's over 512K.  Duh.
      if (fp.length() < 512 * 1024) {
        try {
          JConfig.log().logDebug("Loading from backing page (file is " + fp.length() + " bytes)!");
          localZip.load(fp);
        } catch (IOException ioe) {
          JConfig.log().handleException("Couldn't read " + fp.getName(), ioe);
          return null;
        }

        return localZip;
      } else {
        JConfig.log().logDebug("Can't load " + fp.getName() + ", file is too large.");
      }
    }
    return null;
  }
Пример #3
0
 @SuppressWarnings({"unchecked"})
 public static List<AuctionInfo> findLostAuctions() {
   List<AuctionInfo> resultSet;
   try {
     resultSet =
         (List<AuctionInfo>)
             findAllBySQL(
                 AuctionInfo.class,
                 "SELECT * FROM auctions WHERE identifier NOT IN (SELECT DISTINCT(identifier) FROM entries)");
   } catch (Exception e) {
     JConfig.log().handleDebugException("Failed to find lost auctions.", e);
     resultSet = null;
   }
   return resultSet;
 }