Code Comments

Code Comments

Tips and short tutorials on various programming technologies

Code Comments RSS Feed
 
 
 
 

Posts tagged code

Search for Files in Directory Using Wildcards in Java

(Please see my previous post about how to do this for very simple cases in Java.)
Sometimes you want to be able to search for files using patterns. For example, you might want to find all the files in a directory with a .htm extension. A reasonable way to accomplish this is to use regular expressions. [...] Read more »

Find Files in Directory Using Java

It’s surprisingly (or not, depending on your opinion of Java) difficult to get a list of files matching a pattern in a directory. For example, C# makes this really easy. In Java, you need to create a class that implements the java.io.FileFilter interface.
Below is a simple example of how this interface could implemented:

import [...] Read more »