1. http://jackyrong.iteye.com/blog/2153812

2. http://www.javacodegeeks.com/2014/10/apache-commons-io-tutorial.html

3. http://www.importnew.com/13715.html

4. http://www.cnblogs.com/younggun/p/3247261.html

(misybing:Apache Commons IO 包下载后,将该jar包添加到Eclipse工程的编译路径下,右键点工程文件夹 ->  Build Path -> Add external archives。

Apache Commons IO 包绝对是好东西,地址在 http://commons.apache.org/proper/commons-io/,下面用例子分别介绍:
  1)  工具类

  2) 输入

  3) 输出

  4) filters过滤

  5) Comparators

  6) 文件监控

 

   总的入口例子为:

  1. public class ApacheCommonsExampleMain {
  2. public static void main(String[] args) {
  3. UtilityExample.runExample();
  4. FileMonitorExample.runExample();
  5. FiltersExample.runExample();
  6. InputExample.runExample();
  7. OutputExample.runExample();
  8. ComparatorExample.runExample();
  9. }
  10. }

一  工具类包UtilityExample代码:

这个工具类包分如下几个主要工具类:

     1) FilenameUtils:主要处理各种操作系统下对文件名的操作

     2) FileUtils:处理文件的打开,移动,读取和判断文件是否存在

    3) IOCASE:字符串的比较

    4) FileSystemUtils:返回磁盘的空间大小

  1. import java.io.File;
  2. import java.io.IOException;
  3. import org.apache.commons.io.FileSystemUtils;
  4. import org.apache.commons.io.FileUtils;
  5. import org.apache.commons.io.FilenameUtils;
  6. import org.apache.commons.io.LineIterator;
  7. import org.apache.commons.io.IOCase;
  8. public final class UtilityExample {
  9. // We are using the file exampleTxt.txt in the folder ExampleFolder,
  10. // and we need to provide the full path to the Utility classes.
  11. private static final String EXAMPLE_TXT_PATH =
  12. "C:\\Users\\Lilykos\\workspace\\ApacheCommonsExample\\ExampleFolder\\exampleTxt.txt";
  13. private static final String PARENT_DIR =
  14. "C:\\Users\\Lilykos\\workspace\\ApacheCommonsExample";
  15. public static void runExample() throws IOException {
  16. System.out.println("Utility Classes example...");
  17. // FilenameUtils
  18. System.out.println("Full path of exampleTxt: " +
  19. FilenameUtils.getFullPath(EXAMPLE_TXT_PATH));
  20. System.out.println("Full name of exampleTxt: " +
  21. FilenameUtils.getName(EXAMPLE_TXT_PATH));
  22. System.out.println("Extension of exampleTxt: " +
  23. FilenameUtils.getExtension(EXAMPLE_TXT_PATH));
  24. System.out.println("Base name of exampleTxt: " +
  25. FilenameUtils.getBaseName(EXAMPLE_TXT_PATH));
  26. // FileUtils
  27. // We can create a new File object using FileUtils.getFile(String)
  28. // and then use this object to get information from the file.
  29. File exampleFile = FileUtils.getFile(EXAMPLE_TXT_PATH);
  30. LineIterator iter = FileUtils.lineIterator(exampleFile);
  31. System.out.println("Contents of exampleTxt...");
  32. while (iter.hasNext()) {
  33. System.out.println("\t" + iter.next());
  34. }
  35. iter.close();
  36. // We can check if a file exists somewhere inside a certain directory.
  37. File parent = FileUtils.getFile(PARENT_DIR);
  38. System.out.println("Parent directory contains exampleTxt file: " +
  39. FileUtils.directoryContains(parent, exampleFile));
  40. // IOCase
  41. String str1 = "This is a new String.";
  42. String str2 = "This is another new String, yes!";
  43. System.out.println("Ends with string (case sensitive): " +
  44. IOCase.SENSITIVE.checkEndsWith(str1, "string."));
  45. System.out.println("Ends with string (case insensitive): " +
  46. IOCase.INSENSITIVE.checkEndsWith(str1, "string."));
  47. System.out.println("String equality: " +
  48. IOCase.SENSITIVE.checkEquals(str1, str2));
  49. // FileSystemUtils
  50. System.out.println("Free disk space (in KB): " + FileSystemUtils.freeSpaceKb("C:"));
  51. System.out.println("Free disk space (in MB): " + FileSystemUtils.freeSpaceKb("C:") / 1024);
  52. }
  53. }

输出:

  1. Utility Classes example...
  2. Full path of exampleTxt: C:\Users\Lilykos\workspace\ApacheCommonsExample\ExampleFolder\
  3. Full name of exampleTxt: exampleTxt.txt
  4. Extension of exampleTxt: txt
  5. Base name of exampleTxt: exampleTxt
  6. Contents of exampleTxt...
  7. This is an example text file.
  8. We will use it for experimenting with Apache Commons IO.
  9. Parent directory contains exampleTxt file: true
  10. Ends with string (case sensitive): false
  11. Ends with string (case insensitive): true
  12. String equality: false
  13. Free disk space (in KB): 32149292
  14. Free disk space (in MB): 31395

二  FileMonitor工具类包

   这个org.apache.commons.io.monitor 包中的工具类可以监视文件或者目录的变化,获得指定文件或者目录的相关信息,下面看例子:

  1. import java.io.File;
  2. import java.io.IOException;
  3. import org.apache.commons.io.FileDeleteStrategy;
  4. import org.apache.commons.io.FileUtils;
  5. import org.apache.commons.io.monitor.FileAlterationListenerAdaptor;
  6. import org.apache.commons.io.monitor.FileAlterationMonitor;
  7. import org.apache.commons.io.monitor.FileAlterationObserver;
  8. import org.apache.commons.io.monitor.FileEntry;
  9. public final class FileMonitorExample {
  10. private static final String EXAMPLE_PATH =
  11. "C:\\Users\\Lilykos\\workspace\\ApacheCommonsExample\\ExampleFolder\\exampleFileEntry.txt";
  12. private static final String PARENT_DIR =
  13. "C:\\Users\\Lilykos\\workspace\\ApacheCommonsExample\\ExampleFolder";
  14. private static final String NEW_DIR =
  15. "C:\\Users\\Lilykos\\workspace\\ApacheCommonsExample\\ExampleFolder\\newDir";
  16. private static final String NEW_FILE =
  17. "C:\\Users\\Lilykos\\workspace\\ApacheCommonsExample\\ExampleFolder\\newFile.txt";
  18. public static void runExample() {
  19. System.out.println("File Monitor example...");
  20. // FileEntry
  21. // We can monitor changes and get information about files
  22. // using the methods of this class.
  23. FileEntry entry = new FileEntry(FileUtils.getFile(EXAMPLE_PATH));
  24. System.out.println("File monitored: " + entry.getFile());
  25. System.out.println("File name: " + entry.getName());
  26. System.out.println("Is the file a directory?: " + entry.isDirectory());
  27. // File Monitoring
  28. // Create a new observer for the folder and add a listener
  29. // that will handle the events in a specific directory and take action.
  30. File parentDir = FileUtils.getFile(PARENT_DIR);
  31. FileAlterationObserver observer = new FileAlterationObserver(parentDir);
  32. observer.addListener(new FileAlterationListenerAdaptor() {
  33. @Override
  34. public void onFileCreate(File file) {
  35. System.out.println("File created: " + file.getName());
  36. }
  37. @Override
  38. public void onFileDelete(File file) {
  39. System.out.println("File deleted: " + file.getName());
  40. }
  41. @Override
  42. public void onDirectoryCreate(File dir) {
  43. System.out.println("Directory created: " + dir.getName());
  44. }
  45. @Override
  46. public void onDirectoryDelete(File dir) {
  47. System.out.println("Directory deleted: " + dir.getName());
  48. }
  49. });
  50. // Add a monior that will check for events every x ms,
  51. // and attach all the different observers that we want.
  52. FileAlterationMonitor monitor = new FileAlterationMonitor(500, observer);
  53. try {
  54. monitor.start();
  55. // After we attached the monitor, we can create some files and directories
  56. // and see what happens!
  57. File newDir = new File(NEW_DIR);
  58. File newFile = new File(NEW_FILE);
  59. newDir.mkdirs();
  60. newFile.createNewFile();
  61. Thread.sleep(1000);
  62. FileDeleteStrategy.NORMAL.delete(newDir);
  63. FileDeleteStrategy.NORMAL.delete(newFile);
  64. Thread.sleep(1000);
  65. monitor.stop();
  66. } catch (IOException e) {
  67. e.printStackTrace();
  68. } catch (InterruptedException e) {
  69. e.printStackTrace();
  70. } catch (Exception e) {
  71. e.printStackTrace();
  72. }
  73. }
  74. }

