Added File.basename() to resource to support file subdirectories.