(Reproduced: http://www.hollischuang.com/archives/1606)
GitHub Address: Https://github.com/liufeiSAP/javaStudy.git
In Java, there are a number of more useful class libraries, and they usually define a series of methods with common functionality. This article summarizes the most common Java utility classes and their most commonly used methods. Methods in both classes and classes are sorted by popularity.
The classes and methods listed in this paper are common libraries and methods which have been used in a lot of practice, and we can use them directly. Of course, the functionality of these methods can be implemented by ourselves, but since there are already very mature methods available for us to use, we do not need to define them. Many classes and methods through their names can actually understand exactly what to do. Each method has a link to see how they are specifically used in open source code.
The following list is based on the analysis of 50K open source projects.
1. Org.apache.commons.io.IOUtils
- 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
- 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 ()
Ten. Org.apache.http.client.utils.URLEncodedUtils
Org.apache.commons.codec.digest.DigestUtils.
- Md5hex ()
- Shahex ()
- Sha256hex ()
- Sha1hex ()
- SHA ()
- MD5 ()
- Sha512hex ()
- SHA1 ()
Org.apache.commons.collections.CollectionUtils.
- IsEmpty ()
- Isnotempty ()
- Select ()
- Transform ()
- Filter ()
- Find ()
- Collect ()
- Foralldo ()
- AddAll ()
- Isequalcollection ()
Org.apache.commons.lang3.ArrayUtils.
- Contains ()
- IsEmpty ()
- Isnotempty ()
- Add ()
- Clone ()
- AddAll ()
- Subarray ()
- IndexOf ()
- Empty_object_array
- Empty_string_array
Org.apache.commons.beanutils.PropertyUtils.
- GetProperty ()
- SetProperty ()
- Getpropertydescriptors ()
- IsReadable ()
- Copyproperties ()
- Getpropertydescriptor ()
- Getsimpleproperty ()
- IsWriteable ()
- Setsimpleproperty ()
- Getpropertytype ()
Org.apache.commons.lang3.StringEscapeUtils.
- UNESCAPEHTML4 ()
- ESCAPEHTML4 ()
- EscapeXML ()
- Unescapexml ()
- Escapejava ()
- Escapeecmascript ()
- Unescapejava ()
- Escapejson ()
- ESCAPEXML10 ()
Org.apache.commons.beanutils.BeanUtils.
- Copyproperties ()
- GetProperty ()
- SetProperty ()
- Describe ()
- Populate ()
- Copyproperty ()
- Clonebean ()
Top 16 Java Utility Class Library