1 package net.sourceforge.phpeclipse.wiki.actions.mediawiki.connect;
3 import java.io.InputStream;
5 //Parts of this sources are copied and modified from the jEdit Wikipedia plugin:
6 //http://www.djini.de/software/wikipedia/index.html
8 //The modified sources are available under the "Common Public License"
9 //with permission from the original author: Daniel Wunsch
13 * 6lt;page6gt; XML data from Wikipedia Special:Export pages may be <code>null</code>
16 /* package private */String xmlData = null;
19 * timeStamp represented in XML format from Wikipedia Special:Export pages
21 /* package private */String timestamp = null;
23 /* package private */String editToken = null;
25 /* package private */String title = null;
27 /* package private */String body = null;
29 /* package private */Parsed() {
32 public Parsed(String timeStamp, String title, String body, String editToken) {
34 this.timestamp = timeStamp;
37 this.editToken = editToken;
43 * @see java.lang.Object#toString()
45 public String toString() {
46 StringBuffer buffer = new StringBuffer();
47 buffer.append("==>Title:\n");
51 buffer.append("==>Timestamp:\n");
52 if (timestamp != null) {
53 buffer.append(timestamp);
55 buffer.append("==>Body:\n");
59 return buffer.toString();
63 * @return Returns the body.
65 public String getBody() {
70 * @return Returns the timestamp.
72 public String getTimestamp() {
76 public String getDateTimestamp() {
77 if (timestamp != null) {
78 StringBuffer buffer = new StringBuffer();
79 // 2004-11-22T12:41:10Z
80 buffer.append(timestamp.substring(0, 4)); //year
81 buffer.append(timestamp.substring(5, 7)); //month
82 buffer.append(timestamp.substring(8, 10)); //day
83 buffer.append(timestamp.substring(11, 13));//hour
84 buffer.append(timestamp.substring(14, 16));//minute
85 buffer.append(timestamp.substring(17, 19));//second
86 return buffer.toString();
92 * @return Returns the title.
94 public String getTitle() {
99 * @return Returns the xmlData.
101 public String getXmlData() {
105 * @return Returns the editToken.
107 public String getEditToken() {