输出如下:

  1. File Monitor example...
  2. File monitored: C:\Users\Lilykos\workspace\ApacheCommonsExample\ExampleFolder\exampleFileEntry.txt
  3. File name: exampleFileEntry.txt
  4. Is the file a directory?: false
  5. Directory created: newDir
  6. File created: newFile.txt
  7. Directory deleted: newDir
  8. File deleted: newFile.txt

上面的特性的确很赞!分析下,这个工具类包下的工具类,可以允许我们创建跟踪文件或目录变化的监听句柄,当文件目录等发生任何变化,都可以用“观察者”的身份进行观察,

其步骤如下:

   1) 创建要监听的文件对象

   2) 创建FileAlterationObserver 监听对象,在上面的例子中,

   File parentDir = FileUtils.getFile(PARENT_DIR);

  FileAlterationObserver observer = new FileAlterationObserver(parentDir);

   创建的是监视parentDir目录的变化,

   3) 为观察器创建FileAlterationListenerAdaptor的内部匿名类,增加对文件及目录的增加删除的监听

   4) 创建FileAlterationMonitor监听类,每隔500ms监听目录下的变化,其中开启监视是用monitor的start方法即可。

三  过滤器 filters

   先看例子:

  1. import java.io.File;
  2. import org.apache.commons.io.FileUtils;
  3. import org.apache.commons.io.IOCase;
  4. import org.apache.commons.io.filefilter.AndFileFilter;
  5. import org.apache.commons.io.filefilter.NameFileFilter;
  6. import org.apache.commons.io.filefilter.NotFileFilter;
  7. import org.apache.commons.io.filefilter.OrFileFilter;
  8. import org.apache.commons.io.filefilter.PrefixFileFilter;
  9. import org.apache.commons.io.filefilter.SuffixFileFilter;
  10. import org.apache.commons.io.filefilter.WildcardFileFilter;
  11. public final class FiltersExample {
  12. private static final String PARENT_DIR =
  13. "C:\\Users\\Lilykos\\workspace\\ApacheCommonsExample\\ExampleFolder";
  14. public static void runExample() {
  15. System.out.println("File Filter example...");
  16. // NameFileFilter
  17. // Right now, in the parent directory we have 3 files:
  18. //      directory example
  19. //      file exampleEntry.txt
  20. //      file exampleTxt.txt
  21. // Get all the files in the specified directory
  22. // that are named "example".
  23. File dir = FileUtils.getFile(PARENT_DIR);
  24. String[] acceptedNames = {"example", "exampleTxt.txt"};
  25. for (String file: dir.list(new NameFileFilter(acceptedNames, IOCase.INSENSITIVE))) {
  26. System.out.println("File found, named: " + file);
  27. }
  28. //WildcardFileFilter
  29. // We can use wildcards in order to get less specific results
  30. //      ? used for 1 missing char
  31. //      * used for multiple missing chars
  32. for (String file: dir.list(new WildcardFileFilter("*ample*"))) {
  33. System.out.println("Wildcard file found, named: " + file);
  34. }
  35. // PrefixFileFilter
  36. // We can also use the equivalent of startsWith
  37. // for filtering files.
  38. for (String file: dir.list(new PrefixFileFilter("example"))) {
  39. System.out.println("Prefix file found, named: " + file);
  40. }
  41. // SuffixFileFilter
  42. // We can also use the equivalent of endsWith
  43. // for filtering files.
  44. for (String file: dir.list(new SuffixFileFilter(".txt"))) {
  45. System.out.println("Suffix file found, named: " + file);
  46. }
  47. // OrFileFilter
  48. // We can use some filters of filters.
  49. // in this case, we use a filter to apply a logical
  50. // or between our filters.
  51. for (String file: dir.list(new OrFileFilter(
  52. new WildcardFileFilter("*ample*"), new SuffixFileFilter(".txt")))) {
  53. System.out.println("Or file found, named: " + file);
  54. }
  55. // And this can become very detailed.
  56. // Eg, get all the files that have "ample" in their name
  57. // but they are not text files (so they have no ".txt" extension.
  58. for (String file: dir.list(new AndFileFilter( // we will match 2 filters...
  59. new WildcardFileFilter("*ample*"), // ...the 1st is a wildcard...
  60. new NotFileFilter(new SuffixFileFilter(".txt"))))) { // ...and the 2nd is NOT .txt.
  61. System.out.println("And/Not file found, named: " + file);
  62. }
  63. }
  64. }

