Snippets

Vijay Kumar rexELE: Untitled snippet

Created by Vijay Kumar
@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;
	}
}

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.