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

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

?? mrufilemanager.java

?? apache的log4j源碼
?? JAVA
字號:
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements.  See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License.  You may obtain a copy of the License at *  *      http://www.apache.org/licenses/LICENSE-2.0 *  * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */package org.apache.log4j.lf5.viewer.configure;import java.io.*;import java.net.URL;import java.util.Iterator;import java.util.LinkedList;/** * <p>MRUFileManager handles the storage and retrival the most * recently opened log files. * * @author Brad Marlborough * @author Richard Hurst */// Contributed by ThoughtWorks Inc.public class MRUFileManager {  //--------------------------------------------------------------------------  //   Constants:  //--------------------------------------------------------------------------  private static final String CONFIG_FILE_NAME = "mru_file_manager";  private static final int DEFAULT_MAX_SIZE = 3;  //--------------------------------------------------------------------------  //   Protected Variables:  //--------------------------------------------------------------------------  //--------------------------------------------------------------------------  //   Private Variables:  //--------------------------------------------------------------------------  private int _maxSize = 0;  private LinkedList _mruFileList;  //--------------------------------------------------------------------------  //   Constructors:  //--------------------------------------------------------------------------  public MRUFileManager() {    load();    setMaxSize(DEFAULT_MAX_SIZE);  }  public MRUFileManager(int maxSize) {    load();    setMaxSize(maxSize);  }  //--------------------------------------------------------------------------  //   Public Methods:  //--------------------------------------------------------------------------  /**   * Saves a list of MRU files out to a file.   */  public void save() {    File file = new File(getFilename());    try {      ObjectOutputStream oos = new ObjectOutputStream(new          FileOutputStream(file));      oos.writeObject(_mruFileList);      oos.flush();      oos.close();    } catch (Exception e) {      // do nothing      e.printStackTrace();    }  }  /**   * Gets the size of the MRU file list.   */  public int size() {    return _mruFileList.size();  }  /**   * Returns a particular file name stored in a MRU file   * list based on an index value.   */  public Object getFile(int index) {    if (index < size()) {      return _mruFileList.get(index);    }    return null;  }  /**   * Returns a input stream to the resource at the specified index   */  public InputStream getInputStream(int index) throws IOException,      FileNotFoundException {    if (index < size()) {      Object o = getFile(index);      if (o instanceof File) {        return getInputStream((File) o);      } else {        return getInputStream((URL) o);      }    }    return null;  }  /**   * Adds a file name to the MRU file list.   */  public void set(File file) {    setMRU(file);  }  /**   * Adds a url to the MRU file list.   */  public void set(URL url) {    setMRU(url);  }  /**   * Gets the list of files stored in the MRU file list.   */  public String[] getMRUFileList() {    if (size() == 0) {      return null;    }    String[] ss = new String[size()];    for (int i = 0; i < size(); i++) {      Object o = getFile(i);      if (o instanceof File) {        ss[i] = ((File) o).getAbsolutePath();      } else // must be a url      {        ss[i] = o.toString();      }    }    return ss;  }  /**   * Moves the the index to the top of the MRU List   *   * @param index The index to be first in the mru list   */  public void moveToTop(int index) {    _mruFileList.add(0, _mruFileList.remove(index));  }  /**   * Creates the directory where the MRU file list will be written.   * The "lf5" directory is created in the Documents and Settings   * directory on Windows 2000 machines and where ever the user.home   * variable points on all other platforms.   */  public static void createConfigurationDirectory() {    String home = System.getProperty("user.home");    String sep = System.getProperty("file.separator");    File f = new File(home + sep + "lf5");    if (!f.exists()) {      try {        f.mkdir();      } catch (SecurityException e) {        e.printStackTrace();      }    }  }  //--------------------------------------------------------------------------  //   Protected Methods:  //--------------------------------------------------------------------------  /**   * Gets an input stream for the corresponding file.   *   * @param file The file to create the input stream from.   * @return InputStream   */  protected InputStream getInputStream(File file) throws IOException,      FileNotFoundException {    BufferedInputStream reader =        new BufferedInputStream(new FileInputStream(file));    return reader;  }  /**   * Gets an input stream for the corresponding URL.   *   * @param url The url to create the input stream from.   * @return InputStream   */  protected InputStream getInputStream(URL url) throws IOException {    return url.openStream();  }  /**   * Adds an object to the mru.   */  protected void setMRU(Object o) {    int index = _mruFileList.indexOf(o);    if (index == -1) {      _mruFileList.add(0, o);      setMaxSize(_maxSize);    } else {      moveToTop(index);    }  }  /**   * Loads the MRU file list in from a file and stores it in a LinkedList.   * If no file exists, a new LinkedList is created.   */  protected void load() {    createConfigurationDirectory();    File file = new File(getFilename());    if (file.exists()) {      try {        ObjectInputStream ois = new ObjectInputStream(            new FileInputStream(file));        _mruFileList = (LinkedList) ois.readObject();        ois.close();        // check that only files and url are in linked list        Iterator it = _mruFileList.iterator();        while (it.hasNext()) {          Object o = it.next();          if (!(o instanceof File) && !(o instanceof URL)) {            it.remove();          }        }      } catch (Exception e) {        _mruFileList = new LinkedList();      }    } else {      _mruFileList = new LinkedList();    }  }  protected String getFilename() {    String home = System.getProperty("user.home");    String sep = System.getProperty("file.separator");    return home + sep + "lf5" + sep + CONFIG_FILE_NAME;  }  /**   * Ensures that the MRU list will have a MaxSize.   */  protected void setMaxSize(int maxSize) {    if (maxSize < _mruFileList.size()) {      for (int i = 0; i < _mruFileList.size() - maxSize; i++) {        _mruFileList.removeLast();      }    }    _maxSize = maxSize;  }  //--------------------------------------------------------------------------  //   Private Methods:  //--------------------------------------------------------------------------  //--------------------------------------------------------------------------  //   Nested Top-Level Classes or Interfaces  //--------------------------------------------------------------------------}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产盗摄精品一区二区三区在线| 欧美偷拍一区二区| 一本大道久久a久久综合| 日韩视频免费观看高清在线视频| 日韩一区日韩二区| 久久成人免费电影| 欧洲精品中文字幕| 国产精品女人毛片| 国产麻豆一精品一av一免费| 欧美一区二区免费| 亚洲第一av色| 日本精品免费观看高清观看| 国产欧美精品国产国产专区| 看片的网站亚洲| 欧美精品乱码久久久久久按摩| 成人欧美一区二区三区小说| 国产成人免费视频一区| 日韩一区二区三区免费看 | 91丨九色porny丨蝌蚪| 日韩免费看的电影| 亚洲一区二区精品3399| 91丝袜国产在线播放| 中文字幕制服丝袜一区二区三区 | 免费欧美高清视频| 欧美在线不卡视频| 一级特黄大欧美久久久| 色综合天天性综合| 日韩理论片中文av| 成人av高清在线| 国产精品伦理在线| 成人a免费在线看| 亚洲同性同志一二三专区| av激情成人网| 亚洲女女做受ⅹxx高潮| 91在线高清观看| 亚洲精品你懂的| 欧美三级视频在线观看| 亚洲高清一区二区三区| 欧美挠脚心视频网站| 视频在线观看一区| 久久免费偷拍视频| 老汉av免费一区二区三区| 日韩视频免费观看高清完整版在线观看| 亚洲1区2区3区4区| 欧美一级夜夜爽| 国内精品久久久久影院一蜜桃| 久久精品亚洲精品国产欧美| 国产成人av一区二区三区在线 | 亚洲综合999| 欧美电影在线免费观看| 热久久久久久久| 国产视频一区二区三区在线观看| 成人一区二区在线观看| 亚洲色图欧美激情| 在线91免费看| 国产在线播放一区| 国产精品久久毛片av大全日韩| 色88888久久久久久影院野外| 日韩主播视频在线| 国产视频一区二区三区在线观看| 91免费视频网| 日韩国产欧美在线视频| 国产欧美精品一区| 欧美色成人综合| 国产精品亚洲人在线观看| 自拍偷拍亚洲欧美日韩| 91精品国产综合久久福利软件 | 日本一区二区三区视频视频| 色一情一伦一子一伦一区| 日韩国产欧美在线观看| 中文字幕在线不卡一区| 欧美色倩网站大全免费| 国产精品1024久久| 秋霞av亚洲一区二区三| 亚洲人午夜精品天堂一二香蕉| 欧美精品aⅴ在线视频| 国产91丝袜在线播放九色| 亚洲一区二区视频在线| 国产日韩欧美激情| 欧美一区二区久久| 成人av在线资源网| 精油按摩中文字幕久久| 亚洲韩国精品一区| 国产欧美精品一区| 日韩欧美在线1卡| 色婷婷激情综合| 成人综合在线观看| 精品一区二区三区蜜桃| 亚洲第一会所有码转帖| 一色屋精品亚洲香蕉网站| 日韩色视频在线观看| 欧美日韩一级二级三级| 99re热这里只有精品免费视频| 精彩视频一区二区三区| 午夜视频在线观看一区二区| 国产精品视频免费| 久久久久久久久久电影| 日韩一区二区电影| 欧美日韩午夜在线| 色综合久久九月婷婷色综合| 国产成人精品免费网站| 麻豆成人免费电影| 日韩精品每日更新| 亚洲成人黄色影院| 亚洲与欧洲av电影| 最新日韩在线视频| 国产精品网站一区| 国产精品色哟哟| 国产精品久久一级| 国产色一区二区| 久久一日本道色综合| 久久网站最新地址| 久久精品一区二区三区不卡牛牛| 精品久久久久一区二区国产| 91精品在线观看入口| 精品视频999| 欧美精品v国产精品v日韩精品| 欧美日韩精品二区第二页| 欧美日韩激情在线| 欧美一区二区久久| 精品久久一区二区三区| 久久精品人人做| 国产精品日韩成人| 亚洲女女做受ⅹxx高潮| 亚洲第一在线综合网站| 午夜一区二区三区视频| 日韩电影在线看| 国模冰冰炮一区二区| 东方欧美亚洲色图在线| 成人激情综合网站| 日本韩国视频一区二区| 欧美日韩高清一区二区不卡| 日韩欧美三级在线| 精品国产一区二区三区久久久蜜月| 日韩精品一区二区三区在线播放 | 中文字幕一区二区三| 亚洲精品国产无天堂网2021 | 亚洲国产成人tv| 免费久久99精品国产| 国产酒店精品激情| 99国产精品视频免费观看| 欧美日韩中文另类| 精品国一区二区三区| 国产精品素人视频| 午夜精品影院在线观看| 国产一区二区在线观看视频| 99久久综合色| 欧美一区二区三区白人| 中文字幕av免费专区久久| 亚洲宅男天堂在线观看无病毒| 日本欧美一区二区三区乱码| 国产精品88888| 欧美亚州韩日在线看免费版国语版 | 日韩欧美黄色影院| 综合久久久久久久| 日韩电影免费在线观看网站| 高清日韩电视剧大全免费| 在线欧美一区二区| 2023国产精品自拍| 亚洲宅男天堂在线观看无病毒| 国产乱码精品一品二品| 日本韩国欧美三级| 久久亚洲免费视频| 亚洲不卡在线观看| 成人av在线影院| 久久只精品国产| 日韩经典中文字幕一区| 9人人澡人人爽人人精品| 精品福利一区二区三区| 亚洲国产精品综合小说图片区| 成人爱爱电影网址| 亚洲精品在线网站| 日韩专区一卡二卡| 在线观看精品一区| 国产精品理论在线观看| 加勒比av一区二区| 日韩一区和二区| 亚洲最新视频在线观看| av亚洲精华国产精华精| 久久久国产精品麻豆| 日韩精品电影一区亚洲| 欧美视频在线播放| 亚洲男人的天堂网| 9人人澡人人爽人人精品| 久久久久青草大香线综合精品| 日韩av不卡一区二区| 欧美色国产精品| 玉米视频成人免费看| av网站一区二区三区| 国产精品久久久久久妇女6080| 国产主播一区二区三区| 精品美女被调教视频大全网站| 麻豆精品视频在线观看| 欧美一区三区四区| 日本美女视频一区二区| 日韩一区二区三区视频| 捆绑紧缚一区二区三区视频| 欧美成人性战久久| 国产毛片精品国产一区二区三区| 国产午夜精品美女毛片视频|