Home Tutorialhelp Comment your erroes

 
 

Comment

ankur
your erroes,
December 9, 2007 at 8:16 PM

you have done many erros in it..
1..>if the file will writeprotected then it will not delete by this programme..
2..>and ofcurese it will delete only single directory or file if directory content subdirectoris then it will not delete it ..as u knw
3>>>look at my code it will all subdirectes n files
but yaa there is an error in code find it actually it is not deleting files find n tell me why..
..................................
import java.io.*;
import java.util.*;

public class DeleteAny
{
public static void main(String args[])throws IOException
{
File f[]=new File[args.length];

for(int i=0; i<f.length; i++)
{
f[i]=new File(args[i]);
delete(f[i]);
}

}

static void delete(File f)
{try{System.out.println(";;"+f.getName()+" "+f.listFiles().length);

if(f.listFiles().length>1)
{
File fd[]=f.listFiles();

for(int i=0; i<fd.length; i++)
delete(fd[i]);
}
if(f.listFiles().length<1)
{ if(!f.canWrite())
{
if(f.isDirectory()|f.isFile())
f.delete();
}
}
}
catch(Exception e)
{
System.out.println("FILE NOT FOUND");
e.printStackTrace();
}

}
}


View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
Java Beginners

explanation to your code - Java Beginners
explanation to your code  sir, I am very happy that you have...)?And i have imported many classes.but in your code you imported a very few classes.sir i need your brief explanation on this code and also your guidance.this 

Java Beginners

I need your help - Java Beginners
I need your help  What is the purpose of garbage collection in Java, and when is it used?  Hi check out this url : http://www.artima.com/insidejvm/ed2/gc.html http://java.sun.com/javase/technologies/hotspot 

Java Beginners

I need your help - Java Beginners
the file name is ApplicationDelivery.java Your program must follow proper Java...I need your help  For this one I need to create delivery class for a delivery service .however, this class should contain (delivery number which 

Java Beginners

This Question was UnComplete - Java Beginners
your need.Create a sourceFile and goahead. /** * Program to take an single... to delete the temporary file). **/ public void deleteFile(String fileName 

Java Beginners

java - Java Beginners
(); } } /** * Deletes the object file. */ public void deleteFile() { File 

Database Tools

Controlling your program
statements (break, continue, return) in Java programming language. Selection The if statement: To start with controlling statements in Java, lets have.... That is the if statement in Java is a test of any boolean expression. The statement following 

Java Beginners

java beginners - Java Beginners
java beginners   the patteren u received is not the actual patteren... to sent the different patterns so that your will get the right one...(.) and send your pattern. Thanks 

Java Beginners

java beginners - Java Beginners
java beginners   let me know the java code for the followign... args[]) { System.out.println("try these........"); System.out.println("your... these........"); System.out.println("your series is....."); for(i=1;i<=3;i 

Java Beginners

Java basics - Java Beginners
://www.roseindia.net/java/beginners/Varconstltr.shtml for more code and examples on Java...literals in java program  Why we use literals in java program? ...; literals are represented directly in your code without requiring computation. As shown 

Java Beginners

Java programming - Java Beginners
to : http://www.roseindia.net/java/beginners/index.shtml Thanks...Java programming  hi sir, my question are as follows... hope u can solve my java programming problem.. Write a program to develop a class to hold 

Java Beginners

java programming problem - Java Beginners
.. http://www.roseindia.net/java/beginners/java-word-count.shtml http://roseindia.net...://www.roseindia.net/java/beginners/java-word-count.shtml http://roseindia.net/java...java programming problem  Hello..could you please tell me how can I 

Java Beginners

java - file delete - Java Beginners
java - file delete  I will try to delete file from particular folder. My code is executed correctly in other project and main function. In same... class DeleteFile { public static void main(String[] args) { String 

Java Beginners

java code to search in your hard disck
java code to search in your hard disck  Build a search engine which would scan your hard disk and build an inverted index for your files. The search engine should cluster your files according to some criteria and make some 

Java Beginners

small java project - Java Beginners
small java project  i've just started using java at work and i need to get my self up to speed with it, can you give me a small java for beginners project to work on. your concern will be highly appreciated 

Java Beginners

small java project - Java Beginners
small java project  i've just started using java at work and i need to get my self up to speed with it, can you give me a small java for beginners project to work on. your concern will be highly appreciated 

General

Java Basic Tutorial for Beginners
Java Basic Tutorial for Beginners - Learn how to setup-development environment and write Java programs This tutorial will get you started with the Java...) More tutorials for beginners Getting Started with Java Learn 

Java Interview Questions

i need your help - Java Interview Questions
i need your help  Write a java program that: i. Allows user to enter 2 numbers from the keyboard ii. Uses a method to compare the two numbers to determine which is larger iii. Print to the screen stating which number is larger 

Java-Tutorials

Java projects for beginners
In this tutorial you will be briefed about the Java projects for beginners... will explore your java ideas and your thoughts. It is advised that students... about the nature of your projects being beginners. You should also add 

Programming Tutorials

Creating your own package in java
and subpackage click on the following links Create Your Own Package Create 

Java Beginners

java-io - Java Beginners
http://www.roseindia.net/java/beginners/SquareMatrix.shtml Thanks...java-io  Hi Deepak; down core java io using class in myn... your code do some changes in your code : int r,c; int arr[][]; intialize r 

Java Beginners

java - Java Beginners
visit these following pages for your answers : http://www.roseindia.net/java/java...-conversion http://www.roseindia.net/java/beginners I hope this will help you...java  Q 1- write a program in java to generate Armstrong numbers 

Java Beginners

Java Syntax - Java Beginners
/java/beginners/array_list_demo.shtml Thanks...Java Syntax  Hi! I need a bit of help on this... Can anyone tell... Lists unless you provide your own method java.util Implementations of List 

Java Beginners

Java Objects - Java Beginners
Java Objects  Hi I have the following question, What method in Java is used to destroy your objects. Thanks in advance 

Core Java

Ask Programming Questions and Discuss your Problems
Ask Programming Questions and Discuss your Problems       Dear Users, Analyzing your plenty of problems and your love for Java and Java and Java related fields, Roseindia Technologies 

Java Beginners

java - Java Beginners
; Advanced->Environment Variables and create your JAVA_HOME, CLASSPATH etc. there. The value of JAVA_HOME variable is the root folder location of your JAVA... variable is the "bin" folder location in your JAVA Installation. Eg: C:\Program Files 

Java Beginners

java programming - Java Beginners
java programming  asking for the java code for solving mathematical equation with two unknown .thnx ahead..  Hi Friend, Please clarify your question. Which mathematical equations you want to solve? Thanks 

Java Beginners

java program - Java Beginners
java program   1.java program to Develop a multi-threaded GUI application of your choice. 2.program to Develop a template for linked-list class along with its methods in Java 

Java Beginners

java - Java Beginners
java  Develop a multi-threaded GUI application of your choice.  Hi Friend, Please visit the following link: http://www.roseindia.net/java/example/java/applet/ClockApplet.shtml Hope that it will be helpful 

Java Beginners

Java - Java Beginners
OutOfMemoryError error is your Java program, you should consider increasing the JVM space...Java  1.How do you declare the starting point of a Java application? 2. What happened if your program terminates with an OutOfMemoryError 

Java Interview Questions

Beginners in Java
Beginners in Java  Hi, I am beginners in Java, can someone help me... tutorials for beginners in Java with example? Thanks.   Hi, want to be command over Java, you should go on the link and follow the various beginners 

Java Beginners

java beginners - Java Beginners
the following links: http://www.roseindia.net/java/beginners/StringTokenizing.shtml http://www.roseindia.net/java/beginners/tokenizingjavasourcecode.shtml...java beginners  what is StringTokenizer? what is the funciton 

Java Beginners

java - Java Beginners
java  a java code that takes input regular expression and a string and produces as output all lines of the string that contains a substring denoted by regular expression  Hi Friend, Please clarify your problem 

Java Beginners

java - Java Beginners
to your employer, peers and customers that you are proficient in Java...java  What is SCJP and write its benefits. How it is useful for JAVA programmers.  Hi Friend, Sun Certified Java Programmer 

Java Beginners

java - Java Beginners
to your employer, peers and customers that you are proficient in Java...java   What is SCJP and write its benefits. How it is useful for JAVA programmers.  Hi Friend, Sun Certified Java Programmer 

Java Beginners

java Frames - Java Beginners
java Frames  Hi friend, Thanks for your reply. Can i use frames in socket program.  Hi anita, I am sending you a link...://www.roseindia.net/java/network/client-socket-information.shtml Thanks 

Java Beginners

JAVA statement - Java Beginners
JAVA statement  The import statement is always the first noncomment statement in a Java program file.Is it true?  Hi Friend, No,it is not true.If your class belongs to a package, the package statement should 

Java Beginners

Java Query - Java Beginners
Java Query  Q.What is "Identifier Expected Error" in Java and when... the code inside the class body. 3)If you will not call your method properly... will not declare your class, constructor and method properly. 5)If your class name 

Java-Tutorials

Java Tutorial for Beginners
This Java tutorial for beginners is very useful for a person new to Java. You.... First we will ensure that the Java is installed and configured on your computer..., first install and configure Java on your computer. Lets write an application 

Java Beginners

Java Project - Java Beginners
Java Project  Dear Sir, Right now i am working in java image..., shape . So how to split one image like Texture, color, shape , kindly give your..., Please visit the following links: http://www.roseindia.net/java/example 

Java Beginners

java - Java Beginners
java   your website is best look i am intension of this java... the following links: http://www.roseindia.net/java/language/inheritance.shtml http://www.roseindia.net/java/master-java/method_overloading.shtml http 

Java Beginners

insertionSort - Java Beginners
insertionSort  1 Problem Task Your task is to develop part...)); } } For more information on Java Array visit to : http://www.roseindia.net/java/beginners/arrayexamples/index.shtml Thanks 

