applet ----> URL -------> txt file

How can I do to access from an applet to an URL using "URL input stream" and from this URL to a txt file which is in a specific server?

I also need to know a way to read a txt file and extract strings, which are separated by something, for example a ",".


thank you very much
cristian

crisoftAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jwilcoxCommented:
For your way to extract strings you can use the StringTokenizer interface. Here is an example of how that works...

String FullOfColons = new String("My Mom;and I; went to the bank; and put in; a lot of money!); // Actually full of Semi-Colons!

StringTokenizer KillGrammar = new StringTokenizer(FullOfColons, ";", false) // False if you don't want the ; included, true if you do!

String RealSentence = new String();
while( KillGrammar.hasMoreTokens() )
{
  RealSentence += KillGrammar.nextToken();
}

System.out.println(RealSentence);

StringTokenizer is in java.util.

Hope this gets you atleast started on your solution.
0
rainmalCommented:
To access a text file , access ot in the same way as you would a html file.
just make sure that you keep the text file in the Documents directory of your server
then access it using the URL.
For example

HTTP://yourservername/Doc.txt.

To parse through a string , refer to jwilcox's comment.
0
crisoftAuthor Commented:
HTTP://yourservername/Doc.txt.

Can you give me the code in java for this?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.