1. Check out our companion app, Forums for Android! Download from Google Play

ftp in j2me

Discussion in 'Application Development' started by bruno386, Jun 26, 2010.

  1. bruno386

    bruno386 Member
    Thread Starter
    5

    Jun 26, 2010
    8
    0
    5
    I have this very simple piece of java code which works fine...


    How do i convert it to j2me as there is no io.file class in j2me :(



    Code (Text):
    1.  
    2. package javaapplication1;
    3.  
    4. import it.sauronsoftware.ftp4j.FTPClient;
    5.  
    6. /**
    7.  *
    8.  * @author bruno
    9.  */
    10. public class Main {
    11.  
    12.     /**
    13.      * @param args the command line arguments
    14.      */
    15.     public static void main(String[] args) {
    16.         // TODO code application logic here
    17.  
    18.         try
    19.         {
    20.         FTPClient client = new FTPClient();
    21.         client.connect("ftpserveraddy");
    22.         client.login("user", "pass.");
    23.         client.upload(new java.io.File("C://text.txt"));
    24.         }
    25.         catch(Exception e)
    26.         {
    27.  
    28.         e.printStackTrace();
    29.         }
    30.  
    31.     }
    32.  
    33. }
    34.  
     

    Advertisement

Share This Page

Loading...