APIdia Launch Partner
Top Description Fields Constructors Methods
sun.net.www.http

public Class HttpCapture

extends Object
Class Inheritance
Imports
java.io.*, java.util.ArrayList, java.util.regex.*, sun.net.NetProperties, sun.util.logging.PlatformLogger

Main class of the HTTP traffic capture tool. Captures are triggered by the sun.net.http.captureRules system property. If set, it should point to a file containing the capture rules. Format for the file is simple: - 1 rule per line - Lines starting with a # are considered comments and ignored - a rule is a pair of a regular expression and file pattern, separated by a comma - The regular expression is applied to URLs, if it matches, the traffic for that URL will be captured in the associated file. - if the file name contains a '%d', then that sequence will be replaced by a unique random number for each URL. This allow for multi-threaded captures of URLs matching the same pattern. - Rules are checked in sequence, in the same order as in the file, until a match is found or the end of the list is reached. Examples of rules: www\.sun\.com , sun%d.log yahoo\.com\/.*asf , yahoo.log
Author
jccollet

Field Summary

Modifier and TypeField and Description
private static volatile ArrayList<String>
private final File
private boolean
private static boolean
private BufferedWriter
private static volatile ArrayList<Pattern>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public synchronized void
public static HttpCapture
private static synchronized void
init()

private static synchronized boolean
public synchronized void
received(int c)

public synchronized void
sent(int c)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

capFilesback to summary
private static volatile ArrayList<String> capFiles
fileback to summary
private final File file
incomingback to summary
private boolean incoming
initializedback to summary
private static boolean initialized
outback to summary
private BufferedWriter out
patternsback to summary
private static volatile ArrayList<Pattern> patterns

Constructor Detail

HttpCaptureback to summary
private HttpCapture(File f, URL url)

Method Detail

flushback to summary
public synchronized void flush() throws IOException
getCaptureback to summary
public static HttpCapture getCapture(URL url)
initback to summary
private static synchronized void init()
isInitializedback to summary
private static synchronized boolean isInitialized()
receivedback to summary
public synchronized void received(int c) throws IOException
sentback to summary
public synchronized void sent(int c) throws IOException