6-Sep-20 (Created: 6-Sep-20) | More in 'CS-Java'

List FileUtils.GetFiles(String directory)


/*
********************************************************
* GetFilesAsArray
********************************************************
*/
String[] FileUtils.GetFilesAsArray(String directory)
{
	File dir = new File(directory);
	return dir.list();
}

/*
********************************************************
* ConvertArrayToList
********************************************************
*/
List CollectionUtils.ConvertArrayToList(Object []inArray)
{
	ArrayList list = new ArrrayList(inArray.Length);
	for(int i=0;i<inArray.Length;i++)
	{
		list.add(inArray[i]);
	}
	return list;
}

/*
********************************************************
* CopyArrayToList
********************************************************
*/
List CollectionUtils.CopyArrayToList(Object []inArray, List targetList)
{
	for(int i=0;i<inArray.Length;i++)
	{
		targetList.add(inArray[i]);
	}
	return targetList;
}


/*
********************************************************
* GetFiles
********************************************************
*/
List FileUtils.GetFiles(String directory)
{
	File dir = new File(directory);
	return ConvertArrayToList(dir.list());
}