Using SSH or SFTP resources from a Java app
by ricardoz on May.22, 2009, under Security
There are many commercial SSH client libraries for Java, but it was hard to find a good open source one. Finally I stumbled upon SSHTools and I have to say it works wonderfully and the API is clean and simple.
(continue reading…)
Reload resource bundles on the fly, finally!
by ricardoz on May.13, 2009, under Tips
Ever since the very first time I used a properties file in Java I’ve wanted to be able to reload it upon a sysadmin request or some other circumstance without having to reload the whole application, reset the application server or use some dark proprietary Sun APIs. Well, finally in Java 1.6 we can do it!!
(continue reading…)
Fast collection look-ups
by ricardoz on Apr.30, 2009, under Performance, Tips
I recently had to load a bunch of objects into memory and then perform thousands of look-ups over that collection. Using the good old java.util.ArrayList just didn’t cut it, the contains() function is extremely slow (as you would guess of course since this implementation stores elements as they are inserted and without any aditional indexing structure).
(continue reading…)
Automatically serialize POJOs to and from JSON
by ricardoz on Apr.22, 2009, under JavaScript, Tips, Web related
The best tool I’ve found so far to serialize POJOs to JSON (and back again) is XStream, it’s automatic, simple and elegant, check it out.
PHP & Java interoperable encryption
by ricardoz on Jan.16, 2009, under Articles, Security, Tips
I recently faced the problem of encrypting something in PHP and decrypting it using Java, this proved to be a little more of a challenge than what it initially seemed like. (continue reading…)
Paginated lists made really easy (part 2 of 2 – back-end)
by ricardoz on Oct.27, 2008, under Articles, JavaScript, Web related
In our first installment we reviewed the front-end part of developing a paginated list using AJAX and Java. Now we will dive into the back-end of our pagination mechanism.
(continue reading…)
Setup your web server to properly serve MS Office 2007 files
by ricardoz on Oct.20, 2008, under Tips, Web related
Most web servers are missing the new MIME types needed for Office 2007 files (docx, xslx, etc.) and when you server one of this files from your web application the users browser typically tries to open them as ZIP files.
(continue reading…)
Download a file using Java
by ricardoz on Oct.10, 2008, under Tips, Web related
Download a file using Java from a URL should be a simple task, well it is :P. If you just don’t want to think too much about it here is a sample method to do it.
(continue reading…)
JarOutputStream problems on Windows
by ricardoz on Sep.08, 2008, under Tips
If you ever tried to create a JAR file from Java code using JarOutputStream on a Windows platform you might have become as frustrated as me. I ran into two problems and since they took a nice part of my sleep time I’ve decided to share them and the solutions I found.
(continue reading…)
Simple & nice Javascript date picker
by ricardoz on Sep.02, 2008, under JavaScript, Tips, Web related
Check it out at http://www.styledisplay.com/mootoolsdatepicker/, it’s quite simple to use and looks great.