I am trying to create an object from a connection to a server. I make the connection etc.
//get files within folder
FileObject localFileObject = fsManager.resolveFile("path to folder containing files", options);
FileObject[] childrenFiles = localFileObject.getChildren();
//now I am trying to make a list of file objects, creating a new object for each file in the folder
List<File> fileList = new ArrayList<File>();
for (int i = 0; i < childrenFiles.length; i++) {
//here I want to create a new File object with id = i,
//and name = childrenFiles[ i ].getName().getBaseName();
//I was trying to do: new File(id , name) and append this object
//to the list each iteration but no success
}
At the end I want to return the list of files back
return fileList;
Is my List created correct and how do i make a new object each time the loop goes and add to list?
Thanks