Hi,
I’m trying to extract files/folders from directories/subdirectories and put everything in a list. I made it work in Java. Here’s the code snippet i have tried so far.
In Shared tab -
SOURCE
public static void Extract(String directoryName)
{
try{
File directory = new File(directoryName);
//get all the files from a directory
File[] fList = directory.listFiles();
//for (File file : fList)
for (int i = 0; i < fList.length; i++)
{
if (fList[i].isFile()){
} else if (fList[i].isDirectory())
{
//Extract(file.getAbsolutePath());
dirList[i].add(directory.getAbsolutePath());
i++;
}
}
}
catch(Exception exception)
{
//throw new ServiceException("Internal Server Error - Files names could not be retrieved");
}
}
In the source, what im trying to do is, if its a directory im trying to call the same function again. but im not able to get the list of folders in the directories/subdirectories.