commons-dost

Utilitity library for stuff that I use in multiple projects

BSD-2-CLAUSE License

Stars
4
Committers
2

This is a small library of code-pieces that I find useful in many of my projects.

It covers areas that I miss in the JDK itself and also in Apache Commons libraries, e.g. for arrays and collections, logging, networking stuff, as well as helpers for testing.

Contents

Here an (incomplete) list of bits and pieces in this lib:

  • MappedCounter - counting things easily
  • DateParser - print out things like "1h 2min ago" instead of "at 2015-04-01 16:23:23"
  • ExecutionHelper - More easily run external processes and collect their output using Apache commons-exec underneath
  • DeleteOnCloseInputStream - Delete a file as soon as the stream is closed
  • SVNLogFileParser - Parse the XML output of 'svn log --xml ...'
  • ZipFileCloseInputStream - Close a ZipFile as soon as the related InputStream (usually returned by the ZipFile) is closed
  • ZipUtils - utilities for accessing content in Zip files recursively, i.e. access a file in a zip file inside a zip file.
  • ThreadDump - get a printable output of all stack-traces similar to the output of the jstack tool
  • ObjectAccessorList - a list which wraps another list and allows to transparently access single properties of the
    type of object contained in the original list.
  • UnsupportedCollection and UnsupportedList as base implementations of Collection and List where all methods throw an exception
  • DocumentStarter - knows how to open documents of known file-types on different operating systems, usually by using platform-specific tools
  • ChromeDriverUtils - Get current installed version of Chrome and download a matching Selenium "chromedriver" executable
  • ExecutorUtil - Helpers when working with Java Executors
  • XMLHelper - Methods to create safe XML Parsers with dangerous features turned off
  • GPXTrackpointsParser - Simple parser for GPX files

Please note that some testing related pieces were moved into their own library to better separate these things. Look at http://github.com/centic9/commons-test for more details.

Use it

Gradle

compile 'org.dstadler:commons-dost:1.+'

Change it

Grab it

git clone https://github.com/centic9/commons-dost.git

Build it and run tests

cd commons-dost
./gradlew check jacocoTestReport

Release it

./gradlew --console=plain release && ./gradlew closeAndReleaseRepository
  • This should automatically release the new version on MavenCentral
  • Afterwards go to the Github releases page and add release-notes

Support this project

If you find this library useful and would like to support it, you can Sponsor the author

Licensing

  • commons-dost is licensed under the BSD 2-Clause License.
  • A few pieces are imported from other sources, the source-files contain the necessary license pieces/references.