亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? commandlinebuilder.java

?? java覆蓋率測試工具
?? JAVA
字號:
/*
 * Cobertura - http://cobertura.sourceforge.net/
 *
 * Copyright (C) 2005 Grzegorz Lukasik
 *
 * Note: This file is dual licensed under the GPL and the Apache
 * Source License (so that it can be used from both the main
 * Cobertura classes and the ant tasks).
 *
 * Cobertura is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published
 * by the Free Software Foundation; either version 2 of the License,
 * or (at your option) any later version.
 *
 * Cobertura is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Cobertura; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 * USA
 */

package net.sourceforge.cobertura.util;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.Logger;

/**
 * Helper class for storing long command lines inside temporary file.
 * <p>
 * Typical usage:
 * 
 * <pre>
 *  builder = new CommandLineBuilder();
 *  builder.addArg(&quot;--someoption&quot;);
 *  builder.addArg(&quot;optionValue&quot;);
 *  ...
 *  builder.saveArgs();
 *  doSomething(builder.getCommandLineFile());
 *  builder.dispose();
 * </pre>
 * 
 * It will save options in <code>builder.getCommandLineFile()</code>. Options
 * will be stored one in a line. To retrieve options from file helper method can
 * be used (see documentation):
 * 
 * <pre>
 * String[] args = CommandLineBuilder.preprocessCommandLineArguments(args);
 * </pre>
 * 
 * </p>
 * 
 * <p>
 * NOTICE: No protection against line separators in arguments, should be OK for
 * Cobertura needs.
 * </p>
 * <p>
 * NOTICE: This class depends on local machine settings (line separator, default
 * encoding). If arguments are saved on different machine than they are loaded,
 * results are unspecified. No problem in Cobertura.
 * </p>
 * 
 * @author Grzegorz Lukasik
 */
public class CommandLineBuilder {
	private static final Logger logger = Logger
			.getLogger(CommandLineBuilder.class);

	private static final String LINESEP = System.getProperty("line.separator");

	// File that will be used to store arguments
	private File commandLineFile = null;

	// Writer that will be used to write arguments to the file
	private FileWriter commandLineWriter = null;

	/**
	 * Creates a new instance of the builder. Instances of this class should not
	 * be reused to create many command lines.
	 * 
	 * @throws IOException
	 *             if problems with creating temporary file for storing command
	 *             line occur
	 */
	public CommandLineBuilder() throws IOException {
		commandLineFile = File.createTempFile("cobertura.", ".cmdline");
		commandLineFile.deleteOnExit();
		commandLineWriter = new FileWriter(commandLineFile);
	}

	/**
	 * Adds command line argument. Each argument can be thought as a single cell
	 * in array passed to main method. This method should not be used after
	 * arguments were saved.
	 * 
	 * @param arg command line argument to save
	 * @throws IOException
	 *             if problems with temporary file occur
	 * @throws NullPointerException 
	 *             if <code>arg</code> is <code>null</code>            
	 */
	public void addArg(String arg) throws IOException {
		if( arg==null)
			throw new NullPointerException();
		commandLineWriter.write(arg + LINESEP);
	}

	
	/**
	 * Adds two command line arguments. Convienience function, calls
	 * {@link #addArg(String)} two times.   
	 * 
	 * @param arg1 first command line argument to save
	 * @param arg2 second command line argument to save
	 * @throws IOException
	 *             if problems with temporary file occur
	 * @throws NullPointerException 
	 *             if any <code>arg</code> is <code>null</code>            
	 */
    public void addArg(String arg1, String arg2) throws IOException {
        addArg(arg1);
        addArg(arg2);
    }

    
	/**
	 * Saves options and made file available to use. Use method
	 * {@link #getCommandLineFile} to get the file the arguments are saved in.
	 * 
	 * @throws IOException
	 *             if problems with temporary file occur
	 */
	public void saveArgs() throws IOException {
		commandLineWriter.flush();
		commandLineWriter.close();
	}

	/**
	 * Gets absolute path to the file with saved arguments. Notice, that however
	 * this method can be used as soon as an instance of this class is created,
	 * arguments should be read from the file after a call to
	 * {@link #saveArgs} method.
	 * 
	 * @return absolute path to the file with arguments
	 */
	public String getCommandLineFile() {
		return commandLineFile.getAbsolutePath();
	}

