Estou com um problema em conseguir localizar o XML.
Seguinte, aquiDocument doc = db.parse("\\192.168.0.253\retorno\" + codigo + "-num-lot.xml");
Exception in thread "main" java.io.FileNotFoundException: C:\java\NFE92.168.0.253\retorno1090700130132000138550010001351854632006177-num-lot.xml (O sistema não pode encontrar o caminho especificado)
File dirRetorno = new File("\\192.168.0.253\retorno");
File fListRetorno[] = dirRetorno.listFiles();
if (fListRetorno.length > 0) {
for (int i = 0; i < fListRetorno.length; i++) {
if (fListRetorno[i].getName().equals(codigo + "-num-lot.xml")) {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse("\\192.168.0.253\retorno\" + codigo + "-num-lot.xml");
System.out.println(doc.getDoctype());
Element elem = doc.getDocumentElement();
// pega todos os elementos usuario do XML
NodeList nl = elem.getElementsByTagName("DadosLoteNfe");
// percorre cada elemento usuario encontrado se usar o for
Element tag = (Element) nl.item(0);
String lote = getChildTagValue(tag, "NumeroLoteGerado");
JOptionPane.showMessageDialog(null, lote);
ConsReciNFe cons = new ConsReciNFe();
cons.reciboLote(lote);
}
}
}
}
}
public static String getChildTagValue(Element elem, String tagName) throws Exception {
NodeList children = elem.getElementsByTagName(tagName);
if (children == null) {
return null;
}
Element child = (Element) children.item(0);
if (child == null) {
return null;
}
return child.getFirstChild().getNodeValue();
}
Como faço para ele ler o caminho de outra máquina mesmo?