i am writing a java application (actually a Struts2 web application) and i need to store and retrieve images. i found out that it is not a good idea to store images in a database (Can I store images in MySQL) and that it is preferable to write them on disk, in a directory.
at some point i need to access all the images whose name contains a certain substring. if i used a database, i would write a query like this: select .. where name like %my_substring%
. how can i achieve the same functionality using the java file system? certainly, i don't want to load all the images, and then iterate them to find those with proper name.