Bonjour,
Je voudrais lire un flux XHTML renvoyé par une page php (http://localhost/skyline/panel.php). Voici ma classe qui le fait
l'uri est bonne j'ai vérifié, mais voila que j'ai
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39 package org.skyrecon.skyline.parsers; import java.io.FileNotFoundException; import java.io.FileReader; import javax.xml.stream.XMLEventReader; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.events.XMLEvent; public class XHTMLParser { private XMLInputFactory inputFactory = null; private XMLEventReader xmlEventReader = null; public XHTMLParser(String uri) throws FileNotFoundException, XMLStreamException { this.inputFactory = XMLInputFactory.newInstance(); System.out.println(uri); FileReader reader = new FileReader(uri); this.xmlEventReader = inputFactory.createXMLEventReader(reader); while (xmlEventReader.hasNext()) { XMLEvent xmlEvent = xmlEventReader.nextEvent(); if (xmlEvent.isStartElement()) { System.out.print(" " + xmlEvent.asStartElement().getName() + " "); } else if (xmlEvent.isCharacters()) { System.out.print(" " + xmlEvent.asCharacters().getData() + " "); } else if (xmlEvent.isEndElement()) { System.out.print(" " + xmlEvent.asEndElement().getName() + " "); } } this.xmlEventReader.close(); } }
on dirait que la classe FileReader modifie mon URI.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 Exception in thread "main" java.io.FileNotFoundException: http:\localhost\skyline\panel.php (Syntaxe du nom de fichier, de répertoire ou de volume incorrecte) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(Unknown Source) at java.io.FileInputStream.<init>(Unknown Source) at java.io.FileReader.<init>(Unknown Source) at org.skyrecon.skyline.parsers.XHTMLParser.<init>(XHTMLParser.java:19) at org.skyrecon.skyline.emulation.core.VirtualUser.connect(VirtualUser.java:76) at org.skyrecon.skyline.emulation.core.Main.testMarwan(Main.java:23) at org.skyrecon.skyline.emulation.core.Main.main(Main.java:18)
Est ce que qu'elqu'un saurait me résoudre cela (je cherche aussi) ?
Partager