java - Get the list of all files under the folder resources -


my unit test project structure looks this:

. └── src     └── test         ├── java         │   └── foo         │       └── mytest.java         └── resources             ├── file1             |-- ...             └── filen 

in mytest.java, list of files under src/test/resources/ :

file[] files = get_all_resource_files(); 

how in java?

try code:

file selected_folder = new file(system.getproperty("user.dir")+"/src/test/resources/"); file[] list_of_files = selected_folder.listfiles(); 

for viewing files under particular directory have selected files... can this...

for(int i=0; i<list_of_files.length; i++)  {    system.out.println(" file number "+(i+1)+" = "+list_of_files[i]);  } 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -