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

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

?? ioutils.java

?? struts spring ibatis
?? JAVA
字號:
/* ============================================================================                   The Apache Software License, Version 1.1 ============================================================================ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modifica- tion, are permitted provided that the following conditions are met: 1. Redistributions of  source code must  retain the above copyright  notice,    this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice,    this list of conditions and the following disclaimer in the documentation    and/or other materials provided with the distribution. 3. The end-user documentation included with the redistribution, if any, must    include  the following  acknowledgment:  "This product includes  software    developed  by the  Apache Software Foundation  (http://www.apache.org/)."    Alternately, this  acknowledgment may  appear in the software itself,  if    and wherever such third-party acknowledgments normally appear. 4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be    used to  endorse or promote  products derived from  this software without    prior written permission. For written permission, please contact    apache@apache.org. 5. Products  derived from this software may not  be called "Apache", nor may    "Apache" appear  in their name,  without prior written permission  of the    Apache Software Foundation. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU- DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. This software  consists of voluntary contributions made  by many individuals on  behalf of the Apache Software  Foundation and was  originally created by Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache Software Foundation, please see <http://www.apache.org/>.*/package com.struts2.framework.util;//import org.apache.log.Hierarchy;import java.io.*;import java.text.Collator;import java.util.Arrays;import java.util.Locale;/** * A collection of <code>File</code>, <code>URL</code> and filename * utility methods * * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a> * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a> * @version CVS $Id: IOUtils.java,v 1.7 2002/03/29 20:16:34 vgritsenko Exp $ */public class IOUtils {    // **********************    // Serialize Methods    // **********************    /**     * Dump a <code>String</code> to a text file.     *     * @param file The output file     * @param string The string to be dumped     * @exception IOException IO Error     */    public static void serializeString(File file, String string)    throws IOException {        serializeString(file, string, null);    }    /**     * Dump a <code>String</code> to a text file.     *     * @param file The output file     * @param string The string to be dumped     * @param encoding The encoding for the output file or null for default platform encoding     * @exception IOException IO Error     */    public static void serializeString(File file, String string, String encoding)    throws IOException {        final Writer fw =                (encoding == null)?                new FileWriter(file):                new OutputStreamWriter(new FileOutputStream(file), encoding);        try {            fw.write(string);            fw.flush();        } finally {            if (fw != null) fw.close();        }    }    /**     * Load a text file contents as a <code>String<code>.     * This method does not perform enconding conversions     *     * @param file The input file     * @return The file contents as a <code>String</code>     * @exception IOException IO Error     */    public static String deserializeString(File file)    throws IOException {        int len;        char[] chr = new char[4096];        final StringBuffer buffer = new StringBuffer();        final FileReader reader = new FileReader(file);        try {            while ((len = reader.read(chr)) > 0) {                buffer.append(chr, 0, len);            }        } finally {            if (reader != null) reader.close();        }        return buffer.toString();    }    /**     * This method serializes an object to an output stream.     *     * @param file The output file     * @param object The object to be serialized     * @exception IOException IOError     */    public static void serializeObject(File file, Object object)    throws IOException {        FileOutputStream fos = new FileOutputStream(file);        try {            ObjectOutputStream oos = new ObjectOutputStream(new BufferedOutputStream(fos));            oos.writeObject(object);            oos.flush();        } finally {            if (fos != null) fos.close();        }    }    /**     * This method deserializes an object from an input stream.     *     * @param file The input file     * @return The deserialized object     * @exception IOException IOError     */    public static Object deserializeObject(File file)    throws IOException, ClassNotFoundException {        FileInputStream fis = new FileInputStream(file);        Object object = null;        try {            ObjectInputStream ois = new ObjectInputStream(new BufferedInputStream(fis));            object = ois.readObject();        } finally {            if (fis != null) fis.close();        }        return object;    }  /**   * These are java keywords as specified at the following URL (sorted alphabetically).   * http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#229308   */  static final String keywords[] =  {      "abstract",  "boolean",     "break",    "byte",         "case",      "catch",     "char",        "class",    "const",        "continue",      "default",   "do",          "double",   "else",         "extends",      "final",     "finally",     "float",    "for",          "goto",      "if",        "implements",  "import",   "instanceof",   "int",      "interface", "long",        "native",   "new",          "package",      "private",   "protected",   "public",   "return",       "short",      "static",    "strictfp",    "super",    "switch",       "synchronized",      "this",      "throw",       "throws",   "transient",    "try",      "void",      "volatile",    "while"  };  /** Collator for comparing the strings */  static final Collator englishCollator = Collator.getInstance(Locale.ENGLISH);  /** Use this character as suffix */  static final char keywordSuffix = '_';  /**   * checks if the input string is a valid java keyword.   * @return boolean true/false   */  private static boolean isJavaKeyword(String keyword) {    return (Arrays.binarySearch(keywords, keyword, englishCollator) >= 0);  }  // **********************  // File Methods  // **********************  /**   * Return a modified filename suitable for replicating directory   * structures below the store's base directory. The following   * conversions are performed:   * <ul>   * <li>Path separators are converted to regular directory names</li>   * <li>File path components are transliterated to make them valid (?)   *     programming language identifiers. This transformation may well   *     generate collisions for unusual filenames.</li>   * </ul>   * @return The transformed filename   */  public static String normalizedFilename(String filename) {    if(File.separatorChar == '\\')        filename = filename.replace('/','\\');    else        filename = filename.replace('\\','/');    String[] path = StringUtils.split(filename, File.separator);    int start = (path[0].length() == 0) ? 1 : 0;    StringBuffer buffer = new StringBuffer();    for (int i = start; i < path.length; i++) {      if (i > start) {        buffer.append(File.separator);      }      boolean isJavaKeyword = isJavaKeyword(path[i]);      char[] chars = path[i].toCharArray();      if (chars.length < 1 || !Character.isLetter(chars[0])) buffer.append('_');      for (int j = 0; j < chars.length; j++) {        if (StringUtils.isAlphaNumeric(chars[j])) {          buffer.append(chars[j]);        } else {          buffer.append('_');        }      }      // Append the suffix if necessary.      if(isJavaKeyword)          buffer.append(keywordSuffix);    }    return buffer.toString();  }  /**   * Remove file information from a filename returning only its path   * component   *   * @param filename The filename   * @return The path information   */  public static String pathComponent(String filename) {    int i = filename.lastIndexOf(File.separator);    return (i > -1) ? filename.substring(0, i) : filename;  }  /**   * Remove path information from a filename returning only its file   * component   *   * @param filename The filename   * @return The filename sans path information   */  public static String fileComponent(String filename) {    int i = filename.lastIndexOf(File.separator);    return (i > -1) ? filename.substring(i + 1) : filename;  }  /**   * Strip a filename of its <i>last</i> extension (the portion   * immediately following the last dot character, if any)   *   * @param filename The filename   * @return The filename sans extension   */  public static String baseName(String filename) {    int i = filename.lastIndexOf('.');    return (i > -1) ? filename.substring(0, i) : filename;  }  /**   * Get the complete filename corresponding to a (typically relative)   * <code>File</code>.   * This method accounts for the possibility of an error in getting   * the filename's <i>canonical</i> path, returning the io/error-safe   * <i>absolute</i> form instead   *   * @param file The file   * @return The file's absolute filename   */  public static String getFullFilename(File file) {    try {      return file.getCanonicalPath();    } catch (Exception e) {      //Hierarchy.getDefaultHierarchy().getLoggerFor("cocoon").debug("IOUtils.getFullFilename", e);      return file.getAbsolutePath();    }  }  /**   * Return the path within a base directory   */  public static String getContextFilePath(String directoryPath, String filePath) {      try      {          File directory = new File(directoryPath);          File file = new File(filePath);          directoryPath = directory.getCanonicalPath();          filePath = file.getCanonicalPath();          // If the context directory does not have a File.separator          // at the end then add one explicitly          if(!directoryPath.endsWith(File.separator)){            directoryPath += File.separator;          }          // If the context dir contains both kinds of separator          // then standardize on using the File.separator          if ((directoryPath.indexOf('/') !=-1) && (directoryPath.indexOf('\\') !=-1)) {            directoryPath = directoryPath.replace('\\', File.separator.charAt(0));            directoryPath = directoryPath.replace('/', File.separator.charAt(0));          }          // If the file path contains both kinds of separator          // then standardize on using the File.separator          if ((filePath.indexOf('/') !=-1) && (filePath.indexOf('\\') !=-1)) {            filePath = filePath.replace('\\', File.separator.charAt(0));            filePath = filePath.replace('/', File.separator.charAt(0));          }          if (filePath.startsWith(directoryPath)) {              filePath = filePath.substring(directoryPath.length());          }      } catch (Exception e){          //Hierarchy.getDefaultHierarchy().getLoggerFor("cocoon").debug("IOUtils.getContextFilePath", e);      }      return filePath;  }  /**   * Return a file with the given filename creating the necessary   * directories if not present.   *   * @param filename The file   * @return The created File instance   */  public static File createFile(File destDir, String filename) {    File file = new File(destDir, filename);    File parent = file.getParentFile();    if (parent != null) parent.mkdirs();    return file;  }  /**   * Returns a byte array from the given object.   *   * @param object to convert   * @return byte array from the object   */  public static byte[] objectToBytes(Object object) throws IOException {    ByteArrayOutputStream baos = new ByteArrayOutputStream();    ObjectOutputStream os = new ObjectOutputStream(baos);    os.writeObject(object);    return baos.toByteArray();  }  /**   * Returns a object from the given byte array.   *   * @param bytes array to convert   * @return object   */  public static Object bytesToObject(byte[] bytes) throws IOException, ClassNotFoundException {    ByteArrayInputStream bais = new ByteArrayInputStream(bytes);    ObjectInputStream is = new ObjectInputStream(bais);    return is.readObject();  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
不卡一卡二卡三乱码免费网站| 在线看日本不卡| 在线看日本不卡| 精品福利在线导航| 亚洲精品中文字幕乱码三区| 免费看精品久久片| 在线亚洲一区二区| 欧美极品另类videosde| 久久国产欧美日韩精品| 欧美亚洲综合久久| 亚洲视频在线一区观看| 紧缚捆绑精品一区二区| 337p亚洲精品色噜噜噜| 悠悠色在线精品| 色综合中文字幕国产| 日韩区在线观看| 免费久久99精品国产| 欧美日韩一区在线观看| 最近日韩中文字幕| 成人禁用看黄a在线| 久久美女高清视频| 久久精品国产亚洲aⅴ| 欧美高清视频在线高清观看mv色露露十八| 中文字幕av不卡| 国产乱码精品1区2区3区| 欧美一级日韩一级| 日韩和的一区二区| 欧美一区二区大片| 日韩成人精品在线观看| 在线不卡中文字幕| 香蕉久久一区二区不卡无毒影院| 欧美性受xxxx黑人xyx| 亚洲一区二区三区四区五区黄 | 国产精品视频线看| 国产一区二区日韩精品| 欧美成人vps| 激情欧美一区二区| 2021久久国产精品不只是精品| 激情图区综合网| 国产欧美精品一区aⅴ影院| 精品一区二区三区视频 | 欧美日韩国产大片| 婷婷成人综合网| 7878成人国产在线观看| 韩国成人精品a∨在线观看| 久久综合丝袜日本网| 国产91丝袜在线18| 17c精品麻豆一区二区免费| 91网站在线播放| 亚洲自拍偷拍网站| 欧美一区二区不卡视频| 国模冰冰炮一区二区| 国产精品欧美极品| 在线看国产一区二区| 日韩福利电影在线观看| 久久久国产精华| 一本到三区不卡视频| 日韩中文字幕一区二区三区| 精品国产乱码久久久久久闺蜜| 国产精品一区二区免费不卡| 日韩理论片一区二区| 欧美日韩精品福利| 风间由美一区二区三区在线观看| 亚洲三级久久久| 日韩一级片在线播放| 成人一区二区三区视频| 偷拍一区二区三区四区| 久久精品视频一区二区三区| 91香蕉视频在线| 久久99精品国产.久久久久久 | 国产精品久久看| 欧美挠脚心视频网站| 国产白丝精品91爽爽久久| 亚洲国产精品一区二区久久恐怖片| 日韩一级免费一区| 日本精品一区二区三区四区的功能| 日本伊人午夜精品| **网站欧美大片在线观看| 欧美精品xxxxbbbb| 91麻豆文化传媒在线观看| 久久国产麻豆精品| 亚洲国产美女搞黄色| 久久久久国产精品免费免费搜索| 在线精品观看国产| 成人动漫av在线| 日韩有码一区二区三区| 中文字幕在线观看不卡视频| 欧美一区二区三级| 欧美在线播放高清精品| 成人av免费在线观看| 精品一区二区影视| 天堂影院一区二区| 一区二区三区四区激情| 国产精品无人区| 久久综合网色—综合色88| 欧美一区二区人人喊爽| 欧美视频你懂的| 一本久久a久久免费精品不卡| 国产伦精一区二区三区| 日韩成人一级大片| 亚洲亚洲人成综合网络| 中文字幕人成不卡一区| 国产欧美精品一区aⅴ影院| 久久综合一区二区| 日韩一区二区电影| 国产精品日日摸夜夜摸av| 56国语精品自产拍在线观看| 91久久国产综合久久| 97se亚洲国产综合在线| 不卡一区二区中文字幕| 99精品久久99久久久久| 99这里只有精品| 色综合久久综合网欧美综合网| www.一区二区| 91一区二区三区在线播放| 99久久精品情趣| 99麻豆久久久国产精品免费优播| 成人小视频在线观看| 国产.欧美.日韩| 97久久精品人人爽人人爽蜜臀| www.日韩精品| 色婷婷综合在线| 欧美性视频一区二区三区| 欧美日韩亚洲综合在线| 在线成人小视频| 精品久久五月天| 中文字幕不卡三区| 中文字幕在线视频一区| 中文字幕中文字幕中文字幕亚洲无线| 国产午夜精品一区二区三区四区| 日韩欧美第一区| 欧美日韩一区国产| 欧美日韩精品一区二区在线播放| 精品视频999| 欧美日韩免费电影| 99综合电影在线视频| 欧美日韩精品一区二区三区蜜桃 | 国产一区二区女| 国产乱人伦偷精品视频不卡| 久草中文综合在线| 精品无人码麻豆乱码1区2区| 黄色小说综合网站| 激情亚洲综合在线| 91丨九色丨尤物| 在线一区二区视频| 6080亚洲精品一区二区| 日韩一级高清毛片| 亚洲欧洲色图综合| 一区二区三区丝袜| 日韩黄色免费网站| 国产一区二三区| 在线视频观看一区| 欧美一级欧美三级在线观看| 欧美成人性福生活免费看| 久久久精品免费网站| 亚洲国产精品成人综合色在线婷婷 | 欧美日韩免费观看一区三区| 欧美日韩成人一区二区| 精品嫩草影院久久| 国产精品美女久久久久av爽李琼| 欧美国产国产综合| 日日噜噜夜夜狠狠视频欧美人| 另类中文字幕网| 99久久精品久久久久久清纯| 欧美日韩免费不卡视频一区二区三区| 国产欧美日韩在线视频| 香蕉影视欧美成人| 国产一区视频导航| 99久久99久久精品免费看蜜桃| 欧美猛男男办公室激情| 欧美一级电影网站| 中文字幕中文字幕中文字幕亚洲无线| 亚洲狼人国产精品| 国产suv一区二区三区88区| 欧美日韩综合在线免费观看| 欧美精品一区二区精品网| 亚洲三级在线免费观看| 大陆成人av片| 日韩一级完整毛片| 亚洲综合另类小说| 国产乱码精品一品二品| 9191久久久久久久久久久| 国产精品久久福利| 紧缚奴在线一区二区三区| 欧美一级高清片| 亚洲综合丁香婷婷六月香| 国产黄色精品网站| 欧美一区二区网站| 午夜婷婷国产麻豆精品| 99久久精品国产网站| 久久新电视剧免费观看| 天堂在线亚洲视频| 欧美久久一二三四区| 亚洲综合自拍偷拍| 成人不卡免费av| 精品日韩一区二区三区| 久久99国产精品久久99| 日韩一区二区三区在线视频| 亚洲午夜久久久久| 欧美日韩中文字幕精品|