Category "java"

StorageReference getFile doesn't work properly

I have a text file I'm storing on the Firebase database and I'm trying to retrieve the text as following: File tempFile = File.createTempFile("tempfile", ".txt"

Three type of action on single button

I am creating a simple counting app when the button pressed on button ACTION_DOWN and ACTION_UP store the time. When time difference is less than 300 ms increme

Springboot 202 with Apache Tomcat (TomEE)/8.5.6 (7.0.2)

I am trying to deploy Springboot 202 application on Apache Tomcat (TomEE)/8.5.6 (7.0.2). During deployment of generated war file(customotmmportal.war), I dont s

Spring Boot Creating endpoint for download logs

I created an endpoint in spring boot to download logs of the application: @Service public class LogService { public byte[] obterLog() { try {

Amstrong number using lambda Expressions in Java 8

I am fairly new to functional programming. Following is my code to check the sum of powered digits(Arsmstrong number check). Number is an input for example: 370

How to Launch the Same Job in Parallel with Spring Batch?

I am trying to launching the same Job in parallel, which the Job does reading with JdbcCurorItemReader from a database table and write it to a different table.

Restoring Interruption flag status in Java

Good Day! I have been going through the Java Docs & some online resources on properly handling the InterruptedException due to bug reported by SonarQube. Bu

Retrieving node/edge with mouse events

I'm following the official GraphStream tutorial, and as the title suggest - I'm trying to get node's by clicking on it. this is my code so far: import org.graph

How can i use a variable from an Activity to another Activty?

In my MainActivity i have a score variable, int score = 0; however i have another activity which is the DisplayScore activity (which displays the score) txtFin

getClassLoaderCache error when upgrading Gradle from 6.7 to 7.0.1

I'm fairly new to Gradle. Whenever I try to upgrade an existing project from 6.7 to 7.0.1 a traceback comes up as java.lang.NoSuchMethodException: org.gradle.ap

Build facturx invoice with Mustang library

I do try to build a factur-x using Mustang library. For minimum profile, a Buyer legal registration identifier is required. For this I build a trade party objec

Deserialize parent/child classes with different config with Jackson

I'm working on a Restful application with Spring Boot and I've defined my classes as below: class Organization { String name; } class Base { @JsonPrope

Calling an API that have username and password in Java

I'm trying to connect to an API that has a username and password with this code: try { URL url = new URL("https://url?UserName=username&Password=passwor

Is there "CASCADE ON UPDATE" functionality in Spring Boot for DB level?

How can I create CASCADE ON UPDATE funcionality Database level using Hibernate annotations? Similar to "@OnDelete(action = OnDeleteAction.CASCADE)". I don't mea

How to retrieve a specific Kubernetes deployment image tag using java api?

What I need is to retrieve image tag using java api for Kubernetes. basically, what the command kubectl -n <NAMESPACE> get deployments.apps <DEPLOYMENT

How to postpone response on netty

In my Netty application I need to postpone the response until some data (which is going to be provided by other clients) be available. It's more like Producer-C

How to validate request which built from other classes?

There is a class UserRequest class UserRequest { private Name name; private Address address; private Date dob; //getters and setters } This class is bu

java.lang.UnsatisfiedLinkError: /opt/jdk17/lib/libawt_xawt.so: libXrender.so.1: cannot open shared object file: No such file or directory

I don't understand what went wrong with me. I'm trying to run Spigot Server Core 1.18.2, and I'm constantly having problems with this library. [19:21:50 INFO]:

How to convert animated webp to gif in android / java?

I want to convert the animated webp files to gif file and looking for solution since couple of days but did not get any easy straight solution yet. I tried ffmp

Why is my collections.sort leading to different outputs in 2 arraylists with the same data [closed]

I am having some trouble sorting 2 arraylists of mine which have the exact same data, one is received through my API and the other is parsed t