I’ve made a program that reads the /robots.txt and the /sitemap.xml of a page and substracts the available sitemaps and stores them on the siteMapsUnsorted list. Once there I use crawler-commons library to analyze if the links are SiteMaps or SiteMapIndexes (cluster of SiteMaps). When I use it on a norm…
Tag: java
What is the latest version of opensaml?
Regarding the heading, can someone tell me what is the latest version of opensaml-saml-api? I can see that on maven repository(https://repo1.maven.org/maven2/org/opensaml/opensaml-saml-api/) it’s latest version is listed as 4.0.1 Is there any other official site where I can get hold of latest opensaml v…
Should I care about no_entry_value in trove4j?
I’m using trove4j for its primitives collections. I notice it has constructors like where no_entry_value represents null. The default value is zero. The null value in collections, like Set specially, is very important, according to my cognition. But I found trove4j did’t use this value much after …
How to add a Servlet filter in Vert.x REST API?
I have a REST API which was created purely using Vert.x, I would like to instrument it for AWS X-RAY and in order to do that I need to add a servlet filter. I’m creating a webserver like this: In the documentation for AWS X-RAY they’ve only mentioned Tomcat (https://docs.aws.amazon.com/xray/latest…
JPA repository Boolean Query – return null pointer exception
I have Java springBoot project With repository that included boolean custom query. but the system run to null pointer exception apart from return “false”. this is the query: I called the method: and this is the error: Answer Your query is designed to return whatever entity (called CustomersVsCoupo…
Create a table “ca” as a statement using values of another tables but while inserting new values, the values of “ca” doesn’t change
I want to calculate turnover like in new table called ca ‘ I have tables article (idarticle, priceBuying, priceSale, quantity), and table command have (idarticle, quantity, dateSale), I want to calculate turnover automatically everyday and insert into ca , but the problem is when I insert new values int…
How to obtain the last number different to zero in an array in Java
I have for example this array: And I want to find the last number of the array different to 0. In this case, my output should be: 9.0 My code is: But it doesn’t work. I need to highlight that the size of the array1 is always the same. But the non-zero numbers can change, in any case, all the
Should I use ThreadLocal to store connections?
I code my Test project and it is prohibited to use Spring and Hibernate there. I wanted to manage my transactions from Service layer. For this I have created a class that gets a Connection from the pool and puts it in the ThreadLocal. This is an example of the fields and the method. The class has also close, …
How to get from parse tree to Java class file
I am working on a command-line tool with the following functionality: Parse modified .java files using an extended ANTLR4 Java9 grammar. The syntax in the files is Java, with one modification to the method declaration which includes a purpose, like in this example: public void {marketing} sendEmail() {} Colle…
how to set a task to run twice a day at specified times in Java
I have a java class that is a basic task that inherits from the TimerTask class. Then I have some tasks that inherit from the basic task. for example class MyTask and I want MyTask to run twice a day at 9 and at 11.45. code: Main class: config file: How to implement this? Answer You can use ScheduledExecutorS…