Java有没有比较两个文件夹内容的函数??
例如,这两个文件夹的文件数一样,大小一样等功能?

解决方案 »

  1.   

    compareTo
    public int compareTo(File pathname)
    Compares two abstract pathnames lexicographically. The ordering defined by this method depends upon the underlying system. On UNIX systems, alphabetic case is significant in comparing pathnames; on Microsoft Windows systems it is not. Parameters:
    pathname - The abstract pathname to be compared to this abstract pathname 
    Returns:
    Zero if the argument is equal to this abstract pathname, a value less than zero if this abstract pathname is lexicographically less than the argument, or a value greater than zero if this abstract pathname is lexicographically greater than the argument
    Since: 
    1.2