Java

org.apache.commons.io.IOUtils

  1. closeQuietly()
  2. toString()
  3. copy()
  4. toByteArray()
  5. write()
  6. toInputStream()
  7. readLines()
  8. copyLarge()
  9. lineIterator()
  10. readFully()

org.apache.commons.io.FileUtils

  1. deleteDirectory()
  2. readFileToString()
  3. deleteQuietly()
  4. copyFile()
  5. writeStringToFile()
  6. forceMkdir()
  7. write()
  8. listFiles()
  9. copyDirectory()
  10. forceDelete()

org.apache.commons.lang.StringUtils

  1. isBlank()
  2. isNotBlank()
  3. isEmpty()
  4. isNotEmpty()
  5. equals()
  6. join()
  7. split()
  8. EMPTY
  9. trimToNull()
  10. replace()
方法 说明
StringUtils.isEmpty 判断字符串是否为空
StringUtils.isNotEmpty 判断字符串是否非空
StringUtils.isBlank 判断字符串是否为空,为null或者size==0或者只存在空白字符(如””),则返回true
StringUtils.isNotBlank 判断字符串是否为非空
  1. //StringUtils.isEmpty
  2. System.out.println(StringUtils.isEmpty("")); //true
  3. System.out.println(StringUtils.isEmpty(" ")); //false
  4. //StringUtils.isNotEmpty
  5. System.out.println(StringUtils.isNotEmpty("")); //false
  6. //StringUtils.isBlank
  7. System.out.println(StringUtils.isBlank("")); //true
  8. System.out.println(StringUtils.isBlank(" ")); //true
  9. //StringUtils.isNotBlank
  10. System.out.println(StringUtils.isNotBlank(" ")); //false

org.apache.http.util.EntityUtils

  1. toString()
  2. consume()
  3. toByteArray()
  4. consumeQuietly()
  5. getContentCharSet()

org.apache.commons.lang3.StringUtils

  1. isBlank()
  2. isNotBlank()
  3. isEmpty()
  4. isNotEmpty()
  5. join()
  6. equals()
  7. split()
  8. EMPTY
  9. replace()
  10. capitalize()

org.apache.commons.io.FilenameUtils

  1. getExtension()
  2. getBaseName()
  3. getName()
  4. concat()
  5. removeExtension()
  6. normalize()
  7. wildcardMatch()
  8. separatorsToUnix()
  9. getFullPath()
  10. isExtension()

org.springframework.util.StringUtils

  1. hasText()
  2. hasLength()
  3. isEmpty()
  4. commaDelimitedListToStringArray()
  5. collectionToDelimitedString()
  6. replace()
  7. delimitedListToStringArray()
  8. uncapitalize()
  9. collectionToCommaDelimitedString()
  10. tokenizeToStringArray()

org.apache.commons.lang.ArrayUtils

  1. contains()
  2. addAll()
  3. clone()
  4. isEmpty()
  5. add()
  6. EMPTY_BYTE_ARRAY
  7. subarray()
  8. indexOf()
  9. isEquals()
  10. toObject()

org.apache.commons.lang.StringEscapeUtils

  1. escapeHtml()
  2. unescapeHtml()
  3. escapeXml()
  4. escapeSql()
  5. unescapeJava()
  6. escapeJava()
  7. escapeJavaScript()
  8. unescapeXml()
  9. unescapeJavaScript()

org.apache.http.client.utils.URLEncodedUtils

  1. format()
  2. parse()

org.apache.commons.codec.digest.DigestUtils

  1. md5Hex()
  2. shaHex()
  3. sha256Hex()
  4. sha1Hex()
  5. sha()
  6. md5()
  7. sha512Hex()
  8. sha1()

org.apache.commons.collections.CollectionUtils

  1. isEmpty()
  2. isNotEmpty()
  3. select()
  4. transform()
  5. filter()
  6. find()
  7. collect()
  8. forAllDo()
  9. addAll()
  10. isEqualCollection()
方法 说明
CollectionUtils.isEmpty 判断集合是否为空,为null或者size==0,返回true
CollectionUtils.isNotEmpty 判断集合是否为非空
  1. List<Integer> emptyList = new ArrayList<>();
  2. List<Integer> nullList = null;
  3. List<Integer> notEmptyList = new ArrayList<>();
  4. notEmptyList.add(1);
  5. //CollectionUtils.isEmpty
  6. System.out.println(CollectionUtils.isEmpty(emptyList)); //true
  7. System.out.println(CollectionUtils.isEmpty(nullList)); //true
  8. System.out.println(CollectionUtils.isEmpty(notEmptyList)); //false
  9. //CollectionUtils.isNotEmpty
  10. System.out.println(CollectionUtils.isNotEmpty(emptyList)); //false
  11. System.out.println(CollectionUtils.isNotEmpty(nullList)); //false
  12. System.out.println(CollectionUtils.isNotEmpty(notEmptyList)); //true

org.apache.commons.lang3.ArrayUtils

  1. contains()
  2. isEmpty()
  3. isNotEmpty()
  4. add()
  5. clone()
  6. addAll()
  7. subarray()
  8. indexOf()
  9. EMPTY_OBJECT_ARRAY
  10. EMPTY_STRING_ARRAY

org.apache.commons.beanutils.PropertyUtils

  1. getProperty()
  2. setProperty()
  3. getPropertyDescriptors()
  4. isReadable()
  5. copyProperties()
  6. getPropertyDescriptor()
  7. getSimpleProperty()
  8. isWriteable()
  9. setSimpleProperty()
  10. getPropertyType()

org.apache.commons.lang3.StringEscapeUtils

  1. unescapeHtml4()
  2. escapeHtml4()
  3. escapeXml()
  4. unescapeXml()
  5. escapeJava()
  6. escapeEcmaScript()
  7. unescapeJava()
  8. escapeJson()
  9. escapeXml10()

org.apache.commons.beanutils.BeanUtils

  1. copyProperties()
  2. getProperty()
  3. setProperty()
  4. describe()
  5. populate()
  6. copyProperty()
  7. cloneBean()