Link to home
Start Free TrialLog in
Avatar of SuAeE
SuAeE

asked on

java file methods

Hi,

How can I every file of type .jsp in a folder and replace certain text within the files (everything in the file is text) with text that I have specified?
Please post code.

Thanks
Avatar of Triguna
Triguna
Flag of India image

Using the Java FileOutputStream, you can create a file and write to the file. While writing, put your selected text into a String and put into the file using file.write() method.
ASKER CERTIFIED SOLUTION
Avatar of ldbkutty
ldbkutty
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mayank S
This is homework.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SuAeE
SuAeE

ASKER


>>This is homework.

This is not homework, if you must now Im changing the hardcoded ip address of a large jsp application with thousands of files. So go take your pathetic comment and post it in "support" because you've obviously got nothing better to do.

Thanks ldbkutty, that worked perfect. :)
Cheers CEHZ
>> So go take your pathetic comment and post it in "support" because you've obviously got nothing better to do.

Its against EE rules to ask for full-working code just like that. It is treated as homework only. If you have nothing better to do yourself, better have a look at the membership agreement first.
Its strange how people seeking answers can be rude enough and still expect to get help. I would make it a point not to post on any of your questions now even though they might not be homework.

>> Im changing the hardcoded ip address of a large jsp application with thousands of files

- simply posting that much was enough for clarifying that it is not homework.
>>Cheers CEHZ

OK ;-)
Thanks for the points :=)
- Balakrishnan.
Avatar of SuAeE

ASKER


>>I would make it a point not to post on any of your questions now even though they might not be homework.
Well if I was to go on your previous post im not really going to miss much am I?

What angered me is straght away you assume its "homework". As I understand the purpose of this site is to answer questions not analyse their validity.
>> What angered me is straght away you assume its "homework".

If you had gone through the EE member-agreement, this is treated as homework - which is why I asked you to read it. We cannot post full-code for something just like that. It is considered as home-work.

>> Well if I was to go on your previous post im not really going to miss much am I?

I guess I've not got whatever points I have just for posting such comments.