Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

writing a cache or textbuffer to file

Status
Not open for further replies.

afalnes

Programmer
Joined
Oct 14, 2002
Messages
5
Location
NO
To create a textbuffer
(eg HTML page ) and write the URLcache to a file.The code is as follows:

private void writeDiskCache(UrlCacheEntry uce)
throws IOException {
String path = docRoot + uce.url;
String dir = path.substring(0, path.lastIndexOf("/"));
dir.replace('/', File.separatorChar);
new File(dir).mkdirs();
FileOutputStream out = new FileOutputStream(path);
out.write(uce.data, 0, uce.length);
out.close();
}
Any comment on how to improve this code.I'm most grateful of any reply on this matter.
 
please do not start another thread, when the subject at hand is being dealt with on another thread.

Thankyou.

--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top