public List<BoxFile> listFiles(String folderId) throws BoxSDKServiceException {
  try {
    BoxFolder folder=new BoxFolder(getBoxAPIConnection(),folderId);
    List<BoxFile> files=new ArrayList<>();
    for (    BoxItem.Info itemInfo : folder) {
      if (itemInfo instanceof BoxFile.Info) {
        BoxFile.Info fileInfo=(BoxFile.Info)itemInfo;
        files.add(fileInfo.getResource());
      }
    }
    return files;
  }
 catch (  BoxAPIException e) {
    String msg="Can't list files in folder, id: " + folderId;
    logger.error(msg,e);
    throw new BoxSDKServiceException(msg,e);
  }
}

public List < BoxFile > listFiles ( String folderId ) throws BoxSDKServiceException { try { BoxFolder folder = new BoxFolder ( getBoxAPIConnection ( ) , folderId ) ; List < BoxFile > files = new ArrayList < > ( ) ; for ( BoxItem . Info itemInfo : folder ) { if ( itemInfo instanceof BoxFile . Info ) { BoxFile . Info fileInfo = ( BoxFile . Info ) itemInfo ; files . add ( fileInfo . getResource ( ) ) ; } } return files ; } catch ( BoxAPIException e ) { String msg = "Can't list files in folder, id: " + folderId ; logger . error ( msg , e ) ; throw new BoxSDKServiceException ( msg , e ) ; } }
lists the files in a folder .
