I have long cycles of GC. from checks I saw there are too many objects in the tenured (old) area of the Heap. Is there any utitlity to know which objects are in which area of the heap, or any staticstics about these objects. I am using Sun/Oracle HotSpot JVM (Java 6). EDIT: little bit more details about my pr…
Tag: java
MessageFormat not formatting when single quotes are included
I am passing in text which is combination of {} filler and text. I am trying to fill {} with some values and tried using MessageFormat. OUTPUT Answer The single quote must be escaped using a double single quote:
Amazon S3 upload file and get URL
Is it possible to upload a txt/pdf/png file to Amazon S3 in a single action, and get the uploaded file URL as the response? If so, is AWS Java SDK the right library that I need to add in my java struts2 web application? Please suggest me a solution for this. Answer To make the file public before uploading you
Proguard keep class names?
Hello I am writing an Android app and I have set up Proguard to obfuscate my application. I however use a classloader to dynamically load different extensions to my application. The problem is that these don’t load correctly if their names are changed. How do I keep Proguard from obfuscating specific cl…
System.out.print() doesn’t send any output to Eclipse console. Why?
I have the following Java class: When I run this code in Eclipse IDE, I don’t see any output in Eclipse console. If I change value 1448 and set for example 1447 or less, I see output in console (12345678…) So, maybe Eclipse IDE has restrictions on string length in console? What do you think about …
Java Tree to represent filesystem (files/dir) from list of paths
I’ve a list of paths like this So from this list of paths (Stings) I need to crete a Java Tree structure that has folders as nodes and files as leaf (there wont be empty folders as leaf). What I need I think is the add method where I pass to them a String (path of the file) and it
Possible to determine size of file to be downloaded?
I currently have the following code which reads a file located on the web and writes it to a file on the phone: Does anyone know whether it is possible (using the setup above or otherwise) to determine the total number of bytes which are to be read before commencing with the download (in order to publish perc…
formatting a string to a currency format in jasper report
I have a string with some numeric value. I want to format it in a way where hundreds are comma separated and the number is having $ dollar sign before it. e.g. 12345 should be formatted to $ 12,345.00 I tried the below code without dollar sign: and the below one with dollar sign: However, both are giving erro…
Maven error: Not authorized, ReasonPhrase:Unauthorized
I checked out my code from the Nexus repository repository. I changed the password for my account and set it correctly inside my settings.xml file. While executing mvn install clean I get the error saying Not authorized, ReasonPhrase:Unauthorized when it tries to download files from that repository. Any idea …
How to access a request attribute set by a servlet in JSP?
I’m trying to retrieve attribute values set by a servlet in a JSP page, but I’ve only luck with parameters by ${param}. I’m not sure about what can I do different. Maybe its simple, but I couldn’t manage it yet. In the JSP I have been trying to retrieve the “attribValue”, b…