Home Answers Viewqa Development-process Please develop code

 
 


Ashu
Please develop code
1 Answer(s)      3 years and 2 months ago
Posted in : Development process

i want to develop a program that search a file in a directory and its subdirectories and rename that file with name of main directory
View Answers

April 7, 2010 at 5:33 PM


Hi Friend,

Following code searches the file.

import java.io.*;
import java.util.*;
public class SearchFile {

private static void traverse(String name, File dir ) {
File [] children = dir.listFiles();
for(File file : children) {
if(file.isFile()) {
if(file.getName().equals(name)){
System.out.println(file.toString());
}
} else {
traverse(name, file);
}
}
}

public static void main(String[] args) throws Exception{
traverse("in.txt",new File("C:/"));
}
}

Thanks









Related Pages:
Please develop code - Development process
Please develop code  i want to develop a program that search a file in a directory and its subdirectories and rename that file with name of main directory  Hi Friend, Following code searches the file. import
please provide the code
please provide the code   Develop a multi-client chat application
develop code - Java Beginners
develop code   i want to develop a program that search a file in a directory and its subdirectories and rename that file with name of directory
please give me an idea to develop a program for this question?
please give me an idea to develop a program for this question?  How to enter a text or number from keyboard without using InputStreamReader method in java
please any one can help me to write a code for this question?
please any one can help me to write a code for this question?  Q 1) In a class first day 25 students are joined. After two days that total students will increased to 60. We can develop a program by using ArrayList concept
Please provide the code
Please provide the code   Write a program to recursively download the web pages available in the given site URL
Please provide the code
Please provide the code   Program to find depth of the file in a directory and list all files those are having more number of parent directories
Please provide the code
Please provide the code   Create a file system: We just have one file on the hard disk. But we can create directories, sub-directories and files in that file only
Provide the code please
Provide the code please   Program to calculate the sum of two big numbers (the numbers can contain more than 1000 digits). Don't use any library classes or methods (BigInteger etc
Please help with this code
Please help with this code  I need some help getting the Search method below to work with the menu, and I also cannot figure out how to get my bubble sort to work. I've spent a long time on this and think my brain is just fried
please provide code - Java Beginners
please provide code  provide code to snake game in J2SE
I need to develop a gui like this
please help me   sorry goes through this link I need to develop like this image..please goes through...I need to develop a gui like this  Hai Friends, I need to develop
please send code - Java Beginners
please send code  hai friends plese provide code for fallowing... number it should be taken as single number) URGENTLY send the code for this  Hi friend, Code to solve the problem : class StringExampleJava
could anyone please help with the code.
could anyone please help with the code.  protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException...(request, response); } } could anyone please check the code. If i enter
ajax code please help to solve this........
ajax code please help to solve this.  in this i am trying to get data... null; } please help me when i am running this it show an error... the fourth one similarly. For the above code, we have used 3 database tables
How to develop EJB3.0 with eclipse3.3.1 ? - EJB
How to develop EJB3.0 with eclipse3.3.1 ?  Hi, I am new to ejb3.0 with eclipse3.3.1.Could you please help me how to create web application. server : jboss4.2.2 database : mysql5.0.51 Here i need how to create username
please help
please help  please send me the code of dynamic stack in java without using the built in functions
Design and develop custom tags
Design and develop custom tags...;   Design and develop custom tags Custom.... Tag libraries reduce the task of embedding excessive amounts of Java code
Design, develop and test JSPs
Design, develop and test JSPs...;   Design, develop and test JSPs Creating... JavaScript, HTML, or JSP tagging, including Java source code inside
urgent...pleAse help me.....please!
urgent...pleAse help me.....please!  please help me urgent! how can i do dictionary with the use of array code in java, where i will type the word then the corresponding meaning for that word will appear...thanks
Design and develop entity EJBs
Design and develop entity EJBs... components Next    Design and develop entity EJBs..., you'll have to write some code. CMP is slower in high volume transaction
help please
file.. Or atleast help me with code here.. I tried checking session alive
how to develop ejb3.0 using eclipse ? - EJB
how to develop ejb3.0 using eclipse ?  Please any one help me
How To Develop Login Form In Struts
How To Develop Login Form In Struts   .... This article  will explain how to develop login form in struts. Struts adopts...;loginAction", which is defined in the struts-config.xml file . Here is code
please help me to write a code for this program
please help me to write a code for this program   1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
please help me to write a code for this program
please help me to write a code for this program   1 1 1 1 2 2 1 1 3 4 3 1 1 4 7 7 4 1
How to develop EJB3.0 , jsp with myeclipse ? - EJB
How to develop EJB3.0 , jsp with myeclipse ?  Hi, How to develop EJB3.0,jsp project with myeclipse using jboss4.2.2. I have problem in project type File - > New - > Enterprise Application Project. Please any body
Design and develop message-driven EJBs
Design and develop message-driven EJBs... components Next    Design and develop message... the following code
Please tell me the code to generate the below structure
Please tell me the code to generate the below structure  1 2 3 4 5 6 7 8 9 1 2 3 4 6 7 8 9 1 2 3 7 8 9 1 2 8 9 1 9 1 2 8 9 1 2 3 7 8 9 1 2 3 4 6 7 8 9 1 2 3
Not sure whats wrong with my code HELP PLEASE?!?!
Not sure whats wrong with my code HELP PLEASE?!?!  I cant figure out what I am doing wrong in my code can anyone help me out??? Grades function computeGrade( ) { var hw, lab, midt, fin, avg; hw = parseFloat
please help me to give code - Java Beginners
please help me to give code  Write a function, sliding(word, num)that behaves as follows. It should print out each slice of the original word having length num, aligned vertically as shown below. A call to sliding(examples, 4
please help me to give code - Java Beginners
please help me to give code  Write a function with a signature cheerlead(word) that prints a typical cheer as follows. The word robot: Gimme an R Gimme an O Gimme a B Gimme an O Gimme a T What did you give me? ROBOT
Please help me fix this code - MobileApplications
Please help me fix this code   Please help me in this area of code... in the background of the forms in this code i want to sum all expenses amount... expenses)", "Please fill all required field \n \n * This signify required field
please convert for me this code to GUI - Swing AWT
please convert for me this code to GUI    THE CODES ARE BELOW...; } else screen.displayMessageLine( "\nInvalid account Nummber or PIN, Please...; screen.displayMessageLine("\n Your cash has been"+ "dispensed. please take your cash
please help me to give code - Java Beginners
please help me to give code  Write a program that prints an n-level stair case made of text. The user should choose the text character and the number of stairs in the stair case * ** *** ****   Hi friend
please help me to give code - Java Beginners
please help me to give code  Write a program that uses loops to generate an n x n times table. The program should get n from the user. As a model here is a 4 x4 version: | 1 2 3 4
Please write code for this program in java and Explain it ? pl'sssssssss
Please write code for this program in java and Explain it ? pl'sssssssss  Question: We are given an array of 2n integers wherein each pair in this array of integers represents the year of birth and the year of death
Please provide the java code for the given program.
Please provide the java code for the given program.   We need an application for managing an educational institute. That application should provide the details of Students Courses Faculty Fee details etc..,   
please help me to give code - Java Beginners
please help me to give code  Write a program that reads a file named famous.txt and prints out the line with the longest length. In the case of a tie, you may print out only one of them. For example in the file: Alan Turing
please convert for me this code to GUI - Swing AWT
please convert for me this code to GUI  THE CODES ARE BELOW, CLASS ATMCaseStudy is the driver class that runs all the other classes. its very urgent... account Nummber or PIN, Please try again."); } private void
code
code  please provide code for custom tags.by using currdate tag we need to get current date?please give me code
Please provide jquery inline form validation for the code
Please provide jquery inline form validation for the code   <html> <head> <meta http-equiv="Content-Type" content="text/html...; </table> </form></body></html>   Please visit
Please help me to modify my java code from php code
]; } } I tried like this (see below JSP code) ... but this is not giving me the exact result as the above PHP code is giving. So please help me to convert...Modify Java code from PHP Code  i want to covert this php code int
Please help me to modify my java code from php code
Please help me to modify my java code from php code  i want to covert this php code int java/JSP . if (isset($_POST['orders'])) { $orders...) ... but this is not giving me the exact result as the above PHP code is giving. So please
Need to develop Java Program - Development process
Need to develop Java Program  Develop Date class in Java similar to the one available in java.util package. Use JavaDoc comments.  Hi Friend, Try the following code: public class Date { private final int
please help me.
please help me.  Please send me a code of template in opencms and its procedure.so i can implement the code. Thanks trinath
Please Send - Java Beginners
Please Send  Hi, this is perfect ur sending code I want java script coding Steps:-If user click on refresh button then page iage will be refresh Thanks  Hi friend, Thanks vineet
Please help me.
Please help me.  Hi i am trinath in below there is a url.In that url there is a code of edit a jsp page.I understand that code but only one thing i not get it i.e; What is the work of "id".and what is the data type of id? http
help please!!! T_T
help please!!! T_T  what is wrong in this?: import java.io.*; class...("please enter your name:"); name1= input.readline(); System.out.println("please..."+ "name2"+ are+ friends); }   We have modified your code. Check
please help me
please help me  Dear sir, I have a problem. How to write JSP coding... before. This name list should get from the database. Please help me. By the way, I'm using access database and jsp code. Thank you