2362N/A * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. 1313N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1313N/A * This code is free software; you can redistribute it and/or modify it 1313N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 1313N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 1313N/A * This code is distributed in the hope that it will be useful, but WITHOUT 1313N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1313N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1313N/A * version 2 for more details (a copy is included in the LICENSE file that 1313N/A * You should have received a copy of the GNU General Public License version 1313N/A * 2 along with this work; if not, write to the Free Software Foundation, 1313N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 1313N/A * Main class of the HTTP traffic capture tool. 1313N/A * Captures are triggered by the sun.net.http.captureRules system property. 1313N/A * If set, it should point to a file containing the capture rules. 1313N/A * Format for the file is simple: 1313N/A * - Lines starting with a # are considered comments and ignored 1313N/A * - a rule is a pair of a regular expression and file pattern, separated by a comma 1313N/A * - The regular expression is applied to URLs, if it matches, the traffic for 1313N/A * that URL will be captured in the associated file. 1313N/A * - if the file name contains a '%d', then that sequence will be replaced by a 1313N/A * unique random number for each URL. This allow for multi-threaded captures 1313N/A * of URLs matching the same pattern. 1313N/A * - Rules are checked in sequence, in the same order as in the file, until a 1313N/A * match is found or the end of the list is reached. 1313N/A * www\.sun\.com , sun%d.log 1313N/A * yahoo\.com\/.*asf , yahoo.log 1313N/A // skip line if it's a comment