Skip to content

Instantly share code, notes, and snippets.

@vijayakumar-psg587
Created January 17, 2019 16:31
Show Gist options
  • Save vijayakumar-psg587/159da761fc45d64e8d65f6793de0672c to your computer and use it in GitHub Desktop.
Save vijayakumar-psg587/159da761fc45d64e8d65f6793de0672c to your computer and use it in GitHub Desktop.
FileService
@Service
public class FileService {
public List<FileReadDTO> readFileFromFTPAndGenerateObjects(Path path) throws IOException{
List<FileReadDTO> list1 ;
try{
Files.lines(path).forEach(item -> System.out.println(item));
list1 = Files.lines(path).collect(new CustomFileCollector());
list1.forEach(item ->{
System.out.println(item.getPlanNbr());
System.out.println(item.getSsnNumber());
});
}catch(IOException e) {
throw new IOException("no such file");
}
return list1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment