This week's book giveaway is in the Java in General forum.
We're giving away four copies of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 and have ishori Sharan & Adam L Davis on-line!
See this thread for details.
Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
eric lee
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks William, i got it
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic