Created
January 17, 2019 16:31
-
-
Save vijayakumar-psg587/159da761fc45d64e8d65f6793de0672c to your computer and use it in GitHub Desktop.
FileService
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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