Examples of ARCLocation


Examples of org.archive.io.arc.ARCLocation

    throws LiveDocumentNotAvailableException, IOException {
   
    Resource resource = null;
   
    LOGGER.info("Caching URL(" + url.toString() + ")");
    ARCLocation location = null;
    try {
      location = cacher.cache(arcCacheDir, url.toString());
    } catch(LiveDocumentNotAvailableException e) {
      // record the failure, so we can fail early next time:
      SearchResult result = forgeFailedSearchResult(url);
      index.addSearchResult(result);
      LOGGER.info("Added FAIL-URL(" + url.toString() + ") to LiveIndex");
      throw e;
    }
    if(location != null) {
      String name = location.getName();
      long offset = location.getOffset();
      LOGGER.info("Cached URL(" + url.toString() + ") in " +
          "ARC(" + name + ") at (" + offset + ")");
      resource = arcCacheDir.getResource(name, offset);
      // add the result to the index:
      if(resource instanceof ArcResource) {
View Full Code Here

Examples of org.archive.io.arc.ARCLocation

//    long newSize = writer.getPosition();
//    long oSize = writer.getFile().length();
    LOGGER.info("Wrote " + url + " at " + arcPath + ":" + arcOffset);
    fis.close();
   
    return new ARCLocation() {
      private String filename = arcPath;
      private long offset = arcOffset;

      public String getName() { return this.filename; }
View Full Code Here

Examples of org.archive.io.arc.ARCLocation

      tmpFile.delete();
      throw e;
    }
   
    // store URL
    ARCLocation location = null;
    ARCWriter writer = null;
    try {
      writer = cache.getWriter();
      location = storeFile(tmpFile, writer, urlString, method);
    } catch(IOException e) {
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.