	/**
	 * Explicity frees all resources associated with this instance. Result of
	 * any other method call after disposing an instance of this class is
	 * unspecified.
	 */
	public void dispose() {
		commandLineFile.delete();
	}

	/**
	 * Loads arguments from file if <code>--commandsfile</code> option is used. Checks
	 * if passed array contains <code>--commandsfile</code> String, and if
	 * so arguments from file specified in the very next array cell are read. If
	 * there are more then one <code>--commandsfile</code> the result is unspecified. 
	 *
	 * @return The list of arguments read from commandsfile, or
	 *         <code>args</code> if commandsfile option was not specified
	 *         or the file cannot be read.
	 * @throws NullPointerException if args is null, or any argument is null
	 * @throws IllegalArgumentException if --commandsfile is specified as last option
	 * @throws IOException if I/O related error with temporary command line file occur
	 */
	public static String[] preprocessCommandLineArguments(String[] args) throws IOException {
		boolean hasCommandsFile = false;
		String commandsFileName = null;
		for (int i = 0; i < args.length; i++) {
			if ( args[i].equals( "--commandsfile")) {
				if( i==args.length-1) {
					throw new IllegalArgumentException("'--commandsfile' specified as last option.");
				}
				hasCommandsFile = true;
				commandsFileName = args[++i];
			}
		}

		if (hasCommandsFile) {
			List arglist = new ArrayList();
			BufferedReader bufferedReader = null;

			try {
				bufferedReader = new BufferedReader(new FileReader(
						commandsFileName));
				String line;

				while ((line = bufferedReader.readLine()) != null)
					arglist.add(line);

			} catch (IOException e) {
				logger.info( "I/O error when reading temporary commands file", e);
				throw new IOException( "Unable to read temporary commands file "
						+ commandsFileName + ".");
			} finally {
				if (bufferedReader != null) {
					try {
						bufferedReader.close();
					} catch (IOException e) {
					}
				}
			}

			args = (String[]) arglist.toArray(new String[arglist.size()]);
		}
		return args;
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人综合婷婷国产精品久久免费| 激情欧美一区二区| 亚洲国产精品综合小说图片区| 亚洲免费av在线| 亚洲国产美女搞黄色| 奇米一区二区三区av| 国产精品1024久久| 欧美男男青年gay1069videost | 99久久精品国产毛片| 欧美专区亚洲专区| 国产视频一区不卡| 亚洲成人免费观看| 成人精品视频一区| 日韩一区二区三| 国产精品不卡在线| 亚洲欧美成人一区二区三区| 秋霞国产午夜精品免费视频| 成人精品国产免费网站| 正在播放亚洲一区| 亚洲欧美日韩中文播放| 国内一区二区在线| 91精品国产色综合久久久蜜香臀| 国产精品人妖ts系列视频| 蜜桃视频一区二区三区| 在线观看www91| 亚洲精品老司机| 91亚洲精品久久久蜜桃网站| 日韩欧美国产一区二区三区 | 91网址在线看| 久久精品欧美日韩| 国产伦精品一区二区三区在线观看| 色乱码一区二区三区88 | 国产精华液一区二区三区| 日韩亚洲欧美成人一区| 亚洲成人三级小说| 日韩午夜av电影| 国产自产v一区二区三区c| 日韩欧美电影在线| 久久成人免费网站| 久久久久久久久久电影| 成人午夜又粗又硬又大| 欧美激情一区二区三区蜜桃视频 | 91精品国产综合久久久久久久| 亚洲小说春色综合另类电影| 欧美专区在线观看一区| 天天综合日日夜夜精品| 欧美夫妻性生活| 国产一区二区中文字幕| 国产精品久久久久一区二区三区| www.亚洲激情.com| 免费成人美女在线观看| 国产日韩欧美电影| 欧洲另类一二三四区| 麻豆精品在线视频| 一区二区三区鲁丝不卡| 日韩精品一区二区三区老鸭窝 | 亚洲少妇中出一区| 9i看片成人免费高清| 日韩精品电影一区亚洲| 国产精品免费免费| 欧美成人女星排行榜| www.性欧美| 国产精品1区2区3区在线观看| 亚洲自拍偷拍综合| 中文字幕一区在线观看视频| 欧美一区二区久久| 欧美日韩不卡一区| 在线观看亚洲精品| aaa国产一区| 99精品久久免费看蜜臀剧情介绍| 精品一区二区免费看| 秋霞影院一区二区| 日一区二区三区| 婷婷六月综合网| 三级亚洲高清视频| 日韩高清国产一区在线| 国产精品自拍av| 麻豆精品一区二区综合av| 日韩不卡一区二区三区| 亚洲国产三级在线| 日韩极品在线观看| 久久精品国产**网站演员| 久久国产乱子精品免费女| 美女视频免费一区| 精品在线观看免费| 国产成人午夜视频| 91论坛在线播放| 欧美日韩中文字幕精品| 欧美高清性hdvideosex| 欧美一个色资源| 国产精品久久久久久妇女6080| 日韩女优视频免费观看| 国产日韩欧美一区二区三区乱码 | 国产乱码精品一区二区三区忘忧草 | 国产婷婷精品av在线| 亚洲国产精品黑人久久久| 亚洲老妇xxxxxx| 蜜桃久久精品一区二区| 91麻豆.com| 久久人人超碰精品| 亚洲一区二区三区视频在线播放 | 成人激情小说网站| 欧美性生交片4| 久久精品男人的天堂| 亚洲国产你懂的| 国产寡妇亲子伦一区二区| 欧美性淫爽ww久久久久无| 久久久天堂av| 日韩高清在线一区| 波多野结衣91| 精品播放一区二区| 亚洲国产欧美日韩另类综合 | 国产精品久线观看视频| 免费成人在线视频观看| 91福利资源站| 中文字幕一区二区三区在线播放 | 国产欧美一区二区精品性色| 婷婷久久综合九色综合伊人色| 99这里只有久久精品视频| 久久网这里都是精品| 精品一区二区三区免费视频| 91久久久免费一区二区| 亚洲日本va午夜在线影院| 国产美女精品人人做人人爽| 91精品在线观看入口| 欧美a级一区二区| 91精品国产综合久久香蕉的特点| 亚洲一区二区三区视频在线播放| 色综合夜色一区| 亚洲精品一二三| 欧美三级三级三级| 亚洲精品免费播放| 亚洲国产一二三| 国产成人啪免费观看软件| 久久久亚洲精华液精华液精华液| 色婷婷av一区二区| 成人av影视在线观看| 精品一区二区三区影院在线午夜 | 国产精品亚洲午夜一区二区三区 | 亚洲一卡二卡三卡四卡无卡久久| 一本大道久久a久久综合婷婷| 亚洲欧美一区二区久久| 884aa四虎影成人精品一区| 国产伦精品一区二区三区免费| 中文字幕一区二区三区av| 欧美视频三区在线播放| 九九国产精品视频| 亚洲v日本v欧美v久久精品| 26uuu久久天堂性欧美| 不卡在线视频中文字幕| 国产激情一区二区三区| 久久电影网站中文字幕| 激情小说欧美图片| 久久国内精品视频| 免费高清视频精品| 亚洲成人一二三| 午夜久久久久久| 亚洲黄色免费网站| 国产欧美日韩中文久久| 精品免费国产二区三区 | 国产精品美女久久久久高潮| 日韩亚洲欧美在线| 精品污污网站免费看| 欧美性受xxxx黑人xyx性爽| 99在线精品免费| 成人黄色电影在线 | 一区二区三区在线视频免费观看| 亚洲精品一区二区三区蜜桃下载| 欧美二区三区91| 久久网这里都是精品| 综合中文字幕亚洲| 日韩中文字幕区一区有砖一区| 精品一区二区三区免费| 国产不卡在线播放| 国产福利一区二区三区视频在线 | 国产精品卡一卡二| 亚洲宅男天堂在线观看无病毒| 国内精品伊人久久久久影院对白| 欧美在线一二三四区| 国产精品日日摸夜夜摸av| 一区二区三区波多野结衣在线观看 | 国产 欧美在线| 色婷婷av一区二区三区之一色屋| 在线观看日韩毛片| 精品嫩草影院久久| 亚洲色图都市小说| 美女一区二区视频| 91色.com| 久久女同精品一区二区| 亚洲一级在线观看| 国产成人免费在线| 欧美婷婷六月丁香综合色| 欧美一区二区三区在| 国产亚洲欧洲一区高清在线观看| 国产精品久久久一区麻豆最新章节| 樱桃国产成人精品视频| 久久66热偷产精品| 91麻豆精品国产91久久久资源速度 | 亚洲综合激情另类小说区| 美国毛片一区二区三区|