General

Java Tutorial for Beginners in Java Programming
Java Tutorial for Beginners - Getting started tutorial for beginners in Java programming language These tutorials for beginners in Java will help you.... Let's get started with the Java Tutorial for Beginners Here are the basic 

Java Beginners

java - Java Beginners
java  how to manipulate thumb impression using java.for that what technology i should use?  Give your details correctly. Cant able to understand your question 

Java Beginners

Core java - Java Beginners
multiple inheritance from java is removed.. with any example.. Thank you in advance for your valuable answer   Hi, I am sending you...://www.roseindia.net/java/master-java/inheritance.shtml Thanks  Hi 

Java Beginners

preparestatement in jsp - Java Beginners
preparestatement in jsp  I'm dyana from Malaysia.I am a Java beginners and I keen to learn and always search and explore through Roseindia.I had try..., Thanks for your appreciation. Please visit the following links to view examples 

Java Beginners

java - Java Beginners
java  hi, i'm chandrakanth.k. i dont know about java. but i'm...://www.roseindia.net/java/master-java/java-a-general-purpose-languaage.shtml http://www.roseindia.net/java/master-java/index.shtml http://www.roseindia.net/java/master 

Java Beginners

java error - Java Beginners
java error  G:\threading>javac threadmethods.java Note: threadmethods.java uses or overrides a deprecated API. Note: Recompile with -Xlint... been obsoleted. To get the details of your error, compile your class with Xlint 

Java Beginners

java project - Java Beginners
java project  hi this amol i wish to do a project on banking software in java can u help   how can i help u .. and what the kind... adam certified java programmer certified websphere   ya sure!! what 

Java Beginners

java encoding - Java Beginners
://www.roseindia.net/java/java-conversion/CharToASCIIi.shtml Your comments are welcome regarding...java encoding  how to encode String variable to ASCII,FromBase64String,UTF8  Hi It's very easy to convert String Variable into ASCII 

Java Beginners

java methods - Java Beginners
java methods  Hello, what is difference between a.length() and a.length; kindly can anybody explain. thanks for your time  Hi Friend, length() is used to find the length of string whereas length is used 

Java Beginners

java class - Java Beginners
java class  wts need of this code? UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());   Hi Friend, If you want to give Window look to your frame,dialog box etc,then you have to use the following 

Java Beginners

Java Error - Java Beginners
Java Error  Hello Sir ,How i Can solve Following Error Can not find Symbol - in.readLine(); Here Error Display at in  Hi Friend, It seems that you haven't defined the object 'in'.Anyways, Send your code so that we 

Java Beginners

java programming - Java Beginners
java programming  heloo expert, thanks for your coding i recently asked about the question on abt how to program a atm system may i noe in which platform can i run those codes ?? netbeans ?? any suggestions 

Java Beginners

core java - Java Beginners
core java  when write java program in editplus.then save&compile the file. 1-text file 2-class file 3-bak file how can get this files plz tell me  Hi Friend, Please clarify your problem. Thanks 

Java Beginners

java - Java Beginners
java  E:\sushant\Core Java\threading>javac -Xlint...; This warning comes when methods of old Java Versions are invoked. Just ignores this warning and run the program. Your program will successfully runs.  

Java Beginners

JAVA PROJECT - Java Beginners
JAVA PROJECT  Dear Sir, I going to do project in java " IT in HR, recruitment, Leave management, Appriasal, Payroll" Kindly guide me about... etc. I am doing project first time. waiting for your reply, Prashant 

Java Beginners

Package in Java - Java Beginners
myPackage and under that you can see your java file andd class file of packageExp... that folder of related java files. ex, if you write a jaava class like 

Java Beginners

Java Compilation - Java Beginners
Java Compilation  How do you design a Java application that inputs a single letter and prints out the corresponding digit on a telephone? It should... for your Help 

Java Beginners

Java Stack - Java Beginners
Java Stack  Can you give me a code using Java String STACK using the parenthesis symbol ( ) the user will be the one to input parenthesis... for your help sample output Enter a string: ()() VALID Enter a string 

Java Beginners

Java Project - Java Beginners
Java Project  Hey, thanks for everything your doing to make us better. Am trying to work on a project in java am in my first year doing software Engineering and the project is m end of year project. Am really believing 

Java Beginners

JAVA - Java Beginners
JAVA  Dear Sir, Kindly arrange to send urgently the answers to the following in JAVA rega1.JAVA rding True or False, please. 1. JAVA is pure object oriented Language .. True/False 2. Private number of your Class 

Java Beginners

java - Java Beginners
java  Hi guys, Thanks for your help to many... Please I need java codes to solve the following problems. 1. X2-y2 where x=sum of odd numbers from 1... java code to show the frequency of occurance of all the sides. Thank you all 

Java Beginners

java code - Java Beginners
java code  there is an error like the headerfiles does not exists(poi... or into microsoft power point using java?????plzzz insert its java code... of your jdk: poi-3.6-20091214.jar poi-scratchpad-3.6-20091214.jar 

Java Beginners

java - Java Beginners
java  what does the following mean? 1.this 2.is-a 3.has-a   Hi Friend, Please clarify your problem. Thanks 

Java Beginners

java - Java Beginners
java   /* Write a program that converts a number entered in Roman numerals to decimal. Your program should consists * of a class, say Roman... * L 50 * X 10 * V 5 * I 1 * * d) test your program using 

Java Beginners

java - Java Beginners
java   what is the difference between classpath and path   ... files While Classpath is Enviroment Variable that tells JVM or Java Tools where to find your classes. In PATH Environment variable you need to specify only 

Java Beginners

Link List proble, - Java Beginners
/java/beginners/linked-list-demo.shtml Hope that it will be helpful for you... Node to your list and Delete to your list...... my brain is bleeding can you 

Java Beginners

Java Compilation - Java Beginners
Java Compilation  Dear Sir, Thanks for giving the code for the question which i posted. I went through the program "Write a Java program to read... that each DNA sequence is just a String). Your program should sort the sequences 

Java Beginners

java - Java Beginners
: C:\mywork> path c:\Program Files\Java\jdk1.5.0_09\bin;%path% 4. Compile your class(es): C:\mywork> javac *.java 5. Create... Command Prompt. 2. Navigate to the folder that holds your class files 

Java Beginners

java - Java Beginners
error is could not create a java virtual machine..  The error UnsupportedClassVersionError means you are trying to run Java code compiled with a new version of Java with an old version of the runtime environment. Version 49.0 

Java Beginners

java array - Java Beginners
java array  1.) Consider the method headings: void funcOne(int...]; int num; Write Java statements that do the following: a. Call... and Alist, respectively. THANK YOU GUYS FOR SHARING YOUR IDEA ABOUT THIS.THANK 

Java Beginners

java problem - Java Beginners
java problem  Suppose list is an array of five components of the type int.What is stored in list after the following Java code executes? for (i...] - 3; } THANK YOU GUYS FOR SHARING YOUR IDEA ABOUT THIS.THANK YOU SO MUCH!ILL 

Java Beginners

Java - Java Beginners
Please let me know the way Thanks in advance   Awaiting your reply  Hi Friend your first answer is absolutely right.i am...://www.java-tips.org/blog/java-se/java-reflection-api-overview.html 

Java Beginners

java program - Java Beginners
java program  plzzzzz help me on this java programming question? hello people.. can u plzzzzzzzzzzzzzzzzzzz help me out with this java programm. its... 1. Enter your move: D a ----------------------- Board Positions + A o 

Java Beginners

java program - Java Beginners
java program  what is the program the a simple program in Java that allows a user to enter 3 integers representing the lengths of the sides... the following code to solve your problem. class Triangle { public static 

Java Beginners

Java Array - Java Beginners
Java Array  Can someone help me to convert this to java? I have an array called Projects{"School", "House", "Bar"} I want all the possible... -> ["School", "House", "Bar"] Thanks in advance for your time 

Java Beginners

java program - Java Beginners
java program  i have two classes like schema and table. schema class... name, catelogue,columns, primarykeys, foreignkeys. so i need to write 2 java... retrieves data from database(mysql).  Hi friend, Please specify your 

Java Beginners

java - Java Beginners
java  hello, Please help me with code for the following well,i am supposed to create a java program that recieves information from other programs... you. and your previous code really helped me alot thanks alot.    

Java Beginners

java - Java Beginners
it is the ability to "reflect" on the structure of your program. For more information, visit the following link: http://www.roseindia.net/java/reflect/ Thanks 

Java Beginners

java code - Java Beginners
java code  Write a program that performs flashcard testing of simple mathematical problems. Allow the user to pick the category. Repetitively... and have the following concepts in your program: ? Array of objects. ? Class 

Java Beginners

core java - Java Beginners
; Hi friend, As per your requirement code for equilateral traiangle...://www.roseindia.net/java/ Thanks 

Java Beginners

java - Java Beginners
it is the ability to "reflect" on the structure of your program. For more information, visit the following link: http://www.roseindia.net/java/reflect 

Java Beginners

OOP - Java Beginners
); } For more information on Java visit to : http://www.roseindia.net/java/ http://www.roseindia.net/java/beginners/Construct.shtml Thanks...) { one =a; two=b; } }   Hi friend, We check your code having 

Java Beginners

java - Java Beginners
java  All programming languages have different pattern of data declaration, data types and operators it supports.   Hi Friend, Please clarify your problem. Thanks 

Java Beginners

Java Not running - Java Beginners
Java Not running  Hi, I tried to create a grade(type array...) { System.out.print("Your Final Grade is A"); } else if ((average <= 60) && (average < 70)) { System.out.print("Your Final Grade 

Java Beginners

java - Java Beginners
java   Reading a file content in java(with concept & source code) Reading contents of any URL in java (with concept & source code)  Hi...) { System.out.println("Sorry! Your given file is too large."); System.exit(0 

Java Beginners

java - Java Beginners
java  i have to make a programm in java to multiply any number with 100 without using any math operator.I hav got this answer. but i hav to make... to solve your problem. Here is a sample code which you can use for your help 

Java Beginners

java error - Java Beginners
java error  Hello sir, on compiling any program from command prompt... for file: Test.java C:\Program Files\Java\jdk1.6.0_17\bin>javac Test.java C:\Program Files\Java\jdk1.6.0_17\bin>java Test Exception in thread "main 

Java Beginners

Java - Java Beginners
codes (sorting and partitioning) to Java. It should be able to execute any set of data. Note:- You should provide the test data and the results of your program. (d) Modify your program to show the performance of the quicksort algorithm when 

Java Beginners

java Code - Java Beginners
java Code  Write a Java Program that find out the age of person...{ public static void main(String[]args){ System.out.println("Enter your Date...) - cal1.get(Calendar.YEAR) + factor; System.out.println("Your age 

Java Beginners

java - Java Beginners
java  java.lang.NoClassDefFoundError runtime exception   check whatever class u used are exist or not in your current project path  Thrown if the Java Virtual Machine or a ClassLoader instance tries to load 

Java Beginners

java code - Java Beginners
java code   Sir Ineed one code for Matrix "Take a 2D array and display all elements in matrix form using only one loop " request this question i asked last one week back but Your people send me one answer 

Java Beginners

Java - Java Beginners
Java  Dear Sir, I am working image searching in java project , in that i have to split one image like texture , color , shape then after... to what i am giving. Kindly give your suggestions and i need source coding also 

Java Beginners

java - Java Beginners
java  write a java programe to get the multiplication table from 1 - 10..   Hi Friend, Here we are sending you a code which prints the table for any number you want to insert. Please check the code to solve your 

Java Beginners

Java Program - Java Beginners
Java Program  Hi I have this program I cant figure out. Write a program called DayGui.java that creates a GUI having the following properties... Mnemonic B Add individual event handlers to the your program so that when 

Java Beginners

java multithread - Java Beginners
java multithread  Hi, Thanks for your multithreading java code. It helped me a lot. But i have one issue. My code is look like this. public class classname extends Thread { public classname() { super 

Java Beginners

java answerURGENT! - Java Beginners
java answerURGENT!  consider folowing method headings: public static... these parameters in a call to the method test? e.Write a Java statement that prints..., and 'z'. f.Write a Java statement that prints the value returned by method two 

Java-Tutorials

Java examples for beginners
of examples. Java examples for beginners: Comparing Two Numbers The tutorial provide...In this tutorial, you will be briefed about the word of Java examples, which help to understand functioning of different Java classes and way. It also 

Java Beginners

java - Java Beginners
in Java.   PROGRAM TO IMPLEMENT LINKED LIST Implementation File... s1; node newnode=new node(); System.out.println("Input your data for your...; newnode.nxt=head.nxt; head.nxt=newnode; System.out.print("Your node 

Java Beginners

java - Java Beginners
java  how to wtite a program that evaluates the series for some integer n input by the user where n! is a factorial of n  Hi Friend, Please clarify your problem. Do you want to print the factorial of a number 

Advertisements Advertisements
 

 

 

DMCA.com