Is it possible to use the list() method of the file class to create an array of only certain file types. For example, say I wanted to search a given directory for files ending in .ser. Or would I have to create the original array using the list command then create a new array searching for the correct file types?
I found an example for filter filename and modified it to fit my application. Obviously I missed something, probably something silly. I am getting a null pointer exception. This is what I am trying to use:
First, you set f to null at line 5.
Then you call a method on f on line 26.
That's the reason of NPE.
Please provide SSCCE when asking questions.
I was not able to run your code because it missed declarations of master, Order, deserializeOrders, orderFiles, etc...
Paul Peterson wrote:Obviously I missed something, probably something silly. I am getting a null pointer exception. This is what I am trying to use:
Well, you set the "f" reference variable to null, so, when you tried to deference it to call the listFiles() method, you will get a null pointer exception.