Norconex Commons Lang Changelog

What's new in Norconex Commons Lang 3.0.0 Snapshot 20231113

Nov 13, 2023
  • New New SemanticVersion and SemanticVersionParser classes.
  • New New PackageManifest class.
  • New New JarDuplicates#get(File) method and collection based constructor.
  • New New StringUtil #ifBlank and #ifNotBlank methods.
  • New New FluentPropertyDescriptor methods: #isReadable, #isWritable, #readValue, and #writeValue.
  • New FluentPropertyDescriptor now has added support for builder-style accessor methods.
  • New New BeanUtil methods: #getPropertyDescriptors(Class), #getWriteMethod, #getReadMethod, #isWritable, #isReadable (the last two replaces the now deprecated #isGettable and #isSettable).
  • New New SystemCommand methods: #getErrorListeners and #getOutputListeners.
  • New New FileUtil#isFile methods providing a null-safe variant to File#isFile or Files#isRegularFile.
  • New New FileUtil#isFile methods providing a null-safe variant to File#isDirectory or Files#isDirectory.
  • New New FileUtil#toPath methods providing a null-safe variant to File#toPath.
  • New New FileUtil#toPaths methods.
  • New New JarDuplicates#getAllButGreatest method.
  • New New JarFile#toJarFiles methods.
  • New New #getMapChangeListeners and #clearMapChangeListeners methods on ObservableMap and MapChangeSupport.
  • New New TextMatcher #trim and #matchEmpty methods.
  • New New Regex #trim and #matchEmpty methods.
  • New New Credentials constructors accepting username, password, and password key.
  • New New DateUtil date conversion methods using UTC.
  • New New YearMonthDay LocalDate constructor plus new #toLocalDate and #toLocalDateTime methods.
  • Updated Now require Java 11+.
  • Updated Taglets rewritten to use the new jdk.javadoc.doclet.* API.
  • Updated Event name now included in generated string from Event#toString().
  • Updated Introduced Lombok.
  • Updated Huge jump in unit test code coverage.
  • Updated CollectionUtil#toArray now returns an empty array instead of null when a null collection is supplied.
  • Updated ConfigurationLoader#setVariablesFile now assumes the variables file is of the ".variables" format when its extension is neither ".variables" nor ".properties".
  • Updated Converter#toString(Object, String) will now return the default value when the object is null.
  • Updated EncryptionUtil#main(String[]) no longer issue a System#exit.
  • Updated EventManager#removeListener not remove entries by identity to be consistent with add methods.
  • Updated EqualUtil now considers supplying an empty vargars as always non equal.
  • Updated FileUtil#head now returns lines in order they are read.
  • Updated FileUtil#deleteEmptyDirs now deletes directories with empty directories, recursively.
  • Updated FileUtil#deleteEmptyDirs now throws IOException.
  • Updated FileUtil#deleteEmptyDirs methods were overloaded to support Path.
  • Updated FileUtil#dirEmpty method was overloaded to support Path.
  • Updated FileUtil#moveFile was overloaded to support Path and now creates missing directories in destination path. I also waits half a second between retries (was 1 second).
  • Updated FileUtil#moveFileToDir was overloaded to support Path.
  • Updated FileUtil#dirHasFile was overloaded to support Path.
  • Updated Dependency "java.xml.bind" replaced by "jakarta.xml.bind".
  • Updated ByteArrayOutputStream#toString method was overloaded to support Charset.
  • Updated IInputStreamFilter is now deprecated in favor of a string Predicate.
  • Updated JarDuplicates #hasVersionConflict and #getLatestVersion methods have been deprecated in favor of #areEquivalent and #getGreatest respectively.
  • Updated JarFile #getPath has been deprecated in favor of #toFile.
  • Updated JarDuplicateFinder#findJarDuplicates method was overloaded to also support collection of files.
  • Updated JarCopier now distinguish between source action and target action when resolving jar conflicts. Deprecated integer-based on-conflict strategies in favor of OnJarConflict.
  • Updated PropertyMatcher now support null field and value matchers.
  • Updated PropertyMatchers#addAll(varargs) now returns a boolean with a true value if the list has changed. Null values are now ignored.
  • Updated Regex#setFlags now returns itself.
  • Updated YearMonthDay methods affected by time-zone now always use UTC.
  • Updated YearMonthDayInterval now supports null values to represent infinity.
  • Updated XML now implements #equals and #hashCode.
  • Updated XML#populate and XML#validate methods no longer return a list of errors. Relies on ErrorHandler instead.
  • Updated XML#join has been deprecated.
  • Updated Added extra safety checks in XMLUtil to prevent XXE attacks.
  • New TextMatcher now considers null values as non-matching by defualt.
  • Fixed Properties#loadFromXML is now null-safe.
  • Fixed Fixed CollectionUtil#testRemoveNulls having opposite effect.
  • Fixed Fixed ConfigurationLoader not resolving fragment ".variables" file properly when including or parsing fragments.
  • Fixed Fixed CircularRange#is(...) always throwing IllegalArgumentException.
  • Fixed Fixed FileUtil#tail now always reading lines properly.
  • Fixed Fixed FileUtil#visitEmpty dir not always returning only empty dirs.
  • Fixed Fixed WebFile#compareTo throwing a ClassCastException when comparing to another WebFile instance.
  • Fixed Fixed some InputStreamConsumer#consume methods not registering listeners.
  • Fixed Fixed IOUtil#consumeUntil(Reader, IntPredicate) behaving like "consumeWhile".
  • Fixed Fixed DateUtil#toDate[...](Instant) not converting non UTC dates properly.
  • Removed Removed a number of classes and methods deprecated in previous major release: *.lang.config.IXMLConfigurable, *.lang.encrypt.EncryptionXMLUtil, *.lang.StringUtil, *.lang.map.Properties#set[...], *.lang.map.PropertyMatcher#[...], ProxySettings get|setProxy[...], DurationUtil, DataUnit#convert, DataUnit@to[...]., DataUnitFormatter constructors.
  • Removed Removed #finalize method from CachedInputStream and CachedOutputStream (finalize is deprecated in the Java API since Java 9).

New in Norconex Commons Lang 2.0.2 (Jul 9, 2023)

  • Fixed NullPointerException when obtaining library version without a Jar manifest.
  • Fixed Fixed NullPointerException in VersionUtil when source cannot be resolved.

New in Norconex Commons Lang 3.0.0 Snapshot (Nov 24, 2022)

  • New: SemanticVersion and SemanticVersionParser classes.
  • New PackageManifest class.
  • New JarDuplicates#get(File) method and collection based constructor.
  • New StringUtil #ifBlank and #ifNotBlank methods.
  • New FluentPropertyDescriptor methods: #isReadable, #isWritable, #readValue, and #writeValue.
  • New: FluentPropertyDescriptor now has added support for builder-style accessor methods.
  • New BeanUtil methods: #getPropertyDescriptors(Class), #getWriteMethod, #getReadMethod, #isWritable, #isReadable (the last two replaces the now deprecated #isGettable and #isSettable).
  • New SystemCommand methods: #getErrorListeners and #getOutputListeners.
  • New FileUtil#isFile methods providing a null-safe variant to File#isFile or Files#isRegularFile.
  • New FileUtil#isFile methods providing a null-safe variant to File#isDirectory or Files#isDirectory.
  • New FileUtil#toPath methods providing a null-safe variant to File#toPath.
  • New FileUtil#toPaths methods.
  • New JarDuplicates#getAllButGreatest method.
  • New JarFile#toJarFiles methods.
  • New New #getMapChangeListeners and #clearMapChangeListeners methods on ObservableMap and MapChangeSupport.
  • New TextMatcher #trim and #matchEmpty methods.
  • New Regex #trim and #matchEmpty methods.
  • New Credentials constructors accepting username, password, and password key.
  • New DateUtil date conversion methods using UTC.
  • New YearMonthDay LocalDate constructor plus new #toLocalDate and #toLocalDateTime methods.
  • Updated: Now require Java 11+.
  • Updated: Taglets rewritten to use the new jdk.javadoc.doclet.* API.
  • Updated: Event name now included in generated string from Event#toString().
  • Updated: Introduced Lombok.
  • Updated: Huge jump in unit test code coverage.
  • Updated: CollectionUtil#toArray now returns an empty array instead of null when a null collection is supplied.
  • Updated: ConfigurationLoader#setVariablesFile now assumes the variables file is of the ".variables" format when its extension is neither ".variables" nor ".properties".
  • Updated: Converter#toString(Object, String) will now return the default value when the object is null.
  • Updated: EncryptionUtil#main(String[]) no longer issue a System#exit.
  • Updated: EventManager#removeListener not remove entries by identity to be consistent with add methods.
  • Updated: EqualUtil now considers supplying an empty vargars as always non equal.
  • Updated: FileUtil#head now returns lines in order they are read.
  • Updated: FileUtil#deleteEmptyDirs now deletes directories with empty directories, recursively.
  • Updated: FileUtil#deleteEmptyDirs now throws IOException.
  • Updated: FileUtil#deleteEmptyDirs methods were overloaded to support Path.
  • Updated: FileUtil#dirEmpty method was overloaded to support Path.
  • Updated: FileUtil#moveFile was overloaded to support Path and now creates missing directories in destination path. I also waits half a second between retries (was 1 second).
  • Updated: FileUtil#moveFileToDir was overloaded to support Path.
  • Updated: FileUtil#dirHasFile was overloaded to support Path.
  • Updated: Dependency "java.xml.bind" replaced by "jakarta.xml.bind".
  • Updated: ByteArrayOutputStream#toString method was overloaded to support Charset.
  • Updated: IInputStreamFilter is now deprecated in favor of a string Predicate.
  • Updated: JarDuplicates #hasVersionConflict and #getLatestVersion methods have been deprecated in favor of #areEquivalent and #getGreatest respectively.
  • Updated: JarFile #getPath has been deprecated in favor of #toFile.
  • Updated: JarDuplicateFinder#findJarDuplicates method was overloaded to also support collection of files.
  • Updated: JarCopier now distinguish between source action and target action when resolving jar conflicts. Deprecated integer-based on-conflict strategies in favor of OnJarConflict.
  • Updated: PropertyMatcher now support null field and value matchers.
  • Updated: PropertyMatchers#addAll(varargs) now returns a boolean with a true value if the list has changed. Null values are now ignored.
  • Updated: Regex#setFlags now returns itself.
  • Updated: YearMonthDay methods affected by time-zone now always use UTC.
  • Updated: YearMonthDayInterval now supports null values to represent infinity.
  • Updated: XML now implements #equals and #hashCode.
  • Updated: XML#populate and XML#validate methods no longer return a list of errors. Relies on ErrorHandler instead.
  • Updated: XML#join has been deprecated.
  • Updated: Added extra safety checks in XMLUtil to prevent XXE attacks.
  • New: TextMatcher now considers null values as non-matching by defualt.
  • Fixed: Properties#loadFromXML is now null-safe.
  • Fixed CollectionUtil#testRemoveNulls having opposite effect.
  • Fixed ConfigurationLoader not resolving fragment ".variables" file properly when including or parsing fragments.
  • Fixed CircularRange#is(...) always throwing IllegalArgumentException.
  • Fixed FileUtil#tail now always reading lines properly.
  • Fixed FileUtil#visitEmpty dir not always returning only empty dirs.
  • Fixed WebFile#compareTo throwing a ClassCastException when comparing to another WebFile instance.
  • Fixed some InputStreamConsumer#consume methods not registering listeners.
  • Fixed IOUtil#consumeUntil(Reader, IntPredicate) behaving like "consumeWhile".
  • Fixed DateUtil#toDate[...](Instant) not converting non UTC dates properly.
  • Removed a number of classes and methods deprecated in previous major release: *.lang.config.IXMLConfigurable, *.lang.encrypt.EncryptionXMLUtil, *.lang.StringUtil, *.lang.map.Properties#set[...], *.lang.map.PropertyMatcher#[...], ProxySettings get|setProxy[...], DurationUtil, DataUnit#convert, DataUnit@to[...]., DataUnitFormatter constructors.
  • Removed #finalize method from CachedInputStream and CachedOutputStream (finalize is deprecated in the Java API since Java 9).

New in Norconex Commons Lang 2.0.1 (Aug 30, 2022)

  • Improved URL scheme detection in HttpURL.

New in Norconex Commons Lang 2.0.1 Snapshot (Jun 28, 2022)

  • Improved URL scheme detection in HttpURL.

New in Norconex Commons Lang 2.0.0 (Jun 28, 2022)

  • Improved: XML matching of partial "class" names to prioritize exact segment matches (class names and package segments).
  • Updated: Configuration variable resolution order now is: system properties, environment variables, properties file, variables file.
  • Fixed: CachedInputStream sometimes returning invalid bytes when re-read from cache and byte values are higher than 127.
  • New: XMLFlow class for treating XML block as being a mix of predicate and consumer classes to create an execution "flow" (if, then, else...).
  • New: "stream" and "iterator" methods added to XML.
  • New: XMLUtil#createXMLEventReader(Object) method.
  • New: Operator class for quick comparable evaluation (lower than, greater than, etc.).
  • New: XML methods: remove(), insertBefore(XML), and insertAfter(XML).
  • New: Added InputStream support for creating XML.
  • New: function-related utility classes: FunctionUtil, Consumers, PredicatedConsumer, and Predicates.
  • New: FileLock class.
  • New: Properties#toProperties() method.
  • New: TextMatcher now implements BiFunction and Predicate.
  • Updated: XML now implements Iterable.
  • Fixed: PercentFormatter throwing exception on zero-value denominator.
  • New: ExceptionUtil class.
  • New: configurable TextMatcher class supporting different methods of matching/replacing (basic, csv, wildcard, regex).
  • New: MutableImage class facilitating performing basic image operations.
  • New: event-related classes for facilitating the listening and firing of events.
  • New: Converter class to convert over 20 types from/to strings.
  • New: BeanUtil class to facilitate basic reflection operations as well as traversing bean graph.
  • New: DurationFormatter.
  • New: CollectionUtil.
  • New: SystemUtil.
  • New: MapUtil.
  • New: ClassUtil.
  • New: WebFile.
  • New: OSResource.
  • New: CertificateUtil.
  • New: KeyStoreBuilder.
  • New: Credentials.
  • New: Host.
  • New: Event-related classes (Event, IEventListener, EventManager).
  • New: Regex and KeyValueExtractor classes.
  • New: Properties#loadFromBean and Properties#storeToBean methods.
  • New: FileUtil#isDirEmpty(...) methods.
  • New: Properties set, add, getValue/getLists method simplifying dealing with generics.
  • New: Properties#match, Properties#matchKeys, and Properties#matchValues methods.
  • New: XML class replacing XMLConfigurationUtil. Now relying on Java XML/XPath instead of Apache Configuration and white spaces are now always preserved. Also supports JAXB mappings.
  • New: XMLValidationError class now returned by XML validation methods.
  • New: XML ErrorHandler classes: ErrorHandlerCapturer, ErrorHandlerFailer, and ErrorHandlerLogger.
  • New: XMLUtil class helping with the creation of XML-related objects with XML Schema 1.1 support and taking care of security vulnerabilities (XXE).
  • New: XMLFormatter.
  • New: DateUtil class for converting between java.util.Date to/from local date/time.
  • New: FileUtil#createDateFormattedDirs and FileUtil#toDateFormattedDir methods.
  • New: ClassFinder methods accepting a Predicate to filter returned classes.
  • New: FileUtil#toURLDir methods.
  • New: CachedInputStream#isEmpty method.
  • New: CachedStreamFactory can now be initialized without arguments, using default initialization values or system properties.
  • New: accessors for LocalDateTime on Properties.
  • New: PropertyMatchers collection.
  • New: PropertyMatcher methods to retreive matching values, replace them, or match them more effectively using different methods (basic, regex, wildcard).
  • New: PropertySetter for encapsulating different ways to add value(s) to a Properties.
  • New: VersionUtil class.
  • New: "javadoc" package containing useful Taglets for formatting code blocks and perform dynamic includes from other files.
  • New: FluentPropertyDescriptor class.
  • New: IOUtil methods: #isEmpty(Reader), #isEmpty(InputStream), #toNonNullReader(Reader), #toNonNullInputStream(InputStream), #burrowCharacters(Reader, int), #consume(InputStream), #consume(Reader), #consumeUntil(...), #consumeWhile(...), and #closeQuietly(Closeable)
  • New: CachedInputStream#cache(...) methods.
  • New: CountingIteragor class.
  • New: FifoMap class.
  • New: DataUnitParser.
  • New: DataUnitFormatter is now mutable, and has new settings added: "binaryNotation", and "roundingMode".
  • New: methods on several other classes.
  • Updated: DataUnit now aligns with the international standard system of units by treating decimal and binary notations distinctively.
  • Updated: Now relies on Norconex Commons Maven Parent.
  • Updated: Configuration loader now tries to resolve undefined variables to system property or environment variable (in that order).
  • Updated: Improved Javadoc generation, putting more focus on class documentation.
  • Updated: PropertyMatcher now Predicate functional interface.
  • Updated: New SLF4JUtil class.
  • Updated: Now requires Java 8 or higher.
  • Updated: Now uses SLF4J instead of Log4J for logging.
  • Updated: New convenience methods on EnhancedXMLStreamWriter.
  • Updated: EncryptionXMLUtil is now deprecated (methods moved to EncryptionKey).
  • Updated: DurationParser now returns a Duration and must be instantiated. Now supports parsing French durations.
  • Updated: EqualsUtil now uses CharSequence instead of String where String was used as argument.
  • Updated: Many dependency updates, including: Apache Commons Lang 3.7, Apache Velocity 2, Junit 5, Xerces 2.12.0.
  • Updated: Some of the load/store methods in Properties have been renamed for consistency.
  • Updated: Now using Path instead (or in addition) of File in many cases.
  • Updated: *.lang.config.IXMLConfigurable now deprecated in favor of *.lang.xml.IXMLConfigurable which deals with XML object instead.
  • Updated: DurationUtil now deprecated in favor of DurationFormatter.
  • Updated: Most method arguments accepting File now accept Path also/instead.
  • Updated: Most places where regular expressions could be used now also support "basic" matching and "wildcard" as well as being able to ignore diacritical marks (e.g., accents).
  • Updated: Properties setXXX(...) and addXXX(...) methods are now deprecated in favor of add(...) and set(...) methods.
  • Updated: PropertyMatcher now implements Predicate and provide static methods for loading/saving as XML.
  • Updated: JarCopier can now run headless with new "onConflict" argument.
  • Updated: HttpURL#getQueryString() is now never null.
  • Fixed: Properties#load(Map) now handles primitive array values properly, as well as Class, Date, and File types.
  • Removed: some deprecated classes and methods from version 1.x.
  • Removed: CountingConsoleAppender, MemoryUtil#getFreeMemory(boolean).
  • Removed: Apache Configuration dependency.
  • Removed: XMLConfigurationUtil removed in favor of XML.

