Category Archives

Stuff to learn about Java

Spring Boot File Upload Asynchronously

Here is a quick cheat sheet on performing a File Upload either via a REST call or via traditional Spring MVC.  This is based on Spring Boot 1.5. First make sure your @Controller or @RestController class has a method such as this: @PostMapping(value…

Spring Boot Slow to Start on Mac

I have been building Spring Boot apps for quite some time on my macbook pro (a high end mac at that).  For quite some time it took quite a bit of time to start up Spring Boot whereas on a Windows environment it…

Spring Boot – IntelliJ IDEA Not Reloading Static Content

Seems the latest version as of November 20, 2015 of IntelliJ IDEA does not come equipped to reload Spring Boot static content on the fly such as HTML and Javascript files.  After much digging around and some help from a buddy of mine,…

Open eml files in compose mode

Before you get too excited, this solution only appears to work in Outlook and not Thunderbird.  I’ll explain a workaround for Thunderbird, but let’s first get Outlook work and the gist of what this post is about. So I had a situation where…

Java XML Parsing – Preserve XML as is during parsing

I had a unique situation where I needed to parse an XML document using Java, and I needed to preserve some of the XML in the document.  I am so used to parsing XML documents using Node and Element names etc, I could…

Splitting – Parsing a CSV String in Java

I found this to be very useful when I wanted to parse CSV strings into a Java List: Arrays.asList(someCsvString,split(“\\s*,\\s*”)); The nice part with this solution is the regex includes any spaces around the CSV.

Custom JARs in Maven

I had a situation where I have been learning Maven more and more every day and with the new application I was writing, I was splitting the code into separate maven modules/JARs.  When I was first setting up my projects, I soon came…

Comparing Values using BigDecimals in Java

Being a JDK 1.4 programmer for probably far too many years, I was never able to learn the correct ways to use some of the latest JDK 1.5+ features.  Thanks to a colleague that I work with, he was able to give me…

Iterating through HashMaps

In my JDK 1.4 world, I had a very common way of iterating through lists and maps.  Switching to JDK 1.7 had me learning so many new ways of doing things in so many areas.  One of them was iterating over HashMaps, so…

Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom

So you’ve spent countless hours trying to figure out why your pom.xml file generates the following error: Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom I spent a great deal of time looking for proxy issues etc and finally found out that the reason I was having…

Categories