User Comments for the tutorial:

Moving file or directory from one directory to another



I don't think it is in business,in fact it can not
I don't think it is in business,in fact it can not work well when I tried to move a folder to another dirctory 

I tried using the same way to move files in java b
I tried using the same way to move files in java but the behavior is very inconsistent - it copies successfully but sometimes deletes and sometimes not. Please see if you can suggest some other solution for file movement 

Its very helpfull and reduced the lot of working time of me.nice example. 

Its very helpfull and reduced the lot of working time of me.nice example. 

Need more specification
i m not getting the meaning of statement:- for(File child : childFiles) As i m using java1.4.2_06 and getting error in the program given by you. Please help out. 

i had problems too, i found a solution
I use the line destDir.mkdirs() instead of destDir.mkdir() in the function copyDirectory(File sourceDir, File destDir), and it works It was very helpfull  

Thanks for Moving Files and Directory code
Moving File code has been very usefull. I had been looking around the whole week for something like that. I am doing java at college. Thanks for this code. Could you be contacted in future for some java help? Deo Wisconsin, USA. 

Very Helpful
Explanation with the sample code was very helpful. Thank you. 

Keeping Original Folder/File while Copying
When I try to move a file for example a text file, it doesnt let me but moving a folder will work. What if I wanted to copy the folder/file to another directory and keep the original? 

Related Tutorial and Articles
Java Beginners

Import java IO - Java Beginners
Import java IO  for example i know java IO is for input and output. I am using Netbeans5.5.1. How can i see all the classes related to java IO for example; stream reader, buffer reader 

Programming Tutorials

Working With File,Java Input,Java Input Output,Java Inputstream,Java io Tutorial,Java io package,Java io example
provide a simple model for reading and writing data. However, streams don't support... to work with a file using the non-stream file I/O. The File class is used... to the existence of a corresponding file/directory. If the file exist, a program can 

Java Beginners

io packages - Java Beginners
io packages  How can I add two integers in java using io pacages 

Java Beginners

java-io - Java Beginners
java-io  Hi Deepak; down core java io using class in myn code twodimensional arry is not supportin. veryfy my code ... how can i... { BufferedReader br=null; for(int i = 0;i < r; i ++) { for(int j = 0; j 

Java Beginners

java binary file io example
java binary file io example  java binary file io example 

Java Beginners

io  create a meanu based text editor in java having features of creating file,viewing file,deleting file,renaming file,copying file and cutting file 

Java Interview Questions

Java IO
Java IO  What an I/O filter 

Java Beginners

io  write a program in java to accept a filename from user and print its content on the monitor   Hello Friend, Try the following code: import*; import java.util.*; class DisplayContentOfFile { public 

Java Beginners

IO in java
IO in java  Your search mechanism will take as input a multi-word query and will return a list of documents where the given words appear. 1. Your... the words specified appear closer to one another. For example, if you search 


Java IO Path
Java IO Path In this section we will discuss about the Java IO Path. Storage.... These sub folders can contains a file or sub folders and so on. For example... is called a Path of that file or folder using which they can be accessed easily