congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
CaptureSearchResult.getFile
Code IndexAdd Tabnine to your IDE (free)

How to use
getFile
method
in
org.archive.wayback.core.CaptureSearchResult

Best Java code snippets using org.archive.wayback.core.CaptureSearchResult.getFile (Showing top 20 results out of 315)

origin: iipc/openwayback

  public String serialize(CaptureSearchResult result) {
    String r = result.getFile();
    return r == null ? DEFAULT_VALUE : r;
  }
}
origin: org.netpreserve.openwayback/openwayback-core

  public String serialize(CaptureSearchResult result) {
    String r = result.getFile();
    return r == null ? DEFAULT_VALUE : r;
  }
}
origin: iipc/openwayback

@Override
public String getDuplicatePayloadFile() {
  return (revisitPayload != null) ? revisitPayload.getFile() : null;
}
origin: org.netpreserve.openwayback/openwayback-core

@Override
public String getDuplicatePayloadFile() {
  return (revisitPayload != null) ? revisitPayload.getFile() : null;
}
origin: iipc/openwayback

public int filterObject(CaptureSearchResult o) {
  final String file = o.getFile();
  for(String prefix : prefixes) {
    if(file.startsWith(prefix)) {
      return includeMatches ? FILTER_INCLUDE : FILTER_EXCLUDE;
    }
  }
  return includeMatches ? FILTER_EXCLUDE : FILTER_INCLUDE;
}
origin: org.netpreserve.openwayback/openwayback-core

public int filterObject(CaptureSearchResult o) {
  final String file = o.getFile();
  for(String prefix : prefixes) {
    if(file.startsWith(prefix)) {
      return includeMatches ? FILTER_INCLUDE : FILTER_EXCLUDE;
    }
  }
  return includeMatches ? FILTER_EXCLUDE : FILTER_INCLUDE;
}
origin: iipc/openwayback

  public int filterObject(CaptureSearchResult o) {
    final String file = o.getFile();
    for(Pattern pattern : patterns) {
      if(pattern.matcher(file).find()) {
        return FILTER_INCLUDE;
      }
    }
    return FILTER_EXCLUDE;
  }
}
origin: org.netpreserve.openwayback/openwayback-core

  public int filterObject(CaptureSearchResult o) {
    final String file = o.getFile();
    for(Pattern pattern : patterns) {
      if(pattern.matcher(file).find()) {
        return FILTER_INCLUDE;
      }
    }
    return FILTER_EXCLUDE;
  }
}
origin: iipc/openwayback

public int filterObject(CaptureSearchResult o) {
  if(!o.getFile().startsWith(matchPrefix)) {
    return FILTER_INCLUDE;
  }
  return o.getCaptureDate().compareTo(embargoDate) < 0 
    ? FILTER_INCLUDE : FILTER_EXCLUDE;
}

origin: org.netpreserve.openwayback/openwayback-core

public int filterObject(CaptureSearchResult o) {
  if(!o.getFile().startsWith(matchPrefix)) {
    return FILTER_INCLUDE;
  }
  return o.getCaptureDate().compareTo(embargoDate) < 0 
    ? FILTER_INCLUDE : FILTER_EXCLUDE;
}

origin: iipc/openwayback

  public int filterObject(CaptureSearchResult o) {
    if(o.getFile().equals(EMPTY_VALUE)
        || o.getMimeType().equals(REVISIT_VALUE)) {
      return annotate(o);
    }
    return remember(o);
  }
}
origin: org.netpreserve.openwayback/openwayback-core

  public int filterObject(CaptureSearchResult o) {
    if(o.getFile().equals(EMPTY_VALUE)
        || o.getMimeType().equals(REVISIT_VALUE)) {
      return annotate(o);
    }
    return remember(o);
  }
}
origin: org.netpreserve.openwayback/openwayback-core

public int filterObject(CaptureSearchResult o) {
  if(o.getFile().equals(EMPTY_VALUE)) {
    if(o.getDigest().equals(EMPTY_SHA1)) {
      return annotate(o);
    }
    return FILTER_INCLUDE;
  }
  return remember(o);
}
origin: iipc/openwayback

public int filterObject(CaptureSearchResult o) {
  if(o.getFile().equals(EMPTY_VALUE)) {
    if(o.getDigest().equals(EMPTY_SHA1)) {
      return annotate(o);
    }
    return FILTER_INCLUDE;
  }
  return remember(o);
}
origin: iipc/openwayback

@Override
public Resource retrieveResource(CaptureSearchResult result)
    throws ResourceNotAvailableException {
  try {
    PerfStats.timeStart(PerfStat.WArcResource);
    if (isSkipped(result.getFile())) {
      throw new ResourceNotAvailableException(
        "Revisit: Skipping already failed " + result.getFile());
    }
    try {
      return resourceStore.retrieveResource(result);
    } catch (ResourceNotAvailableException ex) {
      // Old code obtained archive filename via getDtails() method of
      // exception object, in the code handling SepcificCaptureReplayException.
      // Of two subclasses of SpecificCaptureReplayException, BadContentException
      // (only thrown from HttpHeaderOperation.copyHTTPMessageHeader()) never had
      // non-null details. So, this covers all cases, and more robust.
      addSkip(result.getFile());
      throw ex;
    }
   } finally {
     PerfStats.timeEnd(PerfStat.WArcResource);
   }
}
origin: iipc/openwayback

