How can I modify the following java code so that it works on J2RE(Java ME) as there is no java.io.files class in Java ME 🙁
public static void main(String[] args) {
// TODO code application logic here
try
{
FTPClient client = new FTPClient();
client.connect("serveraddy");
client.login("user", "pass");
client.upload(new java.io.File("C://text.txt"));
} catch(Exception e) {
e.printStackTrace();
}
}
If what you want to do is to open and read a file then look at these two links
http://developers.sun.com/mobility/apis/articles/fileconnection/index.html
http://developers.sun.com/mobility/midp/articles/genericframework/index.html
Here is a sample to print the contents of a file…