可以看清晰看到,使用过滤器,可以分别在指定的目录下,寻找符合条件

的文件,比如以什么开头的文件名,支持通配符,甚至支持多个过滤器进行或的操作!

  输出如下:

  1. File Filter example...
  2. File found, named: example
  3. File found, named: exampleTxt.txt
  4. Wildcard file found, named: example
  5. Wildcard file found, named: exampleFileEntry.txt
  6. Wildcard file found, named: exampleTxt.txt
  7. Prefix file found, named: example
  8. Prefix file found, named: exampleFileEntry.txt
  9. Prefix file found, named: exampleTxt.txt
  10. Suffix file found, named: exampleFileEntry.txt
  11. Suffix file found, named: exampleTxt.txt
  12. Or file found, named: example
  13. Or file found, named: exampleFileEntry.txt
  14. Or file found, named: exampleTxt.txt
  15. And/Not file found, named: example

四  Comparators比较器

   org.apache.commons.io.comparator包下的工具类,可以方便进行文件的比较:

  1. import java.io.File;
  2. import java.util.Date;
  3. import org.apache.commons.io.FileUtils;
  4. import org.apache.commons.io.IOCase;
  5. import org.apache.commons.io.comparator.LastModifiedFileComparator;
  6. import org.apache.commons.io.comparator.NameFileComparator;
  7. import org.apache.commons.io.comparator.SizeFileComparator;
  8. public final class ComparatorExample {
  9. private static final String PARENT_DIR =
  10. "C:\\Users\\Lilykos\\workspace\\ApacheCommonsExample\\ExampleFolder";
  11. private static final String FILE_1 =
  12. "C:\\Users\\Lilykos\\workspace\\ApacheCommonsExample\\ExampleFolder\\example";
  13. private static final String FILE_2 =
  14. "C:\\Users\\Lilykos\\workspace\\ApacheCommonsExample\\ExampleFolder\\exampleTxt.txt";
  15. public static void runExample() {
  16. System.out.println("Comparator example...");
  17. //NameFileComparator
  18. // Let's get a directory as a File object
  19. // and sort all its files.
  20. File parentDir = FileUtils.getFile(PARENT_DIR);
  21. NameFileComparator comparator = new NameFileComparator(IOCase.SENSITIVE);
  22. File[] sortedFiles = comparator.sort(parentDir.listFiles());
  23. System.out.println("Sorted by name files in parent directory: ");
  24. for (File file: sortedFiles) {
  25. System.out.println("\t"+ file.getAbsolutePath());
  26. }
  27. // SizeFileComparator
  28. // We can compare files based on their size.
  29. // The boolean in the constructor is about the directories.
  30. //      true: directory's contents count to the size.
  31. //      false: directory is considered zero size.
  32. SizeFileComparator sizeComparator = new SizeFileComparator(true);
  33. File[] sizeFiles = sizeComparator.sort(parentDir.listFiles());
  34. System.out.println("Sorted by size files in parent directory: ");
  35. for (File file: sizeFiles) {
  36. System.out.println("\t"+ file.getName() + " with size (kb): " + file.length());
  37. }
  38. // LastModifiedFileComparator
  39. // We can use this class to find which file was more recently modified.
  40. LastModifiedFileComparator lastModified = new LastModifiedFileComparator();
  41. File[] lastModifiedFiles = lastModified.sort(parentDir.listFiles());
  42. System.out.println("Sorted by last modified files in parent directory: ");
  43. for (File file: lastModifiedFiles) {
  44. Date modified = new Date(file.lastModified());
  45. System.out.println("\t"+ file.getName() + " last modified on: " + modified);
  46. }
  47. // Or, we can also compare 2 specific files and find which one was last modified.
  48. //      returns > 0 if the first file was last modified.
  49. //      returns  0)
  50. System.out.println("File " + file1.getName() + " was modified last because...");
  51. else
  52. System.out.println("File " + file2.getName() + "was modified last because...");
  53. System.out.println("\t"+ file1.getName() + " last modified on: " +
  54. new Date(file1.lastModified()));
  55. System.out.println("\t"+ file2.getName() + " last modified on: " +
  56. new Date(file2.lastModified()));
  57. }
  58. }

