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 491k
  • Answers 491k
  • 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 Give this a try: $currentCatIds = $_product->getCategoryIds(); and also $categoryCollection… May 16, 2026 at 10:08 am
  • Editorial Team
    Editorial Team added an answer Animation.setFillAfter(true) might be what you are looking for. May 16, 2026 at 10:08 am
  • Editorial Team
    Editorial Team added an answer items.Where(i=>i.sid == 123).ToList().ForEach(i=>i.sid = 456); or rather use normal foreach… May 16, 2026 at 10:08 am

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 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'm working on a homework assignment to modify code given by my professor using
There is a lot of buzz these days about not using locks and using
In a constructor in Java, if you want to call another constructor (or a
Consider the following shell script: gzip -dc in.gz | sed -e 's/@/_at_/g' | gzip
Let's consider that I want to extend an existing JSF component, such as the
Noob at javascript etc. here. I’m a php/core Java programmer tasked with maintaining a
The following SQL I am trying to run is returning sql_string of SELECT id
how can I decompile a jar and load it as a project in my

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.