Home  >  Article  >  Java  >  Latest compilation_Learn java, you can use these common tools

Latest compilation_Learn java, you can use these common tools

php是最好的语言
php是最好的语言Original
2018-08-01 16:04:211647browse

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

  1. ##closeQuietly: Close an IO stream, socket, or selector without throwing an exception, usually placed in the finally block

  2. toString: Convert IO stream, Uri, byte[] to String

  3. copy: Copy IO stream data, write from input stream to output stream, maximum support 2GB

  4. toByteArray: Get byte[] from input stream, URI

  5. write: Write bytes, characters, etc. to the output stream

  6. toInputStream: Convert characters to the input stream

  7. readLines: Read multiple lines of data from the input stream and return List

  8. copyLarge: Same as copy, supports copying of data above 2GB

  9. 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

  1. deleteDirectory: Delete the folder

  2. readFileToString: Read the file content in character form

  3. deleteQueitly: delete a file or folder without throwing an exception

  4. copyFile: copy the file

  5. writeStringToFile: write the characters to the target file. If the file does not exist, create it

  6. forceMkdir: Force the creation of the folder. If the parent directory of the folder does not exist, create the parent

  7. write: write characters to the specified file

  8. listFiles: list the files in a directory (according to the filter)

  9. copyDirectory: Copy the folder

  10. forceDelete: Force delete the file

3. org.apache.commons.lang.StringUtils

  1. isBlank: Whether the string is empty (judged after trimming)

  2. isEmpty: Whether the string is empty (judged without trimming)

  3. equals: Whether the strings are equal

  4. join: merge the arrays into a single string, the delimiter can be passed

  5. split: Split the string

  6. EMPTY: Return the empty string

  7. trimToNull: If the trim is an empty string, it will be converted to null

  8. replace: Replace string

4. org.apache.http.util.EntityUtils

  1. toString: Convert Entity to a string

  2. 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

  3. toByteArray: Convert Entity to byte stream

  4. consumeQuietly: Same as consume, but does not throw an exception

  5. getContentCharset: Get the encoding of the content

5. org.apache.commons.lang3.StringUtils

  1. isBlank: Whether the string is empty (judged after trimming)

  2. isEmpty: Whether the string is empty (without trimming and judging)

  3. equals: whether the strings are equal

  4. #join: merge the arrays into a single string, Passable delimiter

  5. split: Split the string

  6. EMPTY: Return the empty string

  7. replace: Replace string

  8. capitalize: Capitalize the first character

  9. ## 6. org.apache.commons.io.FilenameUtils

    getExtension: Returns the file extension name
  1. getBaseName: Returns the file name, excluding the suffix

  2. getName: Returns the full name of the file

  3. concat : Combine file paths according to the command line style (see method comments for details)

  4. removeExtension: Remove the suffix name

  5. normalize: Normalize the path

  6. wildcardMatch: Match wildcard characters

  7. seperatorToUnix: Change the path separator to the unix system format, that is, /

  8. getFullPath: Get the file path, excluding the file name

  9. isExtension: Check whether the file suffix name is one of the incoming parameters (List)

7. org.springframework.util.StringUtils

  1. hasText: Check whether the string contains text

  2. ##hasLength : Check whether the length of the string is greater than 0

  3. isEmpty: Check whether the string is empty (if passed in as an object, determine whether the object is null)

  4. commaDelimitedStringToArray: Convert comma-delimited String to array

  5. collectionToDelimitedString: Convert collection to CSV format string

  6. replace Replacement characters String

  7. delimitedListToStringArray: equivalent to split

  8. uncapitalize: lowercase first letter

  9. collectionToDelimitedCommaString: put Convert the collection to a CSV format string

  10. tokenizeToStringArray: basically the same as split, but can automatically remove blank words

8. org.apache .commons.lang.ArrayUtils

  1. contains: Whether it contains a certain string

  2. addAll: Add the entire array

  3. clone: ​​clone an array

  4. isEmpty: whether the array is empty

  5. add: add elements to the array

  6. subarray: Intercept array

  7. indexOf: Find the subscript of an element

  8. isEquals: Compare arrays for equality

  9. toObject: Convert the basic type data array to the corresponding Object array

  10. ##9. org.apache.commons.lang.StringEscapeUtils / org.apache .commons.lang3.StringEscapeUtils

    unescapeHtml4: escape html
  1. escapeHtml4: anti-escape html
  2. escapeXml: Escape xml
  3. unescapeXml: Unescape xml
  4. ##escapeJava: Escape unicode encoding
  5. escapeEcmaScript: Escape EcmaScript characters
  6. unescapeJava: Escape unicode encoding
  7. escapeJson: Escape json characters
  8. escapeXml10: Escape Xml10
  9. (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
  1. parse: Convert String or URI to List
  2. ##11. org.apache .commons.codec.digest.DigestUtils

md5Hex:MD5 encryption, return 32-bit string

  1. sha1Hex:SHA-1 encryption

  2. sha256Hex:SHA-256 encryption

  3. sha512Hex:SHA-512 encryption

  4. md5:MD5 encryption , returns a 16-bit string

  5. Twelve. org.apache.commons.collections.CollectionUtils

isEmpty: Whether it is empty

  1. select: Filter collection elements according to conditions

  2. transform: Process collection elements according to the specified method, similar to List's map()

  3. filter: filter elements, filter() of Reiser List

  4. find: basically the same as select

  5. collect: and transform is almost the same, but returns a new array

  6. forAllDo: Call the specified method of each element

  7. isEqualCollection: Determine whether the two collections are consistent

  8. Thirteen. org.apache.commons.lang3.ArrayUtils

##contains: Whether to contain a certain string

  1. addAll: Add the entire array

  2. clone: ​​Clone an array

  3. isEmpty: Whether the array is empty

  4. add: Add elements to the array

  5. subarray: Intercept the array

  6. indexOf: Find the subscript of an element

  7. isEquals: Compares whether the arrays are equal

  8. toObject: Converts the basic type data array to the corresponding Object array

  9. Fourteen. org.apache.commons.beanutils.PropertyUtils

  10. ##getProperty: Get the object property value

    setProperty: Set the object property Value
  1. getPropertyDiscriptor: Get the property descriptor
  2. isReadable: Check whether the property is accessible
  3. copyProperties: Copy property values ​​from one object to another
  4. getPropertyDiscriptors: Get all property descriptors
  5. isWriteable: Check whether the property is available Write
  6. getPropertyType: Get the object property type

15. org.apache.commons.beanutils.BeanUtils

  1. 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)

  2. getProperty: Get the object property value

  3. setProperty : Set the object attribute value

  4. populate: Copy the attribute according to the Map

  5. copyPeoperty: Copy a single value, from one object to another object

  6. 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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn