Revision 4341
Added by daigle over 15 years ago
MetaCatServlet.java | ||
---|---|---|
1762 | 1762 |
FileWriter fileWriter = new FileWriter(documentPath); |
1763 | 1763 |
doc.toXml(fileWriter, user, groups, withInlineData); |
1764 | 1764 |
} |
1765 |
FileReader fileReader = new FileReader(documentPath); |
|
1766 |
BufferedReader br = new BufferedReader(fileReader); |
|
1767 |
PrintWriter pw = new PrintWriter(streamOut); |
|
1768 |
String nextLine; |
|
1769 |
while ((nextLine = br.readLine()) != null) { |
|
1770 |
pw.println(nextLine); |
|
1771 |
} |
|
1772 |
pw.flush(); |
|
1765 |
|
|
1766 |
PrintWriter out = new PrintWriter(streamOut); |
|
1767 |
doc.readFromFileSystem(out, user, groups, documentPath); |
|
1773 | 1768 |
} catch (Exception e) { |
1774 | 1769 |
// any exceptions in reading the xml from disc, and we go back to the |
1775 | 1770 |
// old way of creating the xml directly. |
... | ... | |
1778 | 1773 |
PrintWriter out = new PrintWriter(streamOut); |
1779 | 1774 |
doc.toXml(out, user, groups, withInlineData); |
1780 | 1775 |
} |
1781 |
|
|
1782 |
PrintWriter out = new PrintWriter(streamOut); |
|
1783 |
doc.toXml(out, user, groups, withInlineData); |
|
1784 | 1776 |
} else { |
1777 |
// TODO MCD, this should read from disk as well? |
|
1785 | 1778 |
//*** This is a metadata doc, to be returned in a skin/custom format. |
1786 | 1779 |
//*** Add param to indicate if public has read access or not. |
1787 | 1780 |
if (!user.equals("public")) { |
Also available in: Unified diff
Created a method in DocumentImpl to read a document file from disk. Created a support method to strip inline data for users that don't have read access.