This commit is contained in:
edwin%woudt.nl 1999-02-25 14:08:14 +00:00
Родитель 411589b2a7
Коммит 661ba2aa7f
2 изменённых файлов: 19 добавлений и 15 удалений

Просмотреть файл

@ -114,8 +114,8 @@ public class Newsgroup extends Folder {
public void open(int mode) throws MessagingException {
if (open)
throw new MessagingException("Newsgroup is already open");
if (mode!=READ_ONLY)
throw new MessagingException("Newsgroup is read-only");
//if (mode!=READ_ONLY)
// throw new MessagingException("Newsgroup is read-only");
((NNTPStore)store).open(this);
open = true;
notifyConnectionListeners(ConnectionEvent.OPENED);
@ -174,18 +174,18 @@ public class Newsgroup extends Folder {
if (!open)
throw new MessagingException("Newsgroup is not open");
NNTPStore s = (NNTPStore)store;
if (articles==null)
//if (articles==null)
articles = s.getArticles(this);
else { // check for new articles
Article[] nm = s.getNewArticles(this, checkpoint);
if (nm.length>0) {
Article[] m2 = new Article[articles.length+nm.length];
System.arraycopy(articles, 0, m2, 0, articles.length);
System.arraycopy(nm, 0, m2, articles.length, nm.length);
articles = m2;
}
}
checkpoint = new Date();
//else { // check for new articles
// Article[] nm = s.getNewArticles(this, checkpoint);
// if (nm.length>0) {
// Article[] m2 = new Article[articles.length+nm.length];
// System.arraycopy(articles, 0, m2, 0, articles.length);
// System.arraycopy(nm, 0, m2, articles.length, nm.length);
// articles = m2;
// }
//}
//checkpoint = new Date();
return articles;
}

Просмотреть файл

@ -257,13 +257,17 @@ class MessageExtraWrapper implements MessageExtra {
buf.append(Constants.BYTEBUFLINEBREAK);
}
buf.append(Constants.BYTEBUFLINEBREAK);
ByteBuf buf2 = new ByteBuf();
try {
return new SequenceInputStream(buf.makeInputStream(),
m.getInputStream());
buf2.append(m.getContent());
} catch (IOException ee) {
throw new MessagingException("I/O error", ee);
}
return new SequenceInputStream(buf.makeInputStream(),
buf2.makeInputStream());
}
}