@Override
public boolean matches(Object actual) {
  // CaptureSearchResult is compared by file name and offset. this is
  // how AccessPoint#retrievePayloadForIdenticalContentRevisit(...)
  // retrieves previous capture.
  // TODO: this could be defined as CaptureSearchResult#equals(Object).
  if (!(actual instanceof CaptureSearchResult))
    return false;
  String file = ((CaptureSearchResult)actual).getFile();
  long offset = ((CaptureSearchResult)actual).getOffset();
  if (expected.getOffset() != offset)
    return false;
  return file == null ? expected.getFile() == null : file
    .equals(expected.getFile());
}
origin: iipc/openwayback

@Override
public void appendTo(StringBuffer buffer) {
  buffer.append("eqCaptureSearchResult(");
  buffer.append(expected.getFile());
  buffer.append(",");
  buffer.append(expected.getOffset());
  buffer.append(")");
}
origin: iipc/openwayback

/**
 * Mark this capture as a revisit of previous capture {@code payload}, identified by content digest.
 * <p>Record location information is copied from {@code payload} so that the content can be
 * loaded from the record later.</p>
 * <p>{@link ResourceIndex} implementations should call this method before returning
 * {@code CaptureSearchResult}s to {@code AccessPoint}.</p>
 * @param payload capture being revisited
 * @see #getDuplicateDigestStoredTimestamp()
 * @see #getDuplicateDigestStoredDate()
 * @see #getDuplicatePayloadFile()
 * @see #getDuplicatePayloadOffset()
 * @see #getDuplicatePayloadCompressedLength()
 */
public void flagDuplicateDigest(CaptureSearchResult payload) {
  flagDuplicateDigest();
  put(CAPTURE_DUPLICATE_STORED_TS, payload.getCaptureTimestamp());
  put(CAPTURE_DUPLICATE_PAYLOAD_FILE, payload.getFile());
  put(CAPTURE_DUPLICATE_PAYLOAD_OFFSET,
    String.valueOf(payload.getOffset()));
  if (payload.getCompressedLength() > 0) {
    put(CAPTURE_DUPLICATE_PAYLOAD_COMPRESSED_LENGTH,
      String.valueOf(payload.getCompressedLength()));
  }
}
origin: iipc/openwayback

private int annotate(CaptureSearchResult o) {
  if(lastSeen == null) {
    // TODO: log missing record digest reference
    return FILTER_EXCLUDE;
  }
  o.setFile(lastSeen.getFile());
  o.setOffset(lastSeen.getOffset());
  o.setDigest(lastSeen.getDigest());
  o.setHttpCode(lastSeen.getHttpCode());
  o.setMimeType(lastSeen.getMimeType());
  o.setRedirectUrl(lastSeen.getRedirectUrl());
  o.flagDuplicateHTTP(lastSeen.getCaptureTimestamp());
  return FILTER_INCLUDE;
}
origin: org.netpreserve.openwayback/openwayback-core

private int annotate(CaptureSearchResult o) {
  if(lastSeen == null) {
    // TODO: log missing record digest reference
    return FILTER_EXCLUDE;
  }
  o.setFile(lastSeen.getFile());
  o.setOffset(lastSeen.getOffset());
  o.setDigest(lastSeen.getDigest());
  o.setHttpCode(lastSeen.getHttpCode());
  o.setMimeType(lastSeen.getMimeType());
  o.setRedirectUrl(lastSeen.getRedirectUrl());
  o.flagDuplicateHTTP(lastSeen.getCaptureTimestamp());
  return FILTER_INCLUDE;
}
org.archive.wayback.coreCaptureSearchResultgetFile

Popular methods of CaptureSearchResult

  • <init>
  • setUrlKey
  • getOriginalUrl
  • setFile
  • setHttpCode
  • setMimeType
  • setOffset
  • setOriginalUrl
  • flagDuplicateDigest
    Mark this capture as a revisit of previous capture payload, identified by content digest.Record loca
  • getCaptureDate
  • getCaptureTimestamp
  • getDigest
  • getCaptureTimestamp,
  • getDigest,
  • getDuplicatePayload,
  • getDuplicatePayloadCompressedLength,
  • getDuplicatePayloadFile,
  • getDuplicatePayloadOffset,
  • getOffset,
  • getRobotFlags,
  • getUrlKey

Popular in Java

  • Reading from database using SQL prepared statement
  • findViewById (Activity)
  • setContentView (Activity)
  • compareTo (BigDecimal)
  • String (java.lang)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now