File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Is jsp I/O Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Is jsp I/O "File" has been deprecated?" Watch "Is jsp I/O "File" has been deprecated?" New topic
Author

Is jsp I/O "File" has been deprecated?

eric lee
Ranch Hand

Joined: Nov 04, 2002
Posts: 86
I use TomCat 4.0,Win2000 ,got error " deprecated
"
-------------------------------------------------
<%@ page contentType="text/html; charset=Big5"%>
<HTML>
<HEAD>
<%
String path = request.getRealPath(".");
File f = new File(path, "File.txt");
if(f.exists()) {
f.delete();
out.println(path + "\\File.txt");
%>
<FONT SIZE = 4 COLOR = red>exist</FONT>,
<FONT SIZE = 4 COLOR = red>del</FONT>
<%
}
else
{
f.createNewFile();


out.println(path + "\\File.txt"); %>
<FONT SIZE = 4 COLOR = red>not exist</FONT
<FONT SIZE = 4 COLOR = red>create</FONT>
<%
}
%>
</BODY>
</HTML>
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 11862
No, java.io.File has not bee deprecated and all the methods in your code are still there. Usually a deprecated message is a bit more detailed. I don't see where you are importing java.io.File - could that be the problem?
Bill
[ February 24, 2003: Message edited by: William Brogden ]

Java Resources at www.wbrogden.com
eric lee
Ranch Hand

Joined: Nov 04, 2002
Posts: 86
Thanks William, i got it
 
 
subject: Is jsp I/O "File" has been deprecated?
 
Threads others viewed
Pagination in Servlets from a Resultset
Problem: Sample Question
The program error!
help for shopping cart
Request Resource not available JSP
developer file tools