📄 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 + -