private void saveSections() throws IOException { Chapter ch = new Chapter(this, "Raw data"); List list = new List(); ch.add(list); for (Section s : mSections) { String fn = mDoc.getRelRawDir() + s.getFileName(); list.add(new Link(mDoc.getRelRawDir() + s.getFileName(), s.getName())); FileOutputStream fos = new FileOutputStream(getBaseDir() + fn); PrintStream ps = new PrintStream(fos); int cnt = s.getLineCount(); for (int i = 0; i < cnt; i++) { ps.println(s.getLine(i)); } ps.close(); fos.close(); } addChapter(ch); }