Does it work? I have this bit of code here which works fine in an application, but gives an runtime error when I try it in an applet.
import java.awt.*;
import java.applet.*;
import com.enterprisedt.net.ftp.*;
public class mUpload extends Applet
{
private static String msg;
public void init()
{
String server = new String("localhost");
String user = new String("test");
String passwd = new String("testtest");
FTPClient ftp = null;
msg = "Default";
try
{
ftp = new FTPClient(server);
ftp.login(user, passwd);
ftp.put("C:\\me.rtf", "you.rtf");
}
catch (Exception e)
{
msg = e.toString();
}
}
public void paint(Graphics g)
{
g.drawString(msg, 50, 60);
}
}
Here's the error:
java.lang.ExceptionInInitializerError
at com.enterprisedt.net.ftp.FTPClient.<init>(FTPClient.java:203)
at com.enterprisedt.net.ftp.FTPClient.<init>(FTPClient.java:348)
at com.enterprisedt.net.ftp.FTPClient.<init>(FTPClient.java:319)
at mUpload.init(mUpload.java:28)
at sun.applet.AppletPanel.run(AppletPanel.java:353)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission edtftp.log.level read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:269)
at java.security.AccessController.checkPermission(AccessController.java:401)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1276)
at java.lang.System.getProperty(System.java:612)
at com.enterprisedt.util.debug.Logger.<clinit>(Logger.java:128)
... 6 more
Any ideas?