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

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

?? filesource.java

?? jcrontab是一個定時器開源項目包 目前提供存取文件或數據庫, 把執行結果寄發 email, 簡單地設置在 Tomcat, Resin, Jetty 及 JBoss 之上, 更是可以取代 cron
?? JAVA
字號:
/** *  This file is part of the jcrontab package *  Copyright (C) 2001-2003 Israel Olalla * *  This library is free software; you can redistribute it and/or *  modify it under the terms of the GNU Lesser General Public *  License as published by the Free Software Foundation; either *  version 2 of the License, or (at your option) any later version. * *  This library 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 *  Lesser General Public License for more details. * *  You should have received a copy of the GNU Lesser General Public *  License along with this library; if not, write to the Free *  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, *  MA 02111-1307, USA * *  For questions, suggestions: * *  iolalla@yahoo.com * */package org.jcrontab.data;import java.io.BufferedReader;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.InputStream;import java.io.InputStreamReader;import java.io.IOException;import java.io.OutputStream;import java.io.PrintStream;import java.io.Reader;import java.util.Vector;import org.jcrontab.Crontab;/** * This class Is the implementation of DataSource to access  * Info in a FileSystem * @author $Author: iolalla $ * @version $Revision: 1.43 $ */public class FileSource implements DataSource {		private CrontabParser cp = new CrontabParser();	private static FileSource instance;    	private CrontabEntryBean[] cachedBeans = null;		protected long lastModified;		private String crontab_file = "crontab";        /** 	* Creates new FileSource 	*/	    protected FileSource() {			if (Crontab.getInstance().getProperty(								"org.jcrontab.data.file") == null) 				Crontab.getInstance().setProperty(								"org.jcrontab.data.file", crontab_file);    }	    /**	 *	This method returns the singleton is very important to grant	 *  That only a Thread accesses at a time	 */    public synchronized DataSource getInstance() {		if (instance == null) {		instance = new FileSource();		}		return instance;    }	    /**	 *	This method searches the given Bean  from the File	 *  @return CrontabEntryBean beans Array the result of the search	 *  @param CrontabEntryBean the CrontabEntryBean you want to search	 *  @throws CrontabEntryException when it can't parse the line correctly	 *  @throws IOException If it can't access correctly to the File	 *  @throws DataNotFoundException whe it can't find nothing in the file 	 */    public synchronized CrontabEntryBean find(CrontabEntryBean ceb)     	throws CrontabEntryException, IOException, DataNotFoundException {        CrontabEntryBean[] cebra = findAll();		for (int i = 0; i < cebra.length ; i++) {			if (cebra[i].equals(ceb)) {//System.out.println("cebra encontrada : " + cebra[i]);				return cebra[i];			}		}		throw new DataNotFoundException("Unable to find :" + ceb);    }	protected InputStream createCrontabStream(String name)		throws IOException {		return new FileInputStream(name);	}	protected boolean isChanged(String name) {            // Don't like those three lines. But are the only way i have to grant            // It works in any O.S.		final File filez = new File(name);		if (lastModified != filez.lastModified()) {				// This line is added to avoid reading the file if it didn't 				// change			lastModified = filez.lastModified();			return true;		}		return false;	}   /**	 *	This method searches all the CrontabEntryBean from the File	 *  @return CrontabEntryBean beans Array the result of the search	 *  @throws CrontabEntryException when it can't parse the line correctly	 *  @throws IOException If it can't access correctly to the File	 *  @throws DataNotFoundException whe it can't find nothing in the file 	 */    public synchronized CrontabEntryBean[] findAll() throws CrontabEntryException, 			IOException, DataNotFoundException {                            boolean[] bSeconds = new boolean[60];            boolean[] bYears = new boolean[10];            	        Vector listOfLines = new Vector();            Vector listOfBeans = new Vector();            // Class cla = FileSource.class;            // BufferedReader input = new BufferedReader(new FileReader(strFileName));            // This Line allows the crontab to be included in a jar file            // and accessed from anywhere            String filename = Crontab.getInstance().getProperty("org.jcrontab.data.file");            			if (isChanged(filename)) {				// open the file				final InputStream fis = createCrontabStream(filename);				BufferedReader input = new BufferedReader(												new InputStreamReader(fis));								String strLine;								while((strLine = input.readLine()) != null){					//System.out.println(strLine);					strLine = strLine.trim();					listOfLines.add(strLine);				}				input.close();					if (listOfLines.size() > 0) {					for (int i = 0; i < listOfLines.size() ; i++) {						String strLines = (String)listOfLines.get(i);						// Skips blank lines and comments						if(strLines.equals("") || strLines.charAt(0) == '#'){						} else {						//System.out.println(strLines);						CrontabEntryBean entry = cp.marshall(strLines);                                                    cp.parseToken("*", bYears, false);                            entry.setBYears(bYears);                            entry.setYears("*");                                                    cp.parseToken("0", bSeconds, false);                            entry.setBSeconds(bSeconds);                            entry.setSeconds("0");                        						listOfBeans.add(entry);						}					}					} else {					throw new DataNotFoundException("No CrontabEntries available");					}                       	int sizeOfBeans = listOfBeans.size();				if ( sizeOfBeans == 0 ){					throw new DataNotFoundException("No CrontabEntries available");				} else {					CrontabEntryBean[] finalBeans = 						new CrontabEntryBean[sizeOfBeans];					for (int i = 0; i < sizeOfBeans; i++) {						//Added to have different Beans identified						finalBeans[i] = (CrontabEntryBean)listOfBeans.get(i);						finalBeans[i].setId(i);					}					cachedBeans = finalBeans;				}            }			if (cachedBeans != null) {				return cachedBeans;			} else {				throw  new DataNotFoundException("No CrontabEntries available");			}    	}		    /**	 *	This method removes the CrontabEntryBean array from the File	 *  @param CrontabEntryBean bean teh array of beans to remove	 *  @throws Exception 	 */	     public synchronized void remove(CrontabEntryBean[] ceb) throws Exception {	        CrontabEntryBean[] thelist = findAll();	    CrontabEntryBean[] result = new CrontabEntryBean[thelist.length - ceb.length];	    	    for (int i = 0; i < thelist.length ; i++) {		    if (thelist[i] != null ) thelist[i].setId(-1);		    for (int y = 0; y < ceb.length ; y++) {		    	   ceb[y].setId(-1);			    if (thelist[i] != null && thelist[i].equals(ceb[y])) {				    thelist[i] = null;			    } 		    } 	    }	    	    int resultCounter = 0;	    for (int i = 0; i < thelist.length ; i++) {		    if(thelist[i] != null) {			result[resultCounter] = thelist[i];			resultCounter++;	        }	    }            storeAll(result);	}    	/**	 *	This method saves the CrontabEntryBean array the actual problem with this	 *  method is that doesn?t store comments and blank lines from the original	 *  file any ideas?	 *  @param CrontabEntryBean bean this method stores the array of beans	 *  @throws CrontabEntryException when it can't parse the line correctly	 *  @throws IOException If it can't access correctly to the File	 *  @throws DataNotFoundException whe it can't find nothing in the file usually 	 *  Exception should'nt this 	 */    public synchronized void storeAll(CrontabEntryBean[] list) throws                CrontabEntryException, FileNotFoundException, IOException {		    File fl = new File(Crontab.getInstance()								.getProperty("org.jcrontab.data.file"));		    PrintStream out = new PrintStream(new FileOutputStream(fl));            for (int i = 0; i < list.length; i++){			if (list[i] != null) {		    			out.println("#");                			out.println(cp.unmarshall(list[i]));			}            }	    out.println("#");	}	/**	 *  This method saves the CrontabEntryBean array the actual problem with this	 *  method is that doesn?t store comments and blank lines from the original	 *  file any ideas?	 *  @param CrontabEntryBean bean this method stores the array of beans	 *  @throws CrontabEntryException when it can't parse the line correctly	 *  @throws IOException If it can't access correctly to the File	 *  @throws DataNotFoundException whe it can't find nothing in the file usually 	 *  Exception should'nt this 	 */	public synchronized void store(CrontabEntryBean[] beans) throws CrontabEntryException, 			IOException, DataNotFoundException {            CrontabEntryBean[]  thelist = null;	    boolean succedded = false;	    try {            thelist = findAll();	    succedded = true;	    } catch (Exception e) {		    if (e instanceof DataNotFoundException) {			    storeAll(beans);		    } else {		    throw new 		    	DataNotFoundException("Unable to find CrontabEntries");		    }	    }	    if (succedded) {		    int size = (thelist.length +1 );		    		    CrontabEntryBean[] resultlist = new CrontabEntryBean[size];		    Vector ve = new Vector();		    for (int i = 0; i < thelist.length; i++){			ve.add(thelist[i]);		    }				for (int i = 0; i < beans.length; i++) {					ve.add(beans[i]);				}		    for (int i = 0; i < ve.size(); i++){			resultlist[i] = (CrontabEntryBean)ve.get(i);		    }		    storeAll(resultlist);	    }	}		/**	 *	This method saves the CrontabEntryBean the actual problem with this	 *  method is that doesn?t store comments and blank lines from the original	 *  file any ideas?	 *  @param CrontabEntryBean bean this method only lets store an entryBean	 *  each time.	 *  @throws CrontabEntryException when it can't parse the line correctly	 *  @throws IOException If it can't access correctly to the File	 *  @throws DataNotFoundException whe it can't find nothing in the file usually 	 *  Exception should'nt this 	 */	public synchronized void store(CrontabEntryBean bean) throws CrontabEntryException, 			IOException, DataNotFoundException {            CrontabEntryBean[] thelist = null;	    boolean succedded = false;            try {            thelist = findAll();	    succedded = true;	    } catch (Exception e) {		    if (e instanceof DataNotFoundException) {			    CrontabEntryBean[] ilist = new CrontabEntryBean[1];			    ilist[0] = bean;			    storeAll(ilist);		    } else {		    throw new 		    	DataNotFoundException("Unable to find CrontabEntries");		    }	    }	    if (succedded) {		    int size = (thelist.length +1 );		    		    CrontabEntryBean[] resultlist = new CrontabEntryBean[size];		    Vector ve = new Vector();		    for (int i = 0; i < thelist.length; i++){			ve.add(thelist[i]);		    }		    ve.add(bean);		    for (int i = 0; i < ve.size(); i++){			resultlist[i] = (CrontabEntryBean)ve.get(i);		    }		    storeAll(resultlist);	    }	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国精品国产尤物美女| 亚洲免费资源在线播放| 亚洲人成人一区二区在线观看| 亚洲国产精品久久人人爱| 国产精品影视天天线| 国产精品色一区二区三区| 亚瑟在线精品视频| 97超碰欧美中文字幕| 日韩欧美美女一区二区三区| 亚洲精品视频在线观看网站| 国内精品国产成人国产三级粉色| 欧美在线视频不卡| 国产精品卡一卡二卡三| 国产麻豆成人精品| 日韩欧美高清一区| 日产国产高清一区二区三区| 在线视频你懂得一区| 国产精品乱码一区二三区小蝌蚪| 国模娜娜一区二区三区| 欧美一级日韩不卡播放免费| 亚洲国产成人tv| 色哟哟在线观看一区二区三区| 亚洲国产高清不卡| 国产一区二区在线看| 欧美成人午夜电影| 免费三级欧美电影| 91精品国产91久久综合桃花 | 欧美一级夜夜爽| 亚洲一区电影777| 日本精品一区二区三区高清| 中文字幕在线免费不卡| 成人福利在线看| 国产精品网站在线播放| 成人自拍视频在线| 国产精品久久久久久久久免费桃花| 国产成人免费视频网站| 免费看欧美美女黄的网站| 欧美日本在线播放| 日韩高清在线电影| 精品蜜桃在线看| 国产高清在线观看免费不卡| 国产日韩视频一区二区三区| 成人精品在线视频观看| 中文字幕在线不卡一区| 在线免费不卡视频| 亚洲成人av电影| 日韩小视频在线观看专区| 精品一区二区三区av| 欧美激情一区二区三区不卡| 99国产一区二区三精品乱码| 一区二区三区精密机械公司| 欧美日韩在线免费视频| 久久丁香综合五月国产三级网站| 久久亚洲综合色一区二区三区| 国产精品系列在线播放| 亚洲日本丝袜连裤袜办公室| 欧美日韩大陆一区二区| 久久精品av麻豆的观看方式| 亚洲国产精品99久久久久久久久 | 精品影视av免费| 国产欧美日韩三级| 欧美揉bbbbb揉bbbbb| 极品瑜伽女神91| 亚洲欧洲精品成人久久奇米网| 欧洲激情一区二区| 久久精品国内一区二区三区| 国产精品人人做人人爽人人添| 在线区一区二视频| 国产在线视频不卡二| 亚洲码国产岛国毛片在线| 日韩欧美久久久| 91片黄在线观看| 六月婷婷色综合| 亚洲欧美综合在线精品| 在线播放91灌醉迷j高跟美女| 国产伦精品一区二区三区免费| 亚洲三级久久久| 久久免费精品国产久精品久久久久| 一本久久精品一区二区| 国产在线不卡视频| 亚洲国产一区二区三区青草影视 | 韩国精品免费视频| 亚洲视频在线一区二区| 亚洲成人免费影院| 国产女同互慰高潮91漫画| 欧美日韩精品欧美日韩精品一| 成人综合婷婷国产精品久久蜜臀 | 国产精品欧美久久久久无广告 | 久久香蕉国产线看观看99| 在线精品亚洲一区二区不卡| 国产精品自在在线| 奇米影视7777精品一区二区| 一区二区三区视频在线看| 欧美国产视频在线| 精品欧美乱码久久久久久| 欧美日韩成人综合天天影院| 91香蕉视频在线| 丁香天五香天堂综合| 国产精品亚洲成人| 精品亚洲成av人在线观看| 手机精品视频在线观看| 一区二区三区久久| 亚洲欧美日韩电影| 国产精品国产a级| 国产精品免费丝袜| 国产欧美精品日韩区二区麻豆天美| 日韩精品在线看片z| 日韩欧美色综合网站| 欧美一区二区不卡视频| 欧美日韩精品一区二区三区四区| 色又黄又爽网站www久久| 91日韩精品一区| 99re免费视频精品全部| 99久久综合精品| 99热精品一区二区| 97久久人人超碰| 色综合一个色综合亚洲| 色久优优欧美色久优优| 在线观看视频一区| 欧美视频一区二区三区| 欧美优质美女网站| 69堂亚洲精品首页| 欧美一区二区成人| 久久一区二区视频| 看片网站欧美日韩| 国产一区二区视频在线| 成人午夜大片免费观看| 99精品视频在线观看免费| 在线观看日韩一区| 欧美老女人第四色| 日韩欧美一区二区视频| 久久九九久久九九| 国产精品婷婷午夜在线观看| 亚洲欧美日韩久久精品| 性欧美疯狂xxxxbbbb| 久久激情五月激情| 成人免费高清在线观看| 色哟哟国产精品免费观看| 欧美日韩一二区| 日韩欧美国产午夜精品| 中文字幕乱码日本亚洲一区二区| 国产精品久久久久久久久免费樱桃 | 三级在线观看一区二区| 极品销魂美女一区二区三区| 国产99久久久国产精品潘金网站| 91在线国产观看| 欧美三级日韩在线| 久久婷婷国产综合精品青草| 《视频一区视频二区| 日韩激情中文字幕| 成人福利视频在线| 欧美日韩国产综合一区二区三区| 日韩你懂的电影在线观看| 国产精品美女一区二区| 天堂资源在线中文精品| 懂色av一区二区夜夜嗨| 在线不卡一区二区| 中文字幕高清不卡| 天堂一区二区在线| 成人禁用看黄a在线| 欧美一级黄色录像| 亚洲天堂免费看| 紧缚捆绑精品一区二区| 精品视频在线免费观看| 日本一区二区免费在线| 日韩av电影免费观看高清完整版 | 欧美综合色免费| 国产日韩三级在线| 毛片不卡一区二区| 欧美专区在线观看一区| 日本一区二区免费在线| 日韩国产一二三区| 在线观看免费成人| 中文字幕+乱码+中文字幕一区| 美女免费视频一区| 欧美网站大全在线观看| 国产精品污污网站在线观看| 久久97超碰国产精品超碰| 欧美日韩中文精品| 东方aⅴ免费观看久久av| 精品久久五月天| 舔着乳尖日韩一区| 91久久精品一区二区三区| 中文欧美字幕免费| 国产一区二区三区四区五区入口 | 欧美中文一区二区三区| 中文字幕在线观看一区| 国产精品99久久久| 久久午夜老司机| 激情成人综合网| 日韩欧美高清一区| 青青草一区二区三区| 欧美丰满嫩嫩电影| 午夜精品久久久久久久99水蜜桃| 91麻豆国产自产在线观看| 亚洲欧美国产77777| 色综合视频一区二区三区高清| 日本一区二区成人| 国产在线精品一区在线观看麻豆| 日韩欧美中文一区二区|