• Post Reply Bookmark Topic Watch Topic
  • New Topic

i am geting rerror  RSS feed

 
shyamkumar bopannachengalaiah
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
package tomcat;
import java.io.*;

public class CacheCleaner {

public static void main(String args[]){
try{
CacheCleaner c = new CacheCleaner();
c.listDir("D:\\Program Files\\Apache Software Foundation\\Tomcat 5.5\\work\\Catalina\\localhost");
}catch(Exception e){
System.out.println("Exception in main:"+e);
}
}

public void listDir(String dir){
try{
File f = new File(dir);
if(f.isDirectory()){
System.out.println(f.getName()+"/");
String path = f.getCanonicalPath();
String files[] = f.list();
for(String s : files){
listDir(path+"\\"+s);
}
}else if(f.isFile()){
f.delete();
}
}catch(Exception e){
System.out.println("Exception in e:"+e);
}
}
}
 
Ankit Garg
Sheriff
Posts: 9610
37
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please Use Code Tags when you post a source code. You can edit your message using button and then add code tags to it.

Saying It Doesnt Work Is Useless, what is the error you are getting...
 
Ankit Garg
Sheriff
Posts: 9610
37
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also this is not concerned with Servlets so I'll move it.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!