New in Norconex Commons Lang 2.0.0 RC 1 (Dec 1, 2021)

  • Configuration variable resolution order now is: system properties, environment variables, properties file, variables file.
  • Fixed CachedInputStream sometimes returning invalid bytes when re-read from cache and byte values are higher than 127.

New in Norconex Commons Lang 1.15.2 (Dec 1, 2021)

  • Maintenance release:
  • Added conditional checks before log4j-specific method calls not covered by "log4j-over-slf4j".

New in Norconex Commons Lang 2.0.0 Snapshot M2 (Jul 29, 2021)

  • New New XMLFlow class for treating XML block as being a mix of predicate and consumer classes to create an execution "flow" (if, then, else...).
  • New New "stream" and "iterator" methods added to XML.
  • New New XMLUtil#createXMLEventReader(Object) method.
  • New New Operator class for quick comparable evaluation (lower than, greater than, etc.).
  • New New XML methods: remove(), insertBefore(XML), and insertAfter(XML).
  • New Added InputStream support for creating XML.
  • New New function-related utility classes: FunctionUtil, Consumers, PredicatedConsumer, and Predicates.
  • New New FileLock class.
  • New New Properties#toProperties() method.
  • New TextMatcher now implements BiFunction and Predicate.
  • Updated XML now implements Iterable.
  • Fixed Fixed PercentFormatter throwing exception on zero-value denominator.

New in Norconex Commons Lang 2.0.0 Snapshot 20210728 (Jul 28, 2021)

  • New XMLFlow class for treating XML block as being a mix of predicate and consumer classes to create an execution "flow" (if, then, else...).
  • New "stream" and "iterator" methods added to XML.
  • New XMLUtil#createXMLEventReader(Object) method.
  • New Operator class for quick comparable evaluation (lower than, greater than, etc.).
  • New XML methods: remove(), insertBefore(XML), and insertAfter(XML).
  • Added InputStream support for creating XML.
  • New function-related utility classes: FunctionUtil, Consumers, PredicatedConsumer, and Predicates.
  • New FileLock class.
  • New Properties#toProperties() method.
  • TextMatcher now implements BiFunction and Predicate.
  • XML now implements Iterable.
  • Fixed PercentFormatter throwing exception on zero-value denominator.

New in Norconex Commons Lang 2.0.0 Snapshot (May 31, 2021)

  • New:
  • New XMLFlow class for treating XML block as being a mix of predicate and consumer classes to create an execution "flow".
  • New XML methods: remove(), insertBefore(XML), and insertAfter(XML).
  • New function-related utility classes: FunctionUtil, Consumers, PredicatedConsumer, and Predicates.
  • New FileLock class.
  • New Properties#toProperties() method.
  • Fixed:
  • Fixed PercentFormatter throwing exception on zero-value denominator.

New in Norconex Commons Lang 1.15.2 Snapshot (Mar 1, 2021)

  • Added conditional checks before log4j-specific method calls not covered by "log4j-over-slf4j".

New in Norconex Commons Lang 1.15.1 (Dec 22, 2019)

  • Added new normalization rules to URLNormalizer: removeQueryString, lowerCase, lowerCasePath, lowerCaseQuery, lowerCaseQueryParameterNames, lowerCaseQueryParameterValues. essiembre
  • CachedInputStream no longer truncates last character under certain conditions. essiembre
  • HttpURL#toAbsolute(String, String) will no longer try to make absolute URLs without the two slashes after colon (e.g., tel:12345).

New in Norconex Commons Lang 1.15.0 (Jun 4, 2018)

  • New EncryptionXMLUtil class offering methods to facilitate integration of EncryptionKey with IXMLConfigurable objects (or other XML objects).
  • EncryptionUtil now uses AES for encryption and supports custom key size.
  • ConfigurationLoader now sets the Velocity character encoding to UTF-8.
  • HttpURL now extract protocols before first colon, no longer requiring two forward slash. Also more lenient towards relative URLs.
  • QueryString now strips out fragments when part of a URL.

New in Norconex Commons Lang 1.14.0 (Dec 21, 2017)

  • Can now store and load Properties file as JSON.
  • New StringUtil class with truncation methods replacing the truncated part with a hash code.
  • New ResourceLoader class.
  • New ProxySettings class.
  • New CircularRange class.
  • New method variation on EhancedXMLStreamWriter to overwrite the default "writeBlanks" setting.
  • New FileUtil#createURLDirs method for creating directories matching URL segments.
  • New XMLConfigurationUtil#nullable* methods to consider empty tags/attributes as null whereas not having the tag at all uses the default value.
  • New XMLConfigurationUtil#keyExists methods to find if a key exists in XML even if empty.
  • New EqualsUtil#equalsMap(...) method for checking if two maps are equal, regardless of entry order.
  • It is now possible to pass a Charset where a string was expected for character encoding on a few utility classes.
  • Added ZIP constant to ContentType.
  • Added ICachedStream#getCacheDirectory().
  • TextReader default maxReadSize is now 10 million characters (from 128,000) and now accepts -1 as the maxReadSize to mean unlimited.
  • Properties with multi-values now have their values stored as individual entries by default (as opposed to using a delimiter). Also more storing/loading options are now available.
  • TextReader#DEFAULT_MAX_READ_SIZE has been increased from 64 thousand to 10 million characters.
  • Dependency updates: Apache Commons Lang 3.6, Apache Commons Text 1.1, Open JSON 1.8.
  • ContentType now works better with types with parameters. Added two new related methods: #toBaseTypeString() and #toBaseType().
  • Fixed SystemCommand not handling arguments with spaces when they are properly quoted.
  • Fixed CachedInputStream returning -1 or throwing EOF exception when it should not.
  • Fixed QueryString setting "UTF-8" as the URL when invoking empty constructor (now blank).
  • Fixed DurationParser now returning default value in some cases where the duration was invalid (returning 0 instead).
  • Fixed CachedInputStream sometimes returning null when using #getCacheDirectory() method.
  • Removed Properties#isCaseSensitiveKeys(), deprecated since 1.8.0.

