Boa noite!
Estou com uma duvida besta eu acho hehe…
tenho um loop for onde eu percorro um array executando metodos para cada um deles…
dentor do loop tem um bloco/trycatch. Quando ocorre uma exception em 1 item do array ele para de fazer o loop.
Eu gostaria que se desse uma exception ele continuasse na prox array!
como eu faria isso?
segue minha classe
int tamanhoList = listArq.getModel().getSize();
String[] listArquivos = new String[tamanhoList];
for (int i = 0; i < listArquivos.length; i++) {
listArquivos[i] = listArq.getModel().getElementAt(i).toString();
try {
try {
Nfs nf = ler.lerNF(new File(listArquivos[i]));
// Cria channel na origem
FileChannel oriChannel = new FileInputStream(listArquivos[i]).getChannel();
// Cria channel no destino
FileChannel destChannel = new FileOutputStream("d:\temp\"+nf.getPath()+".xml").getChannel();
// Copia conteúdo da origem no destino
destChannel.transferFrom(oriChannel, 0, oriChannel.size());
ftp.transmite("d:\temp\"+nf.getPath()+".xml");
// Fecha channels
oriChannel.close();
destChannel.close();
dao.gravar(nf);
File del = new File("d:\temp\"+nf.getPath()+".xml");
del.deleteOnExit();
} catch (Exception e) {
//parou no catch "/
}