pkg://jftp-1.42-2jpp.src.rpm:2618723/j-ftp-1.42.tar.gz
info downloads
j-ftp/ 0002755 0001750 0001750 00000000000 10026323546 012635 5 ustar cdemon cdemon 0000000 0000000 j-ftp/CVS/ 0002755 0001750 0001750 00000000000 07637407734 013310 5 ustar cdemon cdemon 0000000 0000000 j-ftp/CVS/Root 0000755 0001750 0001750 00000000065 07500136441 014137 0 ustar cdemon cdemon 0000000 0000000 :ext:cdemon@cvs.j-ftp.sourceforge.net:/cvsroot/j-ftp
j-ftp/CVS/Repository 0000755 0001750 0001750 00000000006 07500136441 015366 0 ustar cdemon cdemon 0000000 0000000 j-ftp
j-ftp/CVS/Entries 0000755 0001750 0001750 00000000454 07637407734 014650 0 ustar cdemon cdemon 0000000 0000000 /LICENSE/1.1/Fri Feb 8 22:33:48 2002//
D/doc////
D/src////
/run.bat/1.1/Wed Mar 19 08:13:33 2003//
/run/1.2/Fri Mar 21 00:01:32 2003//
/build.xml/1.30/Fri Mar 21 14:42:37 2003//
/CHANGELOG/1.68/Sun Mar 23 19:38:16 2003//
/TODO/1.56/Sun Mar 23 19:32:52 2003//
/readme/1.62/Sun Mar 23 19:30:33 2003//
j-ftp/doc/ 0002755 0001750 0001750 00000000000 07755451107 013414 5 ustar cdemon cdemon 0000000 0000000 j-ftp/doc/CVS/ 0002755 0001750 0001750 00000000000 07636122456 014047 5 ustar cdemon cdemon 0000000 0000000 j-ftp/doc/CVS/Root 0000755 0001750 0001750 00000000065 07500136442 014705 0 ustar cdemon cdemon 0000000 0000000 :ext:cdemon@cvs.j-ftp.sourceforge.net:/cvsroot/j-ftp
j-ftp/doc/CVS/Repository 0000755 0001750 0001750 00000000012 07500136442 016131 0 ustar cdemon cdemon 0000000 0000000 j-ftp/doc
j-ftp/doc/CVS/Entries 0000755 0001750 0001750 00000000273 07636122456 015406 0 ustar cdemon cdemon 0000000 0000000 /api-use.txt/1.1/Sun Feb 17 17:49:16 2002//
/Grapher.java/1.1/Sun Mar 9 16:07:43 2003//
/FtpDownload.java/1.8/Wed Mar 12 20:15:57 2003//
/FtpUpload.java/1.8/Wed Mar 12 20:16:02 2003//
D
j-ftp/doc/javadoc/ 0002755 0001750 0001750 00000000000 07642541704 015021 5 ustar cdemon cdemon 0000000 0000000 j-ftp/doc/FtpDownload.java 0000755 0001750 0001750 00000007222 07651744217 016506 0 ustar cdemon cdemon 0000000 0000000 import net.sf.jftp.net.ConnectionHandler;
import net.sf.jftp.net.ConnectionListener;
import net.sf.jftp.net.DataConnection;
import net.sf.jftp.net.FtpConnection;
import net.sf.jftp.net.BasicConnection;
import net.sf.jftp.util.Log;
import net.sf.jftp.util.Logger;
import net.sf.jftp.config.Settings;
import java.io.*;
// this class download a file via anonymous ftp and shows output.
//
// if you want to use the api in a more complex way, please do at least take a look at the
// FtpConnection, FtpTransfer, ConnectionHandler, DirPanel (blockedTransfer, transfer)
// and ConnectionListener sourcecode.
public class FtpDownload implements Logger, ConnectionListener
{
// is the connection established?
private boolean isThere = false;
// connection pool, not necessary but you should take a look at this class
// if you want to use multiple event based ftp transfers.
private ConnectionHandler handler = new ConnectionHandler();
//creates a FtpConnection and downloads a file
public FtpDownload(String host, String file)
{
// register app as Logger, debug() and debugRaw below are from now on called by
// FtpConnection
Log.setLogger(this);
// create a FtpConnection - note that it does *not* connect instantly
FtpConnection con = new FtpConnection(host);
// set updatelistener, interface methods are below
con.addConnectionListener(this);
// set handler
con.setConnectionHandler(handler);
// connect and login. this is from where connectionFailed() may be called for example
con.login("anonymous","no@no.no");
// login calls connectionInitialized() below which sets isThere to true
while(!isThere)
{
try { Thread.sleep(10); }
catch(Exception ex) { ex.printStackTrace(); }
}
// download the file - this method blocks until the download has finished
// if you want non-blocking, multithreaded io, just use
//
// con.handleDownload(file);
//
// which spawns a new thread for the download
con.download(file);
}
// download welcome.msg from sourceforge or any other given file
public static void main(String argv[])
{
if(argv.length < 2)
{
FtpDownload f = new FtpDownload("upload.sourceforge.net", "/welcome.msg");
}
else
{
FtpDownload f = new FtpDownload(argv[0], argv[1]);
}
}
// ------------------ needed by ConnectionListener interface -----------------
// called if the remote directory has changed
public void updateRemoteDirectory(BasicConnection con)
{
System.out.println("new path is: " + con.getPWD());
}
// called if a connection has been established
public void connectionInitialized(BasicConnection con)
{
isThere = true;
}
// called every few kb by DataConnection during the trnsfer (interval can be changed in Settings)
public void updateProgress(String file, String type, long bytes) {}
// called if connection fails
public void connectionFailed(BasicConnection con, String why) {System.out.println("connection failed!");}
// up- or download has finished
public void actionFinished(BasicConnection con) {}
// ------------ needed by Logger interface --------------
// main log method
public void debug(String msg) {System.out.println(msg);}
// rarely used
public void debugRaw(String msg) {System.out.print(msg);}
// methods below are not used yet.
public void debug(String msg, Throwable throwable) {}
public void warn(String msg) {}
public void warn(String msg, Throwable throwable) {}
public void error(String msg) {}
public void error(String msg, Throwable throwable) {}
public void info(String msg) {}
public void info(String msg, Throwable throwable) {}
public void fatal(String msg) {}
public void fatal(String msg, Throwable throwable) {}
}
j-ftp/doc/api-use.txt 0000755 0001750 0001750 00000000337 07433766434 015531 0 ustar cdemon cdemon 0000000 0000000 --- Standalone-usage ---
If you want to use the JFtp-api without the gui app,
take a look at FtpDownload.java.
It's easy to understand, but if you have any questions
feel free to ask at j-ftp-devel@lists.sourceforge.net
j-ftp/doc/FtpUpload.java 0000755 0001750 0001750 00000004172 07651744301 016156 0 ustar cdemon cdemon 0000000 0000000 import net.sf.jftp.net.ConnectionHandler;
import net.sf.jftp.net.ConnectionListener;
import net.sf.jftp.net.DataConnection;
import net.sf.jftp.net.FtpConnection;
import net.sf.jftp.net.BasicConnection;
import net.sf.jftp.util.Log;
import net.sf.jftp.util.Logger;
import net.sf.jftp.config.Settings;
import java.io.*;
/**
* See FtpDownload.java for comments.
*/
public class FtpUpload implements Logger, ConnectionListener
{
private boolean isThere = false;
private ConnectionHandler handler = new ConnectionHandler();
public FtpUpload(String host, String dir, String file)
{
Log.setLogger(this);
FtpConnection con = new FtpConnection(host);
con.addConnectionListener(this);
con.setConnectionHandler(handler);
con.login("anonymous","no@no.no");
while(!isThere)
{
try { Thread.sleep(10); }
catch(Exception ex) { ex.printStackTrace(); }
}
con.chdir(dir);
con.upload(file);
}
public static void main(String argv[])
{
if(argv.length == 3)
{
FtpUpload f = new FtpUpload(argv[0], argv[2], argv[1]);
}
else
{
FtpUpload g =
new FtpUpload("upload.sourceforge.net", "/incoming", "test.txt");
}
}
public void updateRemoteDirectory(BasicConnection con)
{
System.out.println("new path is: " + con.getPWD());
}
public void connectionInitialized(BasicConnection con)
{
isThere = true;
}
public void updateProgress(String file, String type, long bytes) {}
public void connectionFailed(BasicConnection con, String why) {System.out.println("connection failed!");}
public void actionFinished(BasicConnection con) {}
public void debug(String msg) {System.out.println(msg);}
public void debugRaw(String msg) {System.out.print(msg);}
public void debug(String msg, Throwable throwable) {}
public void warn(String msg) {}
public void warn(String msg, Throwable throwable) {}
public void error(String msg) {}
public void error(String msg, Throwable throwable) {}
public void info(String msg) {}
public void info(String msg, Throwable throwable) {}
public void fatal(String msg) {}
public void fatal(String msg, Throwable throwable) {}
}
j-ftp/doc/nfsinfo 0000644 0001750 0001750 00000003462 07656177152 015011 0 ustar cdemon cdemon 0000000 0000000
NFS information
NFS support is provided by the Sun WebNFS API, finally i was able to get it running in combination
with my linux box at home.
NFS URLs are a little bit tricky, depending on the type of the NFS version you want to use you have
to use some custom extensions of the url parser.
This is what the devolopers of the WebNFS API write in their javadoc:
"This is just a dumb URL parser class.
I wrote it because I got fed up with the JDK URL class calling NFS URL's "invalid" simply because the Handler wasn't installed.
This URL parser also handles undocumented testing options inserted in the URL in the port field.
The following sequence of option letters may appear before or after the port number, or alone if the port number is not given.
vn - NFS version, e.g. "v3" u - Force UDP - normally TCP is preferred t - Force TDP - don't fall back to UDP m - Force Mount protocol.
Normally public filehandle is preferred Option ordering is not important. Example: nfs://server:123v2um/path Use port 123 with NFS
v2 over UDP and Mount protocol nfs://server:m/path Use default port, prefer V3/TCP but use Mount protocol."
------------ COMPATIBILITY ---------------
Server type: NFS2
Test system: linux universal nfsd 2.2beta47
TESTED: nfs://server:v2m/tmp - nfs2, tcp with udp fallback, use mount
SHOULD: nfs://server:v2tm/tmp - nfs2, force tcp, use mount
SHOULD: nfs://server:v2um/tmp - nfs2, force udp, use mount
Server type: NFS3
Test system: none
UNKNOWN: nfs://server:v3m/tmp - nfs3, tcp with udp fallback, use mount
UNKNOWN: nfs://server:v3tm/tmp - nfs3, force tcp, use mount
UNKNOWN: nfs://server:v3um/tmp - nfs3, force udp, use mount
Server type: WebNFS
Test system: none
UNKNOWN: nfs://server:v3/tmp - may support webnfs
UNKNOWN: nfs://server/tmp - may support webnfs
j-ftp/doc/Grapher.java 0000755 0001750 0001750 00000012231 07632663317 015651 0 ustar cdemon cdemon 0000000 0000000 import java.io.*;
import java.net.*;
import java.util.*;
import java.awt.*;
import javax.swing.*;
public class Grapher extends Canvas
{
public String files[] = new String[] {"JFtp.java", "LoadSet.java","EventCollector.java", "EventProcessor.java", "FtpEvent.java","DirCellRenderer.java","DirPanel.java",
"Displayer.java","HostChooser.java","HostList.java","Properties.java","Updater.java","GUIDefaults.java","HPasswordField.java",
"DataConnection.java","FtpClient.java","FtpConnection.java","FtpConstants.java","FtpServerSocket.java","FtpURLConnection.java",
"FtpURLStreamHandler.java","JConnection.java","LocalIO.java","Log.java","Log4JLogger.java","Logger.java","SystemLogger.java",
"CommandLine.java","SaveSet.java","Settings.java","Acceptor.java","Event.java","EventHandler.java","FtpEventConstants.java",
"FtpEventHandler.java","AutoRemover.java","Creator.java","DirCanvas.java","DirEntry.java","DirLister.java","DownloadList.java",
"LoadPanel.java","PathChanger.java","RemoteCommand.java","Remover.java","RemoverQuery.java","ResumeDialog.java",
"StatusCanvas.java","StatusPanel.java","Template.java","HFrame.java","HImage.java","HImageButton.java","HPanel.java",
"HTextField.java","ConnectionHandler.java","ConnectionListener.java","FtpServer.java","Transfer.java","StringUtils.java" };
public String prefix = "/home/cdemon/JFtp/j-ftp/src/java/net/sf/jftp/";
public String[] paths = new String[] { prefix, prefix+"gui/", prefix+"net/", prefix+"util/", prefix+"config/", prefix+"gui/framework",
prefix+"event/" };
public Hashtable table = new Hashtable();
public Hashtable pool = new Hashtable();
public static int width = 800;
public static int height = 600;
public Grapher()
{
setSize(width,height);
try
{
for(int i=0; i<files.length; i++)
{
File f = getFile(files[i]);
if(f != null && f.exists())
{
for(int j=0; j<files.length; j++)
{
int x = countRelations(f, files[j]);
if(x > 0) table.put(files[i] + ":" +files[j].substring(0, files[j].indexOf(".java")), new String(""+x));
}
}
}
show();
repaint();
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
public void paint(Graphics g)
{
// init
g.setColor(Color.white);
g.fillRect(0,0,getSize().width, getSize().height);
g.setColor(Color.blue);
g.setFont(new Font("serif", Font.BOLD, 14));
// points
Random r = new Random();
for(int i=0; i<files.length; i++)
{
while(true)
{
int x = r.nextInt(width-200);
int y = r.nextInt(height-20);
if(y<30) y=30;
if(check(x, y))
{
//System.out.println("adding: " + files[i]);
String tmp = files[i].substring(0,files[i].indexOf(".java"));
Point p = new Point(x, y);
pool.put(tmp, p);
linkPoints(g, p);
//g.drawString(tmp, x, y);
break;
}
}
}
g.setColor(Color.blue);
for(int i=0; i<files.length; i++)
{
String tmp = files[i].substring(0,files[i].indexOf(".java"));
Point p2 = (Point) pool.get(tmp);
if(p2 == null) continue;
//g.setColor(new Color(255,180,180));
//g.fillRect((int) p2.getX(), (int) p2.getY()-12, 80, 15);
//g.setColor(Color.blue);
g.drawString(tmp, (int) p2.getX(), (int) p2.getY());
}
}
public void linkPoints(Graphics g, Point p)
{
// fill
Enumeration k = table.keys();
Enumeration e = table.elements();
String xk = null;
String file = null;
String link = null;
while(k.hasMoreElements())
{
xk = (String) k.nextElement();
int x = Integer.parseInt((String)e.nextElement());
file = xk.substring(0, xk.indexOf(":"));
file = file.substring(0,file.indexOf(".java"));
link = xk.substring( xk.indexOf(":")+1);
//System.out.println("<" + file + "> " + "(" + link + ")" + " - " + x);
Point x2 = (Point) pool.get(file);
if(x2 == null) continue;
if(x > 0)
{
//for(int y=0; y<x; y++)
//{
int color = 255 - x*10 +40;
if(color < 0) color=0;
if(color > 255) color = 255;
g.setColor(new Color(color,color,color));
if(color < 255) g.drawLine(((int)p.getX()+20),((int)p.getY()+15),((int)x2.getX()+20),((int)x2.getY()+15));
//}
}
}
}
public boolean check(int x, int y)
{
Enumeration e = pool.elements();
Point d = null;
int a;
int b;
while(e.hasMoreElements())
{
d = (Point) e.nextElement();
a = (int) d.getX();
b = (int) d.getY();
if(a > x-100 && a < x+100) {
if(b > y-20 && b < y +20)
{
return false;
}
}
}
return true;
}
public int countRelations(File f, String what) throws IOException
{
int x = 0;
String tmp;
what = what.substring(0, what.indexOf(".java"));
URL url = f.toURL();
DataInputStream in = new DataInputStream(new BufferedInputStream(url.openStream()));
while(true)
{
tmp = in.readLine();
//System.out.println(f.getAbsolutePath() + ": " + tmp + ": " +what);
if(tmp == null) break;
if(tmp.indexOf(what) >= 0) x++;
}
in.close();
return x;
}
public File getFile(String name)
{
for(int i=0; i<paths.length; i++)
{
File f = new File(paths[i]+name);
if(f.exists()) return f;
}
return null;
}
public static void main(String argv[])
{
Grapher g = new Grapher();
JFrame j = new JFrame();
j.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
j.getContentPane().setLayout(new BorderLayout(5,5));
j.setSize(width+10,height+25);
j.getContentPane().add("Center",g);
j.show();
}
}
j-ftp/doc/applet.html 0000644 0001750 0001750 00000000375 07755451737 015603 0 ustar cdemon cdemon 0000000 0000000 <html>
<body>
<h3>JFtp should start soon...</h3>
<p>Watch your java console log if the application does not start correctly.</p>
<br><br>
<applet code="net.sf.jftp.JFtpApplet" archive="../build/jars/jftp.jar">
Sorry, no java found
</applet>
</html>