Example usage:
apply this method to selected any files you want !
DirectoryResource dr = new DirectoryResource(); for (File f : dr.selectedFiles()) { ImageResource ir = new ImageResource(f); ir.draw(); }
DileResource: this class has a method called words() which can read all the words in a txt file. And always we started with a file class!
For me, file class has a very suitable method to get the file name, but if we want to read every word in the txt file, we should transfer this category to FileResource, just like that:
FileResource fr = new FileResource(f)
in this statement, f is the coreference of a file class.