Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 876087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:22:34+00:00 2026-05-15T11:22:34+00:00

How can I modify the following java code so that it works on J2RE(Java

  • 0

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();
    }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T11:22:35+00:00Added an answer on May 15, 2026 at 11:22 am

    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…

    public void showFile(String fileName) {
       try {
          FileConnection fc = (FileConnection)
             Connector.open("file:///CFCard/" + fileName);
          if(!fc.exists()) {
             throw new IOException("File does not exist");
          }
          InputStream is = fc.openInputStream();
          byte b[] = new byte[1024];
          int length = is.read(b, 0, 1024);
          System.out.println
             ("Content of "+fileName + ": "+ new String(b, 0, length));
       } catch (Exception e) {
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 529k
  • Answers 529k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Short answer: Answer.create(params[:answer].merge(:question_id => @question.id, :user_id => @user.id) or @question.asnwers.create(params[:answer].merge(:user_id… May 16, 2026 at 11:11 pm
  • Editorial Team
    Editorial Team added an answer First, I'd write a view to normalize the data: select… May 16, 2026 at 11:11 pm
  • Editorial Team
    Editorial Team added an answer You need to set the background-attachment property to fix the… May 16, 2026 at 11:11 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have some code (that I can't easily modify), of the following form: def
I'm trying to modify the following code so that it will return a Dictionary<int,int>
I am looking for a parser generator for Java that does the following: My
I am using EMF through annotated Java code as following /** * Adds the
I have following wrapper to help me manage the wcf client lifetime: public class
I have the following code that runs figlet that has input as a range.
I'm working on a homework assignment to modify code given by my professor using
I want to be clear about all the advantages/disadvantages of the following code: {
I have the following code which is adding somestrings to an arraylist. It will
There is a lot of buzz these days about not using locks and using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.