I am working on Android. My requirement is that I have one directory with some files, later I downloaded some other files into another directory and my intention is to copy all
Apache FileUtils does this very simple and nicely..
include Apache commons io package add commons-io.jar
or
commons-io android gradle dependancy
compile 'commons-io:commons-io:2.4'
Add this code
String sourcePath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/TongueTwister/sourceFile.3gp";
File source = new File(sourcePath);
String destinationPath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/TongueTwister/destFile.3gp";
File destination = new File(destinationPath);
try
{
FileUtils.copyFile(source, destination);
}
catch (IOException e)
{
e.printStackTrace();
}