New in Norconex Commons Lang 1.12.3 (Feb 10, 2017)

  • New "exec" package containing classes moved from Norconex JEF API. Those classes provide ways to easily execute external commands as well as making code execution "retriable" in case of failure.
  • IXMLConfigurable classes having XML schemas (XSD) are now validated when loaded (using XML Schema 1.1).
  • New CountingConsoleAppender for tracking how many log events of each type were logged (log4j).
  • New ListErrorHandler which stores SAX Exceptions that can later be retrieved as lists.
  • New ClasspathResourceResolver and ClasspathInput to resolve XSD schema includes/imports relative to each other in classpath.
  • New XMLConfigurationUtil class replacing ConfigurationUtil, offering new methods: #getCSVStringArray(...), #getCSVIntArray(...), and #validate(...), #loadFromXML(...), #newInstance(Reader).
  • New IInputStreamListener, InputStreamLineListener, and InputStreamConsumer replacing now deprecated IStreamListener, and StreamGobbler. These new classes allow streaming of binary content, as well as text.
  • ConfigurationLoadedUtil now deprecated in favor of XMLConfigurationUtil. essiembre
  • Now relies on Apache Xerces to parse XML Shema 1.1.
  • Removed all classes/methods deprecated since 1.5.0: ConfigurationLoaded#loadXML(Reader in), .io.FileMonitor, .io.FileUtil, .io.IFileChangeListener, .io.IFileVisitor, .file.FileUtil#deleteFile(File), ClassFinder#findImplementors(...).

New in Norconex Commons Lang 1.12.1 (Sep 18, 2016)

  • Fixed URLNormalizer#sortQueryParameters() not handling #fragments properly.

New in Norconex Commons Lang 1.12.0 (Sep 18, 2016)

  • New URLNormalizer#addDomainTrailingSlash() method.
  • HttpURL now preserves uppercase characters in protocol.
  • Fixed HttpURL constructing URLs with null elements when protocol was not lowercase (e.g. HTTP).

New in Norconex Commons Lang 1.11.0 (Aug 26, 2016)

  • New URLNormalizer#removeTrailingSlash() method.
  • URLNormalizer#addTrailingSlash() has been deprecated in favor of URLNormalizer#addDirectoryTrailingSlash().
  • Dependency updates: Apache Commons Lang 2.6.

New in Norconex Commons Lang 1.10.0 (Aug 26, 2016)

  • New Jar-related utility classes for jar file version conflict detection and resolution.

New in Norconex Commons Lang 1.9.1 (Aug 26, 2016)

  • Dependency updates: Apache Commons IO 2.5.
  • URLStreamer now has two new "streamToString" methods that accept a character encoding argument. Versions without the character encoding argument now assume UTF-8 as opposed to OS default charset.
  • ConfigurationLoader#loadString(...) now assumes UTF-8 as opposed to OS default charset for loading variables.
  • When case-insensitive, Fixed Properties#addString(...) that was adding values multiple times when a key was previously inserted with a different case and fixed Properties#keySet() that returns the right number of keys now.

New in Norconex Commons Lang 1.9.0 (Aug 26, 2016)

  • New EncryptionUtil class to easily encrypt and decrypt any text using a security key.
  • Added support for the following BMP variations to ContentType: application/bmp, application/x-bmp, application/x-win-bitmap, image/ms-bmp, image/x-bitmap, image/x-bmp, image/x-ms-bmp, image/x-win-bitmap, image/x-windows-bmp
  • ContentType default file extension for image/jpeg is now .jpg to match most frequent usage.
  • Dependency updates: Apache Commons Collections 4.1.
  • HttpURL#toAbsolute(String, String) now handles relative URLs with no leading slashes properly (e.g. "sample.html").
  • HttpURL#getRoot(String) now returns the proper root even when the URL contains invalid characters.
  • Fixed ConfigurationUtils#newInstance(HierarchicalConfiguration, T, boolean) ignoring the "supportXMLConfigurable" argument.

