cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

how to get the file folder(directory) path in junit test class.

Former Member
0 Likes
815

I want to get the list of zip files from Media Folder /custom/coty/cotycore/resources/test/media/ in junit but when we check the condition file is directory then path is taking as false. Please provide the solution.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Likes

Hi upendar,

Please check if the directory is accessible/correct using exists() method. From File.isDirectory() documentation we can read that: "Returns: true if and only if the file denoted by this abstract pathname exists and is a directory; false otherwise".

Working from junit test class shouldn't matter in this scenario.

Hope this helps.
Best Regards,