Category "java"

Stream file from S3 without downloading locally

Is it possible stream a zip file through a Java (spring boot) service from Amazon S3 without having to actually download the whole file in the service? For cont

How to initialize an entity which is represented by a Vaadin Grid's row?

I use Vaadin framework v23 for my project. A wanted to add a component column to one of my Grids, a number field. My Grid's rows are representing an entity from

Text not appearing in a linear layout?

I have created a game which has the function to build castles, the castles are put in a list that you access with a button and are shown with a linear layout. T

Query method parameters should either be a type that can be converted into a database column or a List

package com.example.hand.data; import androidx.lifecycle.LiveData; import androidx.room.Dao; import androidx.room.Delete; import androidx.room.Insert; import an

Request Body Missing in Spring while updating using PATCH API in react js

Spring shows - Resolved [org.springframework.http.converter.HttpMessageNotReadableException: Required request body is missing: public com.cg.bookstore.entities.

How to test a repository with a user that have update rights and the test needs tot add records to the database

I use mysql and spring 5, spring-data-jpa and spring-boot and JUnit5. This must be a common problem but I don't see te sollution. I have to test a repository wi

SpringBoot Sleuth/Zipkin Tracing: Issue adding a client, for Zipkin Server

Small question regarding a Java 11 + SpringBoot 2.6.7 web application, in the context of Zipkin please. I have a very simple micro services architecture SpringB

Set Java/JRE default settings which can be overridden by JAVA_TOOL_OPTIONS

I have multiple java spring boot services, which are running in docker containers and are configured via docker-compose. Each of those services need several jav

How to apply test-driven development for storing data on db?

Let us assume that the next feature that I have to develop is to store some data on a database. Following the TDD paradigm, I have to first write a failing test

Java Time & Rest API

I’ve red multiple articles and discussions and still I have some uncertainty: I’m not sure if I should use Instant or any other type to store Bookin

My Junit5 Test class not running, package XXX does not exist error

I have a maven project setup as normal: src/main/java/a/b/c/MyApp src/test/java/a/b/c/MyAppTest I am having a weird problem in IntelliJ, where my junit5 test cl

SpringBoot Sleuth/Zipkin Tracing: Issue adding a client, for Zipkin Server

Small question regarding a Java 11 + SpringBoot 2.6.7 web application, in the context of Zipkin please. I have a very simple micro services architecture SpringB

NullPointerException when MockMvc performed in unit test

I'm trying to write a Java unit test but not sure where I'm going wrong. Likely a lack of understanding. This is my test so far: @Test public void getURL() thro

How to read XFA form field and data in Java and how to convert XFA form PDF to normal PDF

I need to read XFA PDF form filled data in Java. And also we need to convert the XFA form PDF to normal PDF.

Time Format String

I am trying to decode the date-time receiving from my APIs in my required format "yyyy-MM-dd" I receive time in 2 format 1. "2022-05-05T11:32:12.542Z" 2. "2022-

How to exclude referenced libraries from being exported when you export jar in VS Code for Java project (no build tool)

I have a Java Project for a JavaBean (multiple classes in a single project) with no build tools. In eclipse, I can export this project as JAR and I can select t

context.createDatabase is not finding in preferences DataStore Android

I've just implemented Preferences by Android DataStore but I can't find "context.createDataStore" I added this dependency below implementation "androidx.datas

How to identify the source of a context object in android java?

Overview I am working on android application in java. I have Products which can be viewed as a list by customers and vendors. Problem I want to be able to utili

Is there a @LastAccessedTimestamp in JPA

I want to store the last read time in a Date column when ever someone tries to load or fetch(select query, findBy methods) a entity I had a look at @PostLoad as

Make String.format("%s", arg) display null-valued arguments differently from "null"

Consider the custom toString() implementation of a bean: @Override public String toString() { String.format("this is %s", this.someField); } This yields