Tabnine Logo
RecordingInputStream.getMessageBodyReplayInputStream
Code IndexAdd Tabnine to your IDE (free)

How to use
getMessageBodyReplayInputStream
method
in
org.archive.io.RecordingInputStream

Best Java code snippets using org.archive.io.RecordingInputStream.getMessageBodyReplayInputStream (Showing top 8 results out of 315)

origin: internetarchive/heritrix3

/**
  Copies a resource into a file.
  A temporary file is created and then atomically renamed to
  the destination file.
  This prevents leaving a partial file in case of a crash.
  @param recis the RecordingInputStream that recorded the contents
  of the resource
  @param dest the destination file
  @throws IOException on I/O error
  @throws IOException if
  the file rename fails
*/
private void writeToPath(RecordingInputStream recis, File dest)
  throws IOException {
  File tf = new File (dest.getPath() + "N");
  ReplayInputStream replayis = null;
  FileOutputStream fos = null;
  try {
    replayis = recis.getMessageBodyReplayInputStream();
    fos = new FileOutputStream(tf);
    replayis.readFullyTo(fos);
  } finally {
    IOUtils.closeQuietly(replayis);
    IOUtils.closeQuietly(fos);
  }
  if (!tf.renameTo(dest)) {
    throw new IOException("Can not rename " + tf.getAbsolutePath()
               + " to " + dest.getAbsolutePath());
  }
}
origin: iipc/webarchive-commons

/**
 * Get a raw replay of the 'message-body'. For the common case of 
 * HTTP, this is the raw, possibly chunked-transfer-encoded message 
 * contents not including the leading headers. 
 * 
 * @return A replay input stream.
 * @throws IOException
 */
public ReplayInputStream getMessageBodyReplayInputStream() throws IOException {
  return getRecordedInput().getMessageBodyReplayInputStream();
}

origin: org.netpreserve.commons/commons-web

/**
 * Get a raw replay of the 'message-body'. For the common case of 
 * HTTP, this is the raw, possibly chunked-transfer-encoded message 
 * contents not including the leading headers. 
 * 
 * @return A replay input stream.
 * @throws IOException
 */
public ReplayInputStream getMessageBodyReplayInputStream() throws IOException {
  return getRecordedInput().getMessageBodyReplayInputStream();
}

origin: org.netpreserve.commons/webarchive-commons

/**
 * Get a raw replay of the 'message-body'. For the common case of 
 * HTTP, this is the raw, possibly chunked-transfer-encoded message 
 * contents not including the leading headers. 
 * 
 * @return A replay input stream.
 * @throws IOException
 */
public ReplayInputStream getMessageBodyReplayInputStream() throws IOException {
  return getRecordedInput().getMessageBodyReplayInputStream();
}

origin: org.netpreserve.commons/commons-web

/**
 * Get a raw replay of the 'entity'. For the common case of 
 * HTTP, this is the message-body after any (usually-unnecessary)
 * transfer-decoding but before any content-encoding (eg gzip) decoding
 * 
 * @return A replay input stream.
 * @throws IOException
 */
public InputStream getEntityReplayInputStream() throws IOException {
  if(inputIsChunked) {
    return new ChunkedInputStream(getRecordedInput().getMessageBodyReplayInputStream());
  } else {
    return getRecordedInput().getMessageBodyReplayInputStream();
  }
}

origin: org.netpreserve.commons/webarchive-commons

/**
 * Get a raw replay of the 'entity'. For the common case of 
 * HTTP, this is the message-body after any (usually-unnecessary)
 * transfer-decoding but before any content-encoding (eg gzip) decoding
 * 
 * @return A replay input stream.
 * @throws IOException
 */
public InputStream getEntityReplayInputStream() throws IOException {
  if(inputIsChunked) {
    return new ChunkedInputStream(getRecordedInput().getMessageBodyReplayInputStream());
  } else {
    return getRecordedInput().getMessageBodyReplayInputStream();
  }
}

origin: iipc/webarchive-commons

/**
 * Get a raw replay of the 'entity'. For the common case of 
 * HTTP, this is the message-body after any (usually-unnecessary)
 * transfer-decoding but before any content-encoding (eg gzip) decoding
 * 
 * @return A replay input stream.
 * @throws IOException
 */
public InputStream getEntityReplayInputStream() throws IOException {
  if(inputIsChunked) {
    return new ChunkedInputStream(getRecordedInput().getMessageBodyReplayInputStream());
  } else {
    return getRecordedInput().getMessageBodyReplayInputStream();
  }
}

origin: org.archive.heritrix/heritrix-modules

/**
  Copies a resource into a file.
  A temporary file is created and then atomically renamed to
  the destination file.
  This prevents leaving a partial file in case of a crash.
  @param recis the RecordingInputStream that recorded the contents
  of the resource
  @param dest the destination file
  @throws IOException on I/O error
  @throws IOException if
  the file rename fails
*/
private void writeToPath(RecordingInputStream recis, File dest)
  throws IOException {
  File tf = new File (dest.getPath() + "N");
  ReplayInputStream replayis = null;
  FileOutputStream fos = null;
  try {
    replayis = recis.getMessageBodyReplayInputStream();
    fos = new FileOutputStream(tf);
    replayis.readFullyTo(fos);
  } finally {
    IOUtils.closeQuietly(replayis);
    IOUtils.closeQuietly(fos);
  }
  if (!tf.renameTo(dest)) {
    throw new IOException("Can not rename " + tf.getAbsolutePath()
               + " to " + dest.getAbsolutePath());
  }
}
org.archive.ioRecordingInputStreamgetMessageBodyReplayInputStream

Popular methods of RecordingInputStream

  • getReplayInputStream
  • getSize
  • close
  • getResponseContentLength
  • isOpen
  • <init>
    Create a new RecordingInputStream.
  • clearForReuse
  • closeRecorder
  • getRecordedBufferLength
    Expose the amount of in-memory buffering used by the internal recording stream.
  • markContentBegin
  • open
  • read
  • open,
  • read,
  • chopAtMessageBodyBegin,
  • getContentBegin,
  • getDigestValue,
  • readFullyOrUntil,
  • readToEndOfContent,
  • setDigest,
  • setLimits

Popular in Java

  • Updating database using SQL prepared statement
  • putExtra (Intent)
  • setRequestProperty (URLConnection)
  • addToBackStack (FragmentTransaction)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • JCheckBox (javax.swing)
  • JTextField (javax.swing)
  • Top 25 Plugins for Webstorm
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