one method:
String filename = "test/testfiles/testDAOUpload.xml";
File testfile = new File(filename);
System.out.println(testfile.getAbsolutePath());
FileInputStream fileinput = new FileInputStream(testfile
.getAbsolutePath());
int x = fileinput.available();
byte b[] = new byte[x];
fileinput.read(b);
String xmlDocument = new String(b);
System.out.println(xmlDocument);
收藏到:
Del.icio.us