New in Norconex Commons Lang 1.8.0 (Aug 26, 2016)

  • New normalization methods on URLNormalizer: #encodeNonURICharacters() and #encodeSpaces(). Spaces are no longer escaped automatically by default.
  • New HttpURL#toAbsolute(String, String) method for converting relative URLs to absolute ones, based on another absolute URL.
  • New HttpURL#encodeQueryString(String) method for properly encoding the query string portion of a URL.
  • New HttpURL#isPortDefault() method to quickly find out if a URL is using a default port for its protocol (http/https).
  • New HttpURL#getRoot() and HttpURL#getRoot(String) methods to extract the URL "root" from URLs (left part up to and including, the host name).
  • New PropertyMatcher class for easily storing a condition for matching a Properties key value.
  • HttpURL now keeps the URL fragment when present, and has accessors for it.
  • HttpURL#toString() no longer returns the port when the protocol is https and the port is 443.
  • Properties#isCaseSensitiveKeys() is now deprecated in favor of Properties#isCaseInsensitiveKeys() for consistency with constructor caseInsensitiveKeys argument.
  • Fixed URLNormalizer#removeDotSegments() is now implemented following RFC3986 prescribed algorithm.
  • Fixed URLNormalizer#removeDuplicateSlashes() to no longer consider the two slashes between the protocol and hostname as being duplicates in some cases.
  • Fixed URLNormalizer#addTrailingSlash() when the path was already ending with one. Also adds one now when there are none and the path is followed by a question mark or hash character.
  • HttpURL now sets the port as 443 when initialized with a secure URL (https).
  • Fixed possible URISyntaxException in URLNormalizer for certain URLs. essiembre
  • UTF-8 unicode values are now used to percent-encode the part portion of a URL.
  • When Woodstox factory is used as the XML parser, now disables structure validation which can cause issues when you want to use the xml writer on a stream that already has XML written to it (could cause "multiple roots" error).

New in Norconex Commons Lang 1.6.2 (Aug 26, 2016)

  • Added static methods HttpURL#toURL(String), HttpURL#toURI(String) and regular method HttpURL#getEncoding(). Can now specify URL encoding (charset) at construction time. Also added encodePath(String) method for URL-encoding the path portion of a URL.
  • Added new method QueryString#getEncoding().
  • URLNormalizer now converts spaces to + instead of . In addition, it no longer URL-encodes characters when sorting or removing empty parameters (except for converting spaces to +).
  • ConfigurationUtil#newInstance(...) will now log an ERROR instead of DEBUG when a class is specified but not found in classpath.

New in Norconex Commons Lang 1.6.1 (Aug 26, 2016)

  • Added a length() method to CachedInputStream. essiembre
  • Fix NullPointerException when passing a date array containing null values in Properties#datesToStringArray(Date...). essiembre
  • Fix TextReader#readText(...) which could sometimes take forever to return (if ever). essiembre
  • Library update: Apache Commons Lang 3.4.

New in Norconex Commons Lang 1.6.0 (Mar 27, 2015)

  • New TimeIdGenerator class for generating time-based unique IDs that are guaranteed to be ordered and unique within a JVM.
  • New TextReader class for reading large text files, one chunk at a time, splitting text wisely at paragraphs/sentences/words when possible.
  • New ByteArrayOutputStream class derived from the Apache IO class of the same name, modified to offer methods to access subsets of bytes ranging form zero to the total number of bytes written so far.
  • New method IOUtil#toBufferedReader(Reader) that ensures to return either a BufferedReader wrapping original reader, or the reader itself if it already implements BufferedReader.
  • New method IOUtil#toBufferedInputStream(InputStream) that ensures to return either a BufferedInputStream wrapping original InputStream, or the input stream itself if it already implements BufferedInputStream.
  • New method IOUtil#startsWith(InputStream, byte[]) that returns true if given input stream starts the specified bytes array. (must support mark).
  • New method IOUtil#borrowBytes(InputStream, int) that gets and resets the specified number of bytes from the input stream (must support mark).
  • CachedInputStream now supports mark(int). Mark value is always unlimited (argument is ignored).
  • ContentType and ContentFamily now support for BIG2 and Quattro Pro content types.
  • ConfigurationUtil#newInstance(...) now throws an ConfigurationExceptions upon error when no default value is supplied.
  • Added SonaType snapshot repository to pom.xml.
  • Updated several maven plugins and added SonarQube maven plugin.
  • Javadoc improvements.
  • Upgraded depending libraries to the following: JUnit 4.12, Apache Commons Logging 1.2, Apache Commons Lang 3.3.2,