输出如下:

  1. Comparator example...
  2. Sorted by name files in parent directory:
  3. C:\Users\Lilykos\workspace\ApacheCommonsExample\ExampleFolder\comparator1.txt
  4. C:\Users\Lilykos\workspace\ApacheCommonsExample\ExampleFolder\comperator2.txt
  5. C:\Users\Lilykos\workspace\ApacheCommonsExample\ExampleFolder\example
  6. C:\Users\Lilykos\workspace\ApacheCommonsExample\ExampleFolder\exampleFileEntry.txt
  7. C:\Users\Lilykos\workspace\ApacheCommonsExample\ExampleFolder\exampleTxt.txt
  8. Sorted by size files in parent directory:
  9. example with size (kb): 0
  10. exampleTxt.txt with size (kb): 87
  11. exampleFileEntry.txt with size (kb): 503
  12. comperator2.txt with size (kb): 1458
  13. comparator1.txt with size (kb): 4436
  14. Sorted by last modified files in parent directory:
  15. exampleTxt.txt last modified on: Sun Oct 26 14:02:22 EET 2014
  16. example last modified on: Sun Oct 26 23:42:55 EET 2014
  17. comparator1.txt last modified on: Tue Oct 28 14:48:28 EET 2014
  18. comperator2.txt last modified on: Tue Oct 28 14:48:52 EET 2014
  19. exampleFileEntry.txt last modified on: Tue Oct 28 14:53:50 EET 2014
  20. File example was modified last because...
  21. example last modified on: Sun Oct 26 23:42:55 EET 2014
  22. exampleTxt.txt last modified on: Sun Oct 26 14:02:22 EET 2014

可以看到,在上面的代码中

NameFileComparator: 文件名的比较器,可以进行文件名称排序;

SizeFileComparator: 按照文件大小比较

LastModifiedFileComparator: 根据最新修改日期比较

五  input包

    在 common io的org.apache.commons.io.input 包中,有各种对InputStream的实现类:

