Skip to main content

java me and ftp

No replies
bruno386
Offline
Joined: 2010-06-27
Points: 0

The following java has been tested on java and works fine, it will upload ther text file to the ftp server.

How can I convert this java code to j2me since j2me doesnt have java.io.file class...

</p>
<p>package javaapplication1;</p>
<p>import it.sauronsoftware.ftp4j.FTPClient;</p>
<p>/**<br />
*<br />
* @author bruno<br />
*/<br />
public class Main {</p>
<p>    /**<br />
     * @param args the command line arguments<br />
     */<br />
    public static void main(String[] args) {<br />
        // TODO code application logic here</p>
<p>        try<br />
        {<br />
        FTPClient client = new FTPClient();<br />
        client.connect("serveraddy");<br />
        client.login("user", "pass");<br />
        client.upload(new java.io.File("C://text.txt"));<br />
        }<br />
        catch(Exception e)<br />
  {</p>
<p>        e.printStackTrace();<br />
        }</p>
<p>    }</p>
<p>}</p>
<p>

This is the line which I am struggleing with...
client.upload(new java.io.File("C://text.txt"));

How does j2me approach this since ther eis no java.io.files class?

Thanks in advance