You are 100% correct. OP is trying to work with the file name as a String instead of creating an instance of the File class.
Type: Posts; User: Junky
You are 100% correct. OP is trying to work with the file name as a String instead of creating an instance of the File class.