我们看下其中的TeeInputStream, ,它接受InputStream和Outputstream参数,例子如下:

  1. import java.io.ByteArrayInputStream;
  2. import java.io.ByteArrayOutputStream;
  3. import java.io.File;
  4. import java.io.IOException;
  5. import org.apache.commons.io.FileUtils;
  6. import org.apache.commons.io.input.TeeInputStream;
  7. import org.apache.commons.io.input.XmlStreamReader;
  8. public final class InputExample {
  9. private static final String XML_PATH =
  10. "C:\\Users\\Lilykos\\workspace\\ApacheCommonsExample\\InputOutputExampleFolder\\web.xml";
  11. private static final String INPUT = "This should go to the output.";
  12. public static void runExample() {
  13. System.out.println("Input example...");
  14. XmlStreamReader xmlReader = null;
  15. TeeInputStream tee = null;
  16. try {
  17. // XmlStreamReader
  18. // We can read an xml file and get its encoding.
  19. File xml = FileUtils.getFile(XML_PATH);
  20. xmlReader = new XmlStreamReader(xml);
  21. System.out.println("XML encoding: " + xmlReader.getEncoding());
  22. // TeeInputStream
  23. // This very useful class copies an input stream to an output stream
  24. // and closes both using only one close() method (by defining the 3rd
  25. // constructor parameter as true).
  26. ByteArrayInputStream in = new ByteArrayInputStream(INPUT.getBytes("US-ASCII"));
  27. ByteArrayOutputStream out = new ByteArrayOutputStream();
  28. tee = new TeeInputStream(in, out, true);
  29. tee.read(new byte[INPUT.length()]);
  30. System.out.println("Output stream: " + out.toString());
  31. } catch (IOException e) {
  32. e.printStackTrace();
  33. } finally {
  34. try { xmlReader.close(); }
  35. catch (IOException e) { e.printStackTrace(); }
  36. try { tee.close(); }
  37. catch (IOException e) { e.printStackTrace(); }
  38. }
  39. }
  40. }

输出:

  1. Input example...
  2. XML encoding: UTF-8
  3. Output stream: This should go to the output.

tee = new TeeInputStream(in, out, true);

   中,分别三个参数,将输入流的内容输出到输出流,true参数为最后关闭流

六 output工具类包

 

  其中的org.apache.commons.io.output 是实现了outputstream,其中好特别的是

TeeOutputStream能将一个输入流分别输出到两个输出流

  1. import java.io.ByteArrayInputStream;
  2. import java.io.ByteArrayOutputStream;
  3. import java.io.IOException;
  4. import org.apache.commons.io.input.TeeInputStream;
  5. import org.apache.commons.io.output.TeeOutputStream;
  6. public final class OutputExample {
  7. private static final String INPUT = "This should go to the output.";
  8. public static void runExample() {
  9. System.out.println("Output example...");
  10. TeeInputStream teeIn = null;
  11. TeeOutputStream teeOut = null;
  12. try {
  13. // TeeOutputStream
  14. ByteArrayInputStream in = new ByteArrayInputStream(INPUT.getBytes("US-ASCII"));
  15. ByteArrayOutputStream out1 = new ByteArrayOutputStream();
  16. ByteArrayOutputStream out2 = new ByteArrayOutputStream();
  17. teeOut = new TeeOutputStream(out1, out2);
  18. teeIn = new TeeInputStream(in, teeOut, true);
  19. teeIn.read(new byte[INPUT.length()]);
  20. System.out.println("Output stream 1: " + out1.toString());
  21. System.out.println("Output stream 2: " + out2.toString());
  22. } catch (IOException e) {
  23. e.printStackTrace();
  24. } finally {
  25. // No need to close teeOut. When teeIn closes, it will also close its
  26. // Output stream (which is teeOut), which will in turn close the 2
  27. // branches (out1, out2).
  28. try { teeIn.close(); }
  29. catch (IOException e) { e.printStackTrace(); }
  30. }
  31. }
  32. }

输出:

  1. Output example...
  2. Output stream 1: This should go to the output.
  3. Output stream 2: This should go to the output.

完整代码下载:http://a3ab771892fd198a96736e50.javacodegeeks.netdna-cdn.com/wp-content/uploads/2014/10/ApacheCommonsIOExample.rar

apache commons io包基本功能的更多相关文章

  1. IO与文件读写---使用Apache commons IO包提高读写效率

    觉得很不错,就转载了, 作者: Paul Lin 首先贴一段Apache commons IO官网上的介绍,来对这个著名的开源包有一个基本的了解:Commons IO is a library of ...

  2. Apache Commons IO入门教程(转)

    Apache Commons IO是Apache基金会创建并维护的Java函数库.它提供了许多类使得开发者的常见任务变得简单,同时减少重复(boiler-plate)代码,这些代码可能遍布于每个独立的 ...

  3. [转]Apache Commons IO入门教程

    Apache Commons IO是Apache基金会创建并维护的Java函数库.它提供了许多类使得开发者的常见任务变得简单,同时减少重复(boiler-plate)代码,这些代码可能遍布于每个独立的 ...

  4. .apache.commons.io 源代码学习(一)

    java的初学者,准备通读各种高水平源代码,提升能力. 为了避免自己的惰性,写博客. 版本:2.5 开发平台:netbeans. 今天是第一天,网上先看个例子:http://www.importnew ...

  5. apache commons io入门

    原文参考  http://www.javacodegeeks.com/2014/10/apache-commons-io-tutorial.html    Apache Commons IO 包绝对是 ...

  6. apache.commons.io.IOUtils: 一个很方便的IO工具库(比如InputStream转String)

    转换InputStream到String, 比如 //引入apache的io包 import org.apache.commons.io.IOUtils; ... ...String str = IO ...

  7. Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.FileUtils

    1.错误叙述性说明 警告: Could not create JarEntryRevision for [jar:file:/D:/MyEclipse/apache-tomcat-7.0.53/web ...

  8. java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream(转)

    java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream 使用Tomcat的Manag ...

  9. java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream

    java.lang.ClassNotFoundException: org.apache.commons.io.output.DeferredFileOutputStream at org.apach ...

随机推荐

  1. Java 字节码

    Java作为业界应用最为广泛的语言之一,深得众多软件厂商和开发者的推崇,更是被包括Oracle在内的众多JCP成员积极地推动发展.但是对于Java语言的深度理解和运用,毕竟是很少会有人涉及的话题.In ...

  2. xstream 别名的用法<转>

    1.xstream的alias使用方法: 1.1 作用:将序列化中的类全量名称,用别名替换. 1.2  使用方法:xstream.alias("blog", Blog.class) ...

  3. 设计模式之(三)Proxy模式

    今天学习Proxy模式.代理模式是在对已有对象操作困难或者不太方便时,选择用代理的方式对对象进行访问.Proxy实现的方法必须和被代理对象一致. 举一个简单的例子, 有一个Math类实现了IMath接 ...

  4. random随机函数

    SQL> select * from (select ename,job from emp order by dbms_random.value() ) where rownum <5 2 ...

  5. char类型关联

    SQL> create table a1(id int,name char(10)); Table created. SQL> create table a2(id int,name ch ...

  6. HTML---网页编程(2)

    前言 接着前面的HTML-网络编程1)来学习吧~~~ 色彩的表示 在计算机显示器中,使用红(red).绿(green).蓝(blue)3种颜色来构成各种各样的颜色.颜色的种类有16,256及65536 ...

  7. HDOJ/HDU 2552 三足鼎立(tan()和atan()方法)

    Problem Description MCA山中人才辈出,洞悉外界战火纷纷,山中各路豪杰决定出山拯救百姓于水火,曾以题数扫全场的威士忌,曾经高数九十九的天外来客,曾以一剑铸十年的亦纷菲,歃血为盟,盘 ...

  8. 社区发现(Community Detection)算法 [转]

    作者: peghoty 出处: http://blog.csdn.net/peghoty/article/details/9286905 社区发现(Community Detection)算法用来发现 ...

  9. JavaScript高级程序设计19.pdf

    注册处理程序 navigator.registerContentHandler("applicat/rss+xml","http://www.somereader.com ...

  10. Node.js 初探

    概念 Node.js 是构建在Chrome javascript runtime之上的平台,能够很容易的构建快速的,可伸缩性的网络应用程序.Node.js使用事件驱动,非阻塞I/O 模式,这使它能够更 ...