Advertisement
Bordiez

Mudança

Dec 10th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. private static int lerInfoFicheiro(String nomeFich, String[][] socios, int nSocios) throws FileNotFoundException {
  2. Scanner fInput = new Scanner(new File(nomeFich));
  3. while (fInput.hasNext() && nSocios < MAX_SOCIOS) {
  4. String linha = fInput.nextLine();
  5. linha = linha.trim();
  6. if (linha.length() > 0) {
  7. if (validarCampos(linha)) {
  8. nSocios = guardarDadosSocio(linha, socios, nSocios);
  9. } else {
  10. LogErros.escreverLogErros(linha, LogErros.msgErroInsc, inputTempos);
  11. }
  12. }
  13. if ( nSocios == MAX_SOCIOS ){
  14. LogErros.escreverLogErros(linha, "A partir desta linha escedeu-se o limite de sócios.", inputSocio);
  15. }
  16. }
  17. fInput.close();
  18. return nSocios;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement