entry.addCategory(category);
}
}
entry.setPublished("Publish".equals(status));
BlogService service = new BlogService();
service.putBlogEntry(entry);
line = reader.readLine();
while (!line.equals("--------")) {
if (line.equals("COMMENT:")) {
String commentAuthor = reader.readLine().substring("AUTHOR: ".length());
String commentEmail = reader.readLine().substring("EMAIL: ".length());
String commentIpAddress = reader.readLine().substring("IP: ".length());
String commentUrl = reader.readLine().substring("URL: ".length());
Date commentDate = sdf.parse(reader.readLine().substring("DATE: ".length()));
StringBuffer commentBody = new StringBuffer();
String commentBodyLine = reader.readLine();
while (!commentBodyLine.equals("-----")) {
commentBody.append(commentBodyLine);
commentBodyLine = reader.readLine();
if (!commentBodyLine.equals("-----")) {
commentBody.append("<br />");
}
}
Comment comment = entry.createComment(null, commentBody.toString(), commentAuthor, commentEmail, commentUrl, "", commentIpAddress, commentDate, State.APPROVED);
entry.addComment(comment);
} else if (line.equals("PING:")) {
String pingTitle = reader.readLine().substring("TITLE: ".length());
String pingUrl = reader.readLine().substring("URL: ".length());
String pingIpAddress = reader.readLine().substring("IP: ".length());
String pingBlogName = reader.readLine().substring("BLOG NAME: ".length());
Date pingDate = sdf.parse(reader.readLine().substring("DATE: ".length()));
StringBuffer pingBody = new StringBuffer();
String pingBodyLing = reader.readLine();
while (!pingBodyLing.equals("-----")) {
pingBody.append(pingBodyLing);
pingBodyLing = reader.readLine();
if (!pingBodyLing.equals("-----")) {
pingBody.append("<br />");
}
}
TrackBack trackBack = entry.createTrackBack(pingTitle, pingBody.toString(), pingUrl, pingBlogName, pingIpAddress, pingDate, State.APPROVED);
entry.addTrackBack(trackBack);
}
line = reader.readLine();
}
service.putBlogEntry(entry);
// System.out.println("--------------------------------------------------");
System.out.print(".");
return entry;