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

  • Start an intent from android
  • getResourceAsStream (ClassLoader)
  • addToBackStack (FragmentTransaction)
  • scheduleAtFixedRate (Timer)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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