I am working on a project that pulls files from a third party FTP site where the files are defined by a mask, lets say ‘XXX’MMddy.FILE where XXX is the vendor code and y is the last digit of the year.
My application is only concerned with the files matching the mask, but does not care about the actual date on the file. Currently, we are building a list of dates a month back with the Java Calendar object and iterating through it to create each possible mask until one matches or is determined invalid. I feel like there should be a better way to do this…
So to reiterate, in a consise question, is there a way to use the mask without creating an instance of each date to compare to the actual filename?
i.e. XXX04022.FILE conforms to XXXMMddy.FILE
You could implement a FilenameFilter to use on
File.listFiles: