In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
The purpose of this article is to share with you what the super-practical apache Java tools refer to. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
Org.apache.commons.io.IOUtilscloseQuietly: close an IO stream, socket, or selector without throwing an exception, usually put in the finally block toString: convert IO stream, Uri, byte [] to Stringcopy:IO stream data replication, write from input stream to output stream, maximum support 2GBtoByteArray: get byte [] write from input stream, URI: put bytes. Write characters to output stream toInputStream: convert characters to input stream readLines: read multiple lines of data from the input stream, return ListcopyLarge: same as copy, support replication of data above 2GB lineIterator: return an iterator from the input stream, read all the data read according to the parameter requirements, if the data is not enough Then failed org.apache.commons.io.FileUtilsdeleteDirectory: delete folder readFileToString: read file contents as characters deleteQueitly: delete a file or folder without throwing an exception copyFile: copy a file writeStringToFile: write characters to the target file, if the file does not exist, create forceMkdir: force the creation of a folder, if the folder parent directory does not exist Then create a parent write: write characters to the specified file listFiles: enumerate files in a directory (according to filter) copyDirectory: copy folder forceDelete: force delete file org.apache.commons.lang.StringUtilsisBlank: whether the string is empty (determine after trim) isEmpty: string is empty (not trim and judge) equals: string is equal join: merge array into a single string Transferable delimiter split: split string EMPTY: if empty string trimToNull:trim is returned, it will be converted to nullreplace: replace string org.apache.http.util.EntityUtilstoString: convert Entity to string consume: ensure that all content in Entity is consumed. You can see that the content of Entity is consumed again in the source code. If the user does not consume it, the call to Entity will consume it toByteArray: convert Entity to byte stream consumeQuietly: same as consume But do not throw exception getContentCharset: get the encoding of the content org.apache.commons.lang3.StringUtilsisBlank: string is empty (determine after trim) isEmpty: string is empty (do not trim and determine) equals: string is equal join: merge array into a single string Transferable delimiter split: split string EMPTY: return empty string replace: replace string capitalize: first character uppercase org.apache.commons.io.FilenameUtilsgetExtension: return file suffix getBaseName: return file name Do not include suffix name getName: return file full name concat: combine file paths in command line style (see method notes for details) removeExtension: delete suffix names normalize: normalize paths wildcardMatch: match wildcards seperatorToUnix: path delimiters changed to unix system format, that is / getFullPath: get the file path Does not include the file name isExtension: check whether the file suffix name is an org.springframework.util.StringUtilshasText in the incoming parameter (List): check whether the string contains text hasLength: detect whether the string length is greater than 0isEmpty: detect whether the string is empty (if passed as an object) Then determine whether the object is null) commaDelimitedStringToArray: comma-separated String converted to array collectionToDelimitedString: convert the collection to CSV format string replace replace string delimitedListToStringArray: equivalent to splituncapitalize: first letter lowercase collectionToDelimitedCommaString: convert the collection to CSV format string tokenizeToStringArray: basically the same as split But can automatically remove the blank word org.apache.commons.lang.ArrayUtilscontains: whether to include a string addAll: add an entire array clone: clone an array isEmpty: whether empty array add: add elements to the array subarray: truncated array indexOf: find the subscript of an element isEquals: compare whether the array is equal toObject: convert the basic type data array to the corresponding Object array org.apache.commons.lang.StringEscapeUtilsunescapeHtml4: escape htmlescapeHtml4 : reverse htmlescapeXml: escape xmlunescapeXml: escape xmlescapeJava: escape unicode Encoding escapeEcmaScript: escape EcmaScript character unescapeJava: reverse escape unicode Encoding escapeJson: escape json character escapeXml10: escape Xml10 this is now abandoned It is recommended to use the method in the commons-text package, org.apache.http.client.utils.URLEncodedUtilsformat: format parameters, return a HTTP POST or HTTP PUT available application/x-www-form-urlencoded string parse: convert String or URI into Listorg.apache.commons.codec.digest.DigestUtilsmd5Hex:MD5 encryption, return 32-bit string sha1Hex:SHA-1 encryption, sha256Hex:SHA-256 encryption, sha512Hex:SHA-512 encryption, md5:MD5 encryption Return 16-bit string org.apache.commons.collections.CollectionUtilsisEmpty: whether empty select: filter collection elements based on criteria transform: handle collection elements according to the specified method, map () filter: filter elements similar to List, filter () find of Reiser List: basically the same as select collect: almost the same as transform But return a new array forAllDo: call the specified method of each element isEqualCollection: determine whether the two sets are consistent org.apache.commons.lang3.ArrayUtilscontains: contain a string addAll: add an entire array clone: clone an array isEmpty: empty array add: add elements to the array subarray: truncated array indexOf: find the subscript of an element isEquals: compare arrays for equality toObject: basic type data array Convert to the corresponding Object array org.apache.commons.beanutils.PropertyUtilsgetProperty: get object attribute values setProperty: set object attribute values getPropertyDiscriptor: get attribute descriptor isReadable: check whether attributes are accessible copyProperties: copy attribute values From one object to another object getPropertyDiscriptors: get all property descriptors isWriteable: check whether attributes are writable getPropertyType: get object property types org.apache.commons.beanutils.BeanUtilscopyPeoperties: copy property values, from one object to another object getProperty: get object property values setProperty: set object property values populate: copy attributes to properties according to Map copyPeoperty: copy individual values, from one object to another object cloneBean: clone bean instance
Tool class, according to Ali development manual, if you want to use util, you can't take s, and the tool class is named XxxUtils.
The above is what the super-practical apache Java tools refer to, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.