java

Using tools that the JDK and/or JRE provide, is there a way to view the Manifest file for a given JAR?

I'm able to read the Manifest file inside of my Java code, but I would also like to know if it's possible, and if it is, how to open up a JAR file from the command line and view its Manifest.MF file, or at the very least be able to specify a property of the Manifest.MF file and view it's value. ...

Parse URLs of major video streaming sites and generate appropriate code for embedding.

Posting a video on tumblr.com allows you to just paste the URL of the video on youtube, vimeo, whatever and tumblr automatically does the embedding for you. I assume that this would be nothing more than a mapping between an URL-regex and the belonging HTML construct for embedding the video. Or it is just parsing the response of the URL ...

Java web service client:

Hi guys, I'm developing a web service client that needs to execute operation exposed on tomcat with axis2. The client has all the wsdl files that are needed. I can't import them statically with netbeans or eclipse because the client needs to discover the wsdl at runtime (this has been already done) and then execute them in an fixed order...

Catch-all SMTP server + GUI

I was reading this post about a NetBeans plugin which intercepts all SMTP traffic and stores it for display. I find it a great tool for developing locally when you have lots of email interaction and don't want to create {x} accounts. Is there any such cross-platform tool available outside of NetBeans? ...

Create password protected zip in Java

My question is similar to this one: Write a password protected Zip file in Java, but what I need is to create password protected zip file using mechanism simpler than AES beause not every archive manager can unpack AES-protected zip files (for example WinRar is not able to do that). Do you know some free library that can password protect...

How can I inject a bean into an ApplicationContext before it loads from a file?

I have a FileSystemXmlApplicationContext and I would like the beans defined in the XML to take as a constructor argument a bean which is not declared in Spring For example, I would like to do: <bean class="some.MyClass"> <constructor-arg ref="myBean" /> </bean> So I could imagine doing this via something like: Object myBean = .....

How do I convert Double[] to double[]?

I'm implementing an interface that has functionality similar to a table that can contain an types of objects. The interface specifies the following function: double[] getDoubles(int columnIndex); Where I'm stumped is that in my implementation, I'm storing the table data in a 2D Object array (Object[][] data). When I need to return th...

Do getters and setters impact performance in C++/D/Java?

This is a rather old topic: Are setters and getters good or evil? My question here is: do compilers in C++ / D / Java inline the getters and setter? To which extent do the getters/setters impact performance (function call, stack frame) compared to a direct field access. Besides all the other reasons for using them, I would like to know...

Using Java and any external libraries, how can I draw latitude/longitude points onto a graphical representation of the Earth?

I'm currently using the Java Map Projection Library (I was able to obtain the code used for the Applet from the author and modify it for use in a desktop application - not sure if he linked to that on his website yet) to draw a map of the Earth in an application. However, I want to take this a step further. I have a set of latitude/longi...

Data access layer with Spring DAO and Hibernate.Problems

hi guys this is my first application in with spring and hibernate.So please bear with me with stupid questions :). i created a simple java application in netbeans 6.7. here are my daos interfaces UsersDAO package Dao; import Entities.Users; public interface UsersDAO { public Long GetIdByUsernameAndPasswor(String username, String ...

Sending data via a socket from Objective-C to Java

I have a Java program (call it Jack) and an Objective-C program (call it Oscar), which I run on the same Mac OS X computer. Oscar sends a string message via a socket to Jack, once per second. For reliability and performance would it be better to maintain an open socket between Jack and Oscar? Or would it be better to repeatedly open a ...

Is using synchronized on a Java DAO going to cause issues?

Is using the 'synchronized' keyword on methods in a Java DAO going to cause issues when used by a web application? I ask because I have a multi-threaded stand alone application that needs the methods to by synchronized to avoid resource conflict, as seen here. java.util.concurrent.ExecutionException: javax.persistence.PersistenceExcept...

Remove Elements from a HashSet while Iterating

So, if I try to remove elements from a Java HashSet while iterating, I get a ConcurrentModificationException. What is the best way to remove a subset of the elements from a HashSet as in the following example? Set<Integer> set = new HashSet<Integer>(); for(int i = 0; i < 10; i++) set.add(i); // Throws ConcurrentModificationExcept...

How to get the Associate HttpSession per Channel Weblogic Publish-Subscribe Server

Hi, im using Weblogic 10.3 Publish-Subscribe Server (PubServer) in order to create Comet application. http://e-docs.bea.com/wls/docs103/webapp/pubsub.html We are utilizing JMS Message system to support Clustered environment, and everything works great and as expected, however now we need to support sending User Customized data like (In...

Server Connection dies out with ICEFaces with long request

Hello, I have long HTTP request ( generating large Excel file - about 60K records or so) which takes like 5 minutes to complete. The wheel with icefaces shows connection is dead and although the file is ready on the server, ICEFaces page is dead and I have to refresh it and can't get the file! How to about extending timeout I tried the...

Utility to view threads in a Java process

I've got a java application on a windows machine which pins the CPU from time to time. Would like to run a utility to get an idea of how many threads etc that application is creating. Is there such a utility? ...

Are Java function parameters always passed-by-value?

Hello, Just a quick question about how parameters are passed in Java... ... if ((index = stdout.indexOf(pattern)) != -1) { tidy(stdout, index + pattern.length()); return true; } else if ((index = stderr.indexOf(pattern)) != -1) { tidy(stderr, index + pattern.length...

Java event handling

import java.awt.Color; import java.awt.Dimension; import javax.swing.JPanel; import javax.swing.Timer; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartMouseEvent; import org.jfree.chart.ChartMouseListener; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; import org.jfree.chart.entity.ChartEntit...

What is the easiest way to call a Java method from C++?

I'm writing a C++ program which needs to be able to read a complex and esoteric file type. I already have a Java program for handling these files which includes functionality to convert them into simpler file formats. My idea is, whenever my program needs to read info from a complex file, to have it call the Java method to convert it t...

How to improve Intellij 8?

Is there a way to improve the intellisense of intellij? I love how visual Studio intellisense works by making suggestions as you type. ...