skip to Main Content

Formatting date in Apache JsonToStringStyle

I am implementing toString methods for my entities. There are a lot of fields of type ZonedDateTime. Unfortunately, it's converted to extremely long text representation: java.util.GregorianCalendar[ time=1545826815293, areFieldsSet=true, areAllFieldsSet=true, lenient=true, zone=sun.util.calendar.ZoneInfo [ id= "UTC", offset=0, dstSavings=0, useDaylight=false, transitions=0, lastRule=null ],…

VIEW QUESTION

MalformedStreamException: Stream ended unexpectedly – Apache

Given: byteString is -----------------------------149742642616556 Content-Disposition: form-data; name="file"; filename="test.txt" Content-Type: text/plain test -----------------------------149742642616556-- Then this code (not optimized): Pattern pattern = Pattern.compile(BOUNDARY_PATTERN); // "(?m)\A-+\d+$" Matcher matcher = pattern.matcher(byteString); String boundary = null; while (matcher.find()) { boundary = matcher.group(); contentType = "multipart/form-data;…

VIEW QUESTION
Back To Top
Search