i want to move only zip file from one folder to another folder everyday.
Here is found a simple code from Developperzone website but it only copies a known txt file.
I want to use something like *.zip
Thank you
import java.io.*;
public class CopyFile
{
public static void main(String args[]) throws Exception
{
BufferedReader br = new BufferedReader(
new FileReader("line.txt"));
BufferedWriter bw = new BufferedWriter(
new FileWriter("linenum.txt"));
String s, space=" ";
int num=0;
while (br.ready())
{
s=br.readLine();
num++;
bw.write(String.valueOf(num));
bw.write(space);
bw.write(s);
bw.newLine();
}
bw.close();
}
}
Use
java.io.Fileand its methods to get the list of .zip files and move them (Tutorial – Moving a File or Directory).