?? webapp.java
字號:
/*
* *****************************************************
* Copyright (c) 2005 IIM Lab. All Rights Reserved.
* Created by xuehao at 2005-10-12
* Contact: zxuehao@mail.ustc.edu.cn
* *****************************************************
*/
package org.indigo.application;
import java.io.File;
import java.util.List;
import org.indigo.commands.Command;
import org.indigo.commands.CompositeCommand;
import org.indigo.commands.RawCommand;
import org.indigo.log.FileLoggerParam;
import org.indigo.spider.Spider;
import org.indigo.spider.ThreadPool;
import org.indigo.util.TaskProperties;
import org.indigo.util.TaskListReader;
/**
* 控制臺應用程序。
* @author wbz
*
*/
public class WebApp
{
public WebApp()
{
String taskName=null;
List tasks = TaskListReader.getTaskList();
for( int i=0; i<tasks.size(); i++ )
{
String str=null;
taskName = (String) tasks.get( i );
File file = new File( taskName );
if( !file.exists() )
{
str = "TaskFile: " + taskName + " doesnot exists!";
FileLoggerParam.getInstance().warning( str );
continue ;
}else
{
}
Command cmd = null;
TaskProperties props = new TaskProperties();
props.open( taskName );
str = props.getProperty( "Nested" );
boolean bComp=false;
if( str==null )
bComp = false;
else
if( str.equalsIgnoreCase("true") || str.equals("") )
bComp = true;
else
bComp = false;
if( !bComp )
{
// System.out.println( "will create raw command "+taskName );
file = new File( taskName );
if( !file.exists() )
{
str = "TaskFile: " + taskName + " doesnot exists!";
FileLoggerParam.getInstance().warning( str );
continue ;
}else
{
cmd = new RawCommand( taskName, false, true );
}
}else
{
// System.out.println( "will create composite command "+taskName );
file = new File( taskName );
if( !file.exists() )
{
str = "TaskFile: " + taskName + " doesnot exists!";
FileLoggerParam.getInstance().warning( str );
continue ;
}else
{
cmd = new CompositeCommand( taskName, false, true );
}
}
// str = "Add Command " + cmd.getTaskName();
// FileLogger.getInstance().info( str );
// (new Spider(cmd)).start();
ThreadPool.getInstance().execute( new Spider(cmd) );
}
}
public static void main(String[] args)
{
WebApp app = new WebApp();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -