Directory Search Recursive
7
Remove newslines from a string.
9
Copy a file to a new location, optionally marking the file as a temporary file (to be deleted on application exit).
Note there are issues for temporary files - not all the parent directories that might be created are guaranteed to be deleted - only the immediate parent directory will be deleted on exit if created. Other higher-level directories will not be deleted, even if the file is marked as temporary.
Note there are issues for temporary files - not all the parent directories that might be created are guaranteed to be deleted - only the immediate parent directory will be deleted on exit if created. Other higher-level directories will not be deleted, even if the file is marked as temporary.
12
If you have ever written a website or java application where people paste stuff in from Word, you are likely to have hit the problem of Word using high ascii chars for "open quotes", "close quotes", reg symbol, etc...
This java class (with a single static method) can replace the most prevalent of these with normal ascii values
Hope it helps someone...
This java class (with a single static method) can replace the most prevalent of these with normal ascii values
Hope it helps someone...
9
I came across this in the Java Docs, in my ever growing attempt to learn Java.
I needed to implement custom listener events.
I needed to implement custom listener events.
3
Make a new directory
8
Read a eight bytes in little endian order from the given InputStream and create a long out of them.
9
A utility class that gets the MD5 hash of an input stream. Also includes a method for converting byte array to hex-formatted string.
8
Convert a password returned by JPasswordField::getPassword() into a String.
8
I needed these for a recent project, bits and bytes constants.
-3
I actually like SQL. So, things like Hibernate with it's own query language don't quite fit my style. But, I don't want to code the same catch SQLException conn.close over and over either. So, I came up with this.
The idea is you extend SQLCommand (usually anonymously) override getSql(), and call execute() to get a list of whatever objects you are selecting - all the cleanup stuff is taken care of. It also handles nullable attributes more intuitively using ResultSetWrapper and PreparedStatementWrapper so that in your overridden getRow(ResultSetWrapper rs) method, you can call getInt on a nullable column and have it return null - what a concept! Also I like java.util.Date for my dates, so the wrappers convert to/from java.sql.Timestamp.
Right now I've only bothered with some basic types - it should be pretty clear how to add more if you need em.
See what ya'll think.
Oh, it uses JDK 1.5 Generics, but stripping that away would be pretty easy if you wanted 1.2 compliance.
The idea is you extend SQLCommand (usually anonymously) override getSql(), and call execute() to get a list of whatever objects you are selecting - all the cleanup stuff is taken care of. It also handles nullable attributes more intuitively using ResultSetWrapper and PreparedStatementWrapper so that in your overridden getRow(ResultSetWrapper rs) method, you can call getInt on a nullable column and have it return null - what a concept! Also I like java.util.Date for my dates, so the wrappers convert to/from java.sql.Timestamp.
Right now I've only bothered with some basic types - it should be pretty clear how to add more if you need em.
See what ya'll think.
Oh, it uses JDK 1.5 Generics, but stripping that away would be pretty easy if you wanted 1.2 compliance.









