How can I learn Java without tools? This article introduces the commonly used tools in Java. I have compiled them. It includes a brief introduction to some commands to give you some reference. If you want to get started with Java, these tools will be used sooner or later. Let’s take a look and familiarize yourself. The system has compiled Tools, you can know your learning direction at a glance. Let’s go to the tool directory first.
apache php mysql
begin!
Directory
One. org.apache.commons.io.IOUtils
two. org.apache.commons.io.FileUtils
three. org.apache.commons.lang.StringUtils
four . org.apache.http.util.EntityUtils
5. org.apache.commons.lang3.StringUtils
6. org.apache.commons.io.FilenameUtils
7. org.springframework.util.StringUtils
8. org.apache.commons.lang.ArrayUtils
9. org.apache.commons.lang.StringEscapeUtils / org.apache.commons. lang3.StringEscapeUtils
ten. org.apache.http.client.utils.URLEncodedUtils
eleven. org.apache.commons.codec.digest.DigestUtils
twelve . org.apache.commons.collections.CollectionUtils
13. org.apache.commons.lang3.ArrayUtils
14. org.apache.commons.beanutils.PropertyUtils
Fifteen. org.apache.commons.beanutils.BeanUtils
1. org.apache.commons.io.IOUtils
- ##closeQuietly: Close an IO stream, socket, or selector without throwing an exception, usually placed in the finally block
- toString: Convert IO stream, Uri, byte[] to String
- copy: Copy IO stream data, write from input stream to output stream, maximum support 2GB
- toByteArray: Get byte[] from input stream, URI
- write: Write bytes, characters, etc. to the output stream
- toInputStream: Convert characters to the input stream
- readLines: Read multiple lines of data from the input stream and return List
- copyLarge: Same as copy, supports copying of data above 2GB
- lineIterator: Return an iterator from the input stream, read all data according to the amount of data required by the parameters, if the data is not enough, fail
2. org.apache.commons .io.FileUtils
- deleteDirectory: Delete the folder
- readFileToString: Read the file content in character form
- deleteQueitly: delete a file or folder without throwing an exception
- copyFile: copy the file
- writeStringToFile: write the characters to the target file. If the file does not exist, create it
- forceMkdir: Force the creation of the folder. If the parent directory of the folder does not exist, create the parent
- write: write characters to the specified file
- listFiles: list the files in a directory (according to the filter)
- copyDirectory: Copy the folder
- forceDelete: Force delete the file
3. org.apache.commons.lang.StringUtils
- isBlank: Whether the string is empty (judged after trimming)
- isEmpty: Whether the string is empty (judged without trimming)
- equals: Whether the strings are equal
- join: merge the arrays into a single string, the delimiter can be passed
- split: Split the string
- EMPTY: Return the empty string
- trimToNull: If the trim is an empty string, it will be converted to null
- replace: Replace string
4. org.apache.http.util.EntityUtils
- toString: Convert Entity to a string
- consume: Ensure that all contents in Entity are consumed. You can see that the content of Entity is consumed again in the source code. If the user does not consume it, it will be consumed when calling Entity
- toByteArray: Convert Entity to byte stream
- consumeQuietly: Same as consume, but does not throw an exception
- getContentCharset: Get the encoding of the content
5. org.apache.commons.lang3.StringUtils
- isBlank: Whether the string is empty (judged after trimming)
- isEmpty: Whether the string is empty (without trimming and judging)
- equals: whether the strings are equal
- #join: merge the arrays into a single string, Passable delimiter
- split: Split the string
- EMPTY: Return the empty string
- replace: Replace string
- capitalize: Capitalize the first character
## 6. org.apache.commons.io.FilenameUtils
getExtension: Returns the file extension name-
getBaseName: Returns the file name, excluding the suffix
getName: Returns the full name of the file
concat : Combine file paths according to the command line style (see method comments for details)
removeExtension: Remove the suffix name
normalize: Normalize the path
wildcardMatch: Match wildcard characters
seperatorToUnix: Change the path separator to the unix system format, that is, /
-
getFullPath: Get the file path, excluding the file name
isExtension: Check whether the file suffix name is one of the incoming parameters (List)
7. org.springframework.util.StringUtils
hasText: Check whether the string contains text
- ##hasLength : Check whether the length of the string is greater than 0
- isEmpty: Check whether the string is empty (if passed in as an object, determine whether the object is null)
- commaDelimitedStringToArray: Convert comma-delimited String to array
- collectionToDelimitedString: Convert collection to CSV format string
- replace Replacement characters String
- delimitedListToStringArray: equivalent to split
- uncapitalize: lowercase first letter
- collectionToDelimitedCommaString: put Convert the collection to a CSV format string
- tokenizeToStringArray: basically the same as split, but can automatically remove blank words
8. org.apache .commons.lang.ArrayUtils
- contains: Whether it contains a certain string
- addAll: Add the entire array
- clone: clone an array
- isEmpty: whether the array is empty
- add: add elements to the array
- subarray: Intercept array
- indexOf: Find the subscript of an element
- isEquals: Compare arrays for equality
- toObject: Convert the basic type data array to the corresponding Object array
##9. org.apache.commons.lang.StringEscapeUtils / org.apache .commons.lang3.StringEscapeUtils
unescapeHtml4: escape html escapeHtml4: anti-escape html-
escapeXml: Escape xml unescapeXml: Unescape xml-
##escapeJava: Escape unicode encoding
- escapeEcmaScript: Escape EcmaScript characters
-
unescapeJava: Escape unicode encoding
-
escapeJson: Escape json characters
-
escapeXml10: Escape Xml10
-
(It is recommended to use the method in the commons-text package. )
10. org.apache.http.client.utils.URLEncodedUtils
format: Format parameters, return an HTTP POST or HTTP PUT available application/x- www-form-urlencoded string
-
parse: Convert String or URI to List
##11. org.apache .commons.codec.digest.DigestUtils
md5Hex:MD5 encryption, return 32-bit string
sha1Hex:SHA-1 encryption
sha256Hex:SHA-256 encryption
sha512Hex:SHA-512 encryption
md5:MD5 encryption , returns a 16-bit string
Twelve. org.apache.commons.collections.CollectionUtils
isEmpty: Whether it is empty
select: Filter collection elements according to conditions
transform: Process collection elements according to the specified method, similar to List's map()
filter: filter elements, filter() of Reiser List
find: basically the same as select
collect: and transform is almost the same, but returns a new array
forAllDo: Call the specified method of each element
isEqualCollection: Determine whether the two collections are consistent
Thirteen. org.apache.commons.lang3.ArrayUtils
##contains: Whether to contain a certain string
- addAll: Add the entire array
- clone: Clone an array
- isEmpty: Whether the array is empty
- add: Add elements to the array
- subarray: Intercept the array
- indexOf: Find the subscript of an element
- isEquals: Compares whether the arrays are equal
- toObject: Converts the basic type data array to the corresponding Object array
- Fourteen. org.apache.commons.beanutils.PropertyUtils
##getProperty: Get the object property value
setProperty: Set the object property Value getPropertyDiscriptor: Get the property descriptor isReadable: Check whether the property is accessible copyProperties: Copy property values from one object to another getPropertyDiscriptors: Get all property descriptors isWriteable: Check whether the property is available Write getPropertyType: Get the object property type-
15. org.apache.commons.beanutils.BeanUtils
copyPeoperties: Copy attribute values from one object to another (note the import package Error, public static void copyProperties(Object dest, Object orig)Copy orig to dest)
getProperty: Get the object property value
setProperty : Set the object attribute value
populate: Copy the attribute according to the Map
copyPeoperty: Copy a single value, from one object to another object
cloneBean: Clone bean instance
(copyPeoperties (Object source, Object target) in org.springframework.beans.BeanUtils) copies the source to b)
end:
This is the end of my article sharing. Thank you everyone for browsing and if you have any ideas or differences. The exchange of opinions is welcome.
Related articles:
What are the Java development tools? Recommended 16 java development tools
Introduction to common development tools for beginners
Related videos:
JAVA Beginner Getting Started Video Tutorial
The above is the detailed content of Latest compilation_Learn java, you can use these common tools. For more information, please follow other related articles on the PHP Chinese website!