Category "java"

Download a files from FTP matching a wildcard using Java Apache Commons Net

Basically I need to download list of matching files for the search from a FTP server. I have the code to download a specific file from a FTP server. But I nee

maven fails to find files in main package: ZIP file can't be opened as a file system because an entry has a '.' or '..' element in its name

I have a maven project that I can no longer get to build: mvn clean compile ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1

RestAssured: posting json request having both String and Integer

I just want to POST json request(using restassured), for such json: { "userId": 1, "id": 111, "title":"test msg" "body": "this is test msg" } Im defining

Could not find Spring Profile when uses JUnit Runner in IDEA

I'm trying to run a JUnit Test in IntelliJ IDEA, but the Runner could not find the Spring Profile. this message is displayed in the log: --spring.profiles.acti

I can't think of a condition to increase the decrement in Gradually Decreasing Carousel app

Decrementing Carousel is a container, accepting int elements. DecrementingCarousel has a maximum capacity, specified via the constructor. When created, Decremen

Kotlin: Equivalent of property wrappers from Swift

What is the equivalent property wrappers for Kotlin: @propertyWrapper struct Foo { var wrappedValue: String { get { return "Test

Get JobParameters on RepositoryItemReader

I have a problem with the execution of the batch process that I am developing. It comprises several steps. The first one recovers data and inserts it into a ta

Custom parameter names with a bean for request parameters in Spring 5

I'm trying to use Spring 5 to have a custom bean for my request parameters. In theory this is easy, but I want to have the field names be different from the par

How to read csv using column name in java

I have tried reading a column with its index using below code: int col1; String msg = null; int i = 0; String[] array = null; File file =

Which JRE does C:\ProgramData\Oracle\Java\javapath\java.exe use?

I'm trying to figure out which environment variable java uses to find/detect the JRE used by C:\ProgramData\Oracle\Java\javapath\java.exe. As per Oracle's desi

What happens when we call finish() in onCreate() method?

What happens when we call the finish()method for the activity inside onCreate()? Will the app get time to display the Activity, but then rapidly close, or won't

AtomicReference not working to avoid race condition in java multi threading

I have a "User.java" class that has Integer variable count initially set to 0. In another class "ThreadDemo.java" I have set the User object in AtomicReference.

How to read csv using column name in java

I have tried reading a column with its index using below code: int col1; String msg = null; int i = 0; String[] array = null; File file =

Recursion: Longest Palindrome Substring

This is a very common problem in which we would have to find the longest substring which is also a palindrome substring for the given input string. Now there ar

Selection Border in JavaFX. Wanting to change default behavior with CSS

I am using validation that puts a red border around my TextFields nameTF.setStyle("-fx-text-box-border: red;"); And set it back to default using nameTF.setStyle

Java JDK VScode issues

I installed java jdk using sdkman on my windows machine. I am using wsl for this purpose. However, I need to add this to my VScode and when I look at the insta

Hibernate / Spring Data - get executed sql queries count

I'm working on presentation in which I would like to show difference in number of executed sql queries between deleteByPost() method with and without custom que

How do I create a frame with images to act as a tool tip in Java?

I've been struggling with an issue for 2 days now and I keep running into walls. When I mouse over a task on my first window I want another frame to pop up and

i'm receiving SNMP traps from network device (switchs), but how can i identify that this trap is coming from which device (switch)

I'm receiving SNMP traps from network device (switches), but how can I identify that this trap is coming from which device (switch). because trap containing onl

endpoint_failure (context canceled) resulting in duplicate call to REST Endpoint

Am invoking an REST endpoint from another service using restTemplate.exchange. The endpoint that receives the request invokes DB and fetches around 1.5 mil rec