I am trying to use copyDirectory() method from ApacheCommnonsIO package.
My code is:
First Class
import java.io.*;
import org.apache.commons.io.FileUtils;
public class ClassN1{
public static methodThatUsesCPDIRMethod(){
String src = "/home/user/dir_src";
String dst = "/home/user/dir_dst";
try {
FileUtils.copyDirectory(new File(src), new File(dst));
} catch (IOException e){ }
}
Second class
public class ClassN2{
public ClassN2(){
ClassN1.methodThatUsesCPDIRMethod();
}
}
Main method
public class Main{
public static void main(String[] args){
ClassN2 obj = new ClassN2();
}
}
Is just an example, in code I haven't syntax errors, that can be there.
Problem: the ClassN1.methodThatUsesCPDIRMethod() in second's class constructor is highlighted with an error:
Unhandled exception type IOEsxception
I use VIM + Eclim plugin (Eclipse)