New in Norconex Commons Lang 1.5.0 (Nov 25, 2014)

  • Changes:
  • New pipeline-related classes for a very simple pipeline framework for encapsulating executable tasks.
  • New CachedInputStream for caching input streams for re-use. Swaps memory overflow to file.
  • New CachedOutputStream for caching output streams for re-use as InputStream. Swaps memory overflow to file.
  • New ByteBufferInputStream for reading a ByteBuffer as an InputStream.
  • New EnhancedXMLStreamWriter class to facilitate writing of primitives and other types.
  • New MemoryUtil class to quickly obtain free JVM memory.
  • New methods on EqualsUtil for String equality: #equalsAnyIgnoreCase(...) #equalsAllIgnoreCase(...), and #equalsNoneIgnoreCase(...).
  • Added content-type mappings for Content Family.
  • New #valuesOf(String...) method on ContentType.
  • Now licensed under The Apache License, Version 2.0.
  • Properties default content delimiter is now more unique.
  • Deprecated ConfigurationLoader#loadXML(Reader) in favor of ConfigurationUtil#newXMLConfiguration(Reader).
  • FileUtil#deleteEmptyDirs(File) now forces directory deletion using FileUtil#delete(File)
  • ConfigurationUtil and ConfigurationLoader now ensure full disabling in all methods of value splitting in attributes and elements.
  • FileUtil#head(File, int) now uses UTF-8 as default encoding.
  • FilteredInputStream now uses UTF-8 as default encoding, and now offers an additional constructor accepting a character encoding.
  • StreamGobbler now uses UTF-8 as default encoding, and now offers an additional constructor accepting a character encoding. Also added #getType(), #getEncoding(), and #getStreamListeners()
  • IOUtil#tail(InputStream, lineQty) now uses UTF-8 as default encoding, and now offers an overloaded method accepting a character encoding: IOUtil#tail(InputStream, String, lineQty)
  • IOUtil#head(InputStream, lineQty) now uses UTF-8 as default encoding, and now offers an overloaded method accepting a character encoding: IOUtil#head(InputStream, String, lineQty)
  • IXMLConfigurable no longer extends Serializable.
  • Fixed content type display name for application/ccxml+xml not being mapped properly.
  • FileUtil#visitAllFiles(...) method now goes beyond 1 level deep when browsing recursively.

New in Norconex Commons Lang 1.4.0 (Jul 10, 2014)

  • New ClassFinder#findSubTypes(Class) method for finding subtypes in classpath using classpath roots.
  • New DataUnit class to perform data unit (KB, MB, GB, etc) conversions much like Java TimeUnit class.
  • New PercentFormatter to format fraction values as percentage string.
  • New DataUnitFormatter to format any data unit ot a human-readable format taking into account locale and decimals.
  • New ContentType class to represent a file media/MIME type and obtain its usual name, content family, and file extension(s).
  • New ContentFamily class to represent a group of files of similar content types. Useful for content categorization.
  • Added new classes for listening to java.util.Map changes: ObservableMap, MapChangeSupport, IMapChangeListener, and MapChangeEvent.
  • Deprecation of FileUtil#deleteFile(File) in favour of FileUtil#delete(File).
  • FileUtil#delete(File) now invokes System.gc() upon deletion failure to fix a known java bug when trying to delete files on windows.
  • Properties now uses UTF-8 to load and store itself.
  • FileMonitor, FileUtil, IFileChangeListener, IFileVisitor are now found under the com.norconex.commons.lang.file package. Classes have been deprecated in former location.
  • Now requires Java 7 or higher.
  • Refactored Properties to extend ObservableMap so changes can optionally be tracked.
  • URLNormalizer no longer rejects URLs with spaces in them. It will now convert spaces to and log a warning.
  • Deprecation of ClassFinder#findImplementors(XXX) in favour of ClassFinder#findSubTypes(XXX).
  • Fix FileUtil#tail(...) method when the file has less lines than the amount requested.
  • Fix junit Properties.load to use the whole delimiter.
  • Fix Properties.remove to return null if key is non existent.
  • Fix junit test for converting IP to domain. Was failing due to wikipedia IP change.

New in Norconex Commons Lang 1.3.2 (Jun 16, 2014)

  • URLNormalizer no longer rejects URLs with spaces in them. It will now convert spaces to and log a warning.
  • Fix junit test for converting IP to domain. Was failing due to wikipedia IP change.

New in Norconex Commons Lang 1.3.1 (Mar 7, 2014)

  • Fixed missing localized text for DurationUtil.

New in Norconex Commons Lang 1.3.0 (Mar 7, 2014)

  • New YearMonthDay class for a local date without time.
  • New YearMonthDayInterval (and unit test) class for a local date range without time.
  • New FileMonitor and IFileChangeListener to be notified of file changes.
  • New methods on FileUtil: #visitEmptyDirs(File, IFileVisitor) #visitEmptyDirs(File, IFileVisitor, FileFilter) #visitAllDirs(File, IFileVisitor, FileFilter) #deleteEmptyDirs(File, Date)
  • Upgraded Apache HttpClient to version 4.3.2, Apache Commons Configuration to 1.10, and Apache Commons Lang to 3.2.1. Refactored affected code.

New in Norconex Commons Lang 1.2.0 (Mar 7, 2014)

  • New getter and setter for URL "path" on HttpURL.
  • Javadoc improvements.
  • HttpURL#getLastPathSegment() no longer returns the query string with it.
  • Jars are now closed properly in ClassFinder.
  • ClassFinder#findImplementors(...) now only returns concrete classes.

New in Norconex Commons Lang 1.1.0 (Mar 7, 2014)

  • New #toSafeFileName and #fromSafeFileName method on FileUtil for creating OS friendly file names out of any strings.
  • New DurationUtil class for nice and easy formatting of time durations.
  • Fixed NullPointerException in FileUtil when deleting empty directories.