Jxta问题,期待哪位大虾帮忙解决啊?

cfqtree 2007-12-08 06:01:59
我在Jxta得到了一些PeerAdvertisement通告,如何通过它们得知某一Peer有没有文件共享,有的话,怎样得到共享列表?
...全文
50 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
goodmrning 2008-04-23
  • 打赏
  • 举报
回复
顶上去.关注......
haoxiongok 2008-04-23
  • 打赏
  • 举报
回复
帮楼主顶一下
haoxiongok 2008-04-23
  • 打赏
  • 举报
回复
帮楼主顶一下
kokobox 2008-04-22
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 byktwc 的回复:]
没太看明白你的问题,这个PeerAdvertisement不知道是你本地的通告还是远程的通告,要是本地的通告
/**
* Refreshes the list of shared content
*/
private void updateLocalFiles() {
//ContentManager.getContent() retrieves all of the content that is
// being shared by this peer.
Content[] content = cms.getContentManager().getConte…
[/Quote]
byktwc 2007-12-21
  • 打赏
  • 举报
回复
没太看明白你的问题,这个PeerAdvertisement不知道是你本地的通告还是远程的通告,要是本地的通告
/**
* Refreshes the list of shared content
*/
private void updateLocalFiles() {
//ContentManager.getContent() retrieves all of the content that is
// being shared by this peer.
Content[] content = cms.getContentManager().getContent();

//erase the list of shared content...
fileList.removeAll();

//...and repopulate it
for (int i=0; i<content.length; i++) {
fileList.add(content[i].getContentAdvertisement().getName());
}
}
要是远程的应该不需要解析PeerAdvertisement吧,直接搜索就好了。

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