?? simpleshare.java
字號:
import java.io.*;
import net.jxta.pipe.*;
import net.jxta.share.*;
import net.jxta.share.client.*;
public class SimpleShare
{
private PeerGroup netPeerGroup = null;
private CMS cms = null;
public void startCMS()
{
try
{
netPeerGroup = PeerGroupFactory.newNetPeetGroup();
cms = new CMS();
cms.init(netPeerGroup,null,null);
String homedir = "SimpleShare";
if(cms.startApp(new Filehomedir))==-1)
{
System.out.println("CMS initialization failed");
System.exit(-1);
}
cms.getContentManager().share(new File("java.txt"));
}catch(Exception e)
{
System.out.println(e.getMessage());
System.exit(-1);
}
}
public static void main(String args[])
{
SimpleShare myShare = new SimpleShare();
myShare.startApp();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -