Saturday, September 30, 2006

Java Made Easy

I thought I'd explain some of the coding that has been done to mod ANtsp2p. Have a look even if you don't program as it is written in java so it is easy to understand. Check out this tutorial if you fancy a crack yourself.

Antsp2pManager.java

Code to update ipfilter, settings and trusted peers files by reloading them from online directory shared by swarm users.

public class Antsp2pManager
{
public void updateIpfilter()
{
InetAddressWatchdog.getInstance().loadFilterFile("ipfilter.dat");
}
public void updateSettings()
{
FrameAnt.getInstance("").getGuiAnt().getSettingsAntPanel().loadStaticSettings(); FrameAnt.getInstance("").getGuiAnt().getSettingsAntPanel().updatesettingsUI();
}
public void updateTrustip()
{
InetAddressEngine.loadTrustedPeers(); FrameAnt.getInstance("").getGuiAnt().getConnectionAntPanel().updatetrustedpeersUI();
}
}


Common.java

Get the names of the files to update and their location.


InternetFile.java

/**
* A class that will get a file from a web or ftp server.
*
* You may use this code as you wish, just don't pretend
* that you wrote it yourself, and don't hold me liable for
* anything that it does or doesn't do. If you're feeling
* especially honest, please include a link to nsftools.com
* along with the code.
*
* For updates and more information, please visit
* www.nsftools.com
*
* @author Julian Robichaux
* @version 0.9
*/


Main.java

Starts kerjodando p2p by lauching ANts p2p and code to share ipfilter.dat (swarm).


Messages.java

Load kerjodando resource message bundle.


getfile.java

Save settings as files.


messages.properties

State names of files to updload.


runThread.java

Extend logger to to report on new code.