I am trying to write a function that would copy code from a source file to destination file.

`copyCode("D:/rraina_IN-L0124_173"+fileName.substring(1), oldTempFile);`

This is my function call.

`String oldTempFile = "D:/rraina_IN-L0124_173/temp/Old_" + fileName;`

this is `oldTempFile` that is the destination.

This is the function.

```
private static void copyCode(String src, String destination) throws IOException {
        FileChannel src1 = new FileInputStream(new File(src)).getChannel();
        FileChannel dest1 = new FileOutputStream(new File(destination)).getChannel();
        dest1.transferFrom(src1, 0, src1.size());
        src1.close();
        dest1.close();
    }

```

However when I run it I get the error :

> 
> Failed for
>  file:/gatherer/gather/main/scripts/HartfordRetirement.javajava.io.FileNotFoundException:
>  D:\rraina\_IN-L0124\_173\temp\Old\_HartfordRetirement.java (The system
>  cannot find the path specified)
> 
> 
>