/** NNTP send/recieve */
public class NNTP {
- public static final DateFormat dateFormat = new SimpleDateFormat("YYYYMMDDhhmmss");
+ public static final DateFormat dateFormat = new SimpleDateFormat("yyyyMMDDhhmmss");
public static class No extends RuntimeException { int code = 400; } // 4xx response codes
public static class Bad extends RuntimeException { int code = 500; public Bad(String s) { super(s); } } // 5xx response codes
try {
Message m = body ? it.cur() : Message.newMessage(new Stream(it.head() + "\r\n"));
//Message m = it.cur(); // FIXME
- return new Article(m.messageid, it.num(), m);
+ return new Article(it.num(), m);
} catch (Exception e) { return null; }
}
public Group[] list() { return list(root, ""); }
if (st.hasMoreTokens()) {
String arg = st.nextToken();
if (arg.equalsIgnoreCase("STREAM"));
- streaming = true;
+ //streaming = true;
println("203 Streaming permitted");
} else {
println("201 Hello, you can post.");
// FIXME deal with GMT
Date d = new Date();
try {
- d = new SimpleDateFormat("YYMMDD HHMMSS").parse(gmt);
+ d = new SimpleDateFormat("yyMMDD HHMMSS").parse(gmt);
} catch (ParseException pe) {
Log.warn(this, pe);
}
println(".");
} else if (command.equals("LIST")) {
if (st.hasMoreTokens()) {
- String argument = st.nextToken().toUppercase();
+ String argument = st.nextToken().toUpperCase();
if (argument.equalsIgnoreCase("EXTENSIONS")) {
println("202 Extensions supported:");
println("STREAMING");
String wildmat = st.hasMoreTokens() ? st.nextToken() : null;
// FIXME: deal with wildmat
// just like list, but only show active groups
+ throw new Bad("not implemented yet");
} else if (argument.equals("SUBSCRIPTIONS")) {
// FIXME: show 215, default subscription list for new users, period
} else if (argument.equals("OVERVIEW.FMT")) {
// FIXME: may be pipelined
String mid = st.nextToken();
// MUST read message here
+ /*
if (!want) {
println("439 "+ mid+" Transfer failed");
} else {
println("239 "+mid+" Rock on.");
}
+ */
} else if (command.equals("IHAVE")) {
boolean want = api.ihave(st.nextToken());