java中常用的16个工具类

1. org.apache.commons.io.IOUtils:处理io流的相关操作

  • closeQuietly ( )
  • toString ( )
  • copy ( )
  • toByteArray ( )
  • write ( )
  • toInputStream ( )
  • readLines ( )
  • copyLarge ( )
  • lineIterator ( )
  • readFully ( )

2. org.apache.commons.io.FileUtils:处理文件的相关操作

  • deleteDirectory ( )
  • readFileToString ( )
  • deleteQuietly ( )
  • copyFile ( )
  • writeStringToFile ( )
  • forceMkdir ( )
  • write ( )
  • listFiles ( )
  • copyDirectory ( )
  • forceDelete ( )

3. org.apache.commons.lang.StringUtils:处理字符串的相关操作

  • isBlank ( )
  • isNotBlank ( )
  • isEmpty ( )
  • isNotEmpty ( )
  • equals ( )
  • join ( )
  • split ( )
  • EMPTY
  • trimToNull ( )
  • replace ( )

4. org.apache.http.util.EntityUtils:处理HttpEntity类的静态方法

  • toString ( )
  • consume ( )
  • toByteArray ( )
  • consumeQuietly ( )
  • getContentCharSet ( )

5. org.apache.commons.lang3.StringUtils:处理字符串的相关方法

  • isBlank ( )
  • isNotBlank ( )
  • isEmpty ( )
  • isNotEmpty ( )
  • join ( )
  • equals ( )
  • split ( )
  • EMPTY
  • replace ( )
  • capitalize ( )

6. org.apache.commons.io.FilenameUtils:处理文件名的相关方法

  • getExtension ( )
  • getBaseName ( )
  • getName ( )
  • concat ( )
  • removeExtension ( )
  • normalize ( )
  • wildcardMatch ( )
  • separatorsToUnix ( )
  • getFullPath ( )
  • isExtension ( )

7. org.springframework.util.StringUtils:处理字符串的方法

  • hasText ( )
  • hasLength ( )
  • isEmpty ( )
  • commaDelimitedListToStringArray ( )
  • collectionToDelimitedString ( )
  • replace ( )
  • delimitedListToStringArray ( )
  • uncapitalize ( )
  • collectionToCommaDelimitedString ( )
  • tokenizeToStringArray ( )

8. org.apache.commons.lang.ArrayUtils:处理数组的方法

  • contains ( )
  • addAll ( )
  • clone ( )
  • isEmpty ( )
  • add ( )
  • EMPTY_BYTE_ARRAY
  • subarray ( )
  • indexOf ( )
  • isEquals ( )
  • toObject ( )

9. org.apache.commons.lang.StringEscapeUtils:处理字符串的方法

  • escapeHtml ( )
  • unescapeHtml ( )
  • escapeXml ( )
  • escapeSql ( )
  • unescapeJava ( )
  • escapeJava ( )
  • escapeJavaScript ( )
  • unescapeXml ( )
  • unescapeJavaScript ( )

10. org.apache.http.client.utils.URLEncodedUtils:处理url的方法

  • format ( )
  • parse ( )

11. org.apache.commons.codec.digest.DigestUtils:消息加密工具方法,消息可以是字符串,io流,字节数组

  • md5Hex ( )
  • shaHex ( )
  • sha256Hex ( )
  • sha1Hex ( )
  • sha ( )
  • md5 ( )
  • sha512Hex ( )
  • sha1 ( )

12. org.apache.commons.collections.CollectionUtils:集合操作方法

  • isEmpty ( )
  • isNotEmpty ( )
  • select ( )
  • transform ( )
  • filter ( )
  • find ( )
  • collect ( )
  • forAllDo ( )
  • addAll ( )
  • isEqualCollection ( )

13. org.apache.commons.lang3.ArrayUtils:数组操作方法

  • contains ( )
  • isEmpty ( )
  • isNotEmpty ( )
  • add ( )
  • clone ( )
  • addAll ( )
  • subarray ( )
  • indexOf ( )
  • EMPTY_OBJECT_ARRAY
  • EMPTY_STRING_ARRAY

14. org.apache.commons.beanutils.PropertyUtils:java bean操作方法

  • getProperty ( )
  • setProperty ( )
  • getPropertyDescriptors ( )
  • isReadable ( )
  • copyProperties ( )
  • getPropertyDescriptor ( )
  • getSimpleProperty ( )
  • isWriteable ( )
  • setSimpleProperty ( )
  • getPropertyType ( )

15. org.apache.commons.lang3.StringEscapeUtils:字符串转义方法

  • unescapeHtml4 ( )
  • escapeHtml4 ( )
  • escapeXml ( )
  • unescapeXml ( )
  • escapeJava ( )
  • escapeEcmaScript ( )
  • unescapeJava ( )
  • escapeJson ( )
  • escapeXml10 ( )

16. org.apache.commons.beanutils.BeanUtils:java bean操作方法

  • copyProperties ( )
  • getProperty ( )
  • setProperty ( )
  • describe ( )
  • populate ( )
  • copyProperty ( )
  • cloneBean ( )

本文转自:https://www.toutiao.com/a6599527062178890243/?tt_from=mobile_qq&utm_campaign=client_share&timestamp=1536623155&app=news_article&utm_source=mobile_qq&iid=43833147166&utm_medium=toutiao_android&group_id=6599527062178890243

posted @ 2018-09-15 15:41  ppjj  阅读(6258)  评论(0编辑  收藏  举报