Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2007

Tip: Looking for answers? Try searching our database.

Read a text file kept outside the .jar file

Thread view: 
arvind - 27 Feb 2007 07:20 GMT
Hi,
i want to read a normal text file kept outside my .jar file from my
jar file.

i have tried using InputStrem.

But it didn't work.

how can i do it?

Thx in advanne.
Boaz.Jan@gmail.com - 27 Feb 2007 07:33 GMT
arvind כתב:
> Hi,
> i want to read a normal text file kept outside my .jar file from my
[quoted text clipped - 7 lines]
>
> Thx in advanne.

java.io.File f = new File("YOUR FULL PATH HERE");
if (f.exists)
{
BufferedReader in = new BufferedReader(new FileReader(f));
}

for reading bytes instead of chars use FileInputStream istead of
FileReader or use any reader you want...
the BufferedReader class only encapsulate your reader and gives it
buffer capabilties and sopme sevrel methods...


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.