dest.setReadOnly();
    public void testOverwrite() throws Exception {        _project.setProperty("ivy.dep.file", "test/java/fr/jayasoft/ivy/ant/ivy-simple.xml");        IvyResolve res = new IvyResolve();        res.setProject(_project);        res.execute();                _publish.setPubrevision("1.2");        _publish.setResolver("1");        File art = new File("build/test/publish/resolve-simple-1.2.jar");        FileUtil.copy(new File("test/repositories/1/org1/mod1.1/jars/mod1.1-1.0.jar"), art, null);                Echo echo = new Echo();        echo.setProject(_project);        echo.setMessage("new version");        echo.setFile(art);        echo.execute();        File dest = new File("test/repositories/1/jayasoft/resolve-simple/jars/resolve-simple-1.2.jar");        FileUtil.copy(new File("test/repositories/1/org1/mod1.1/jars/mod1.1-1.0.jar"),                 dest, null);        echo = new Echo();        echo.setProject(_project);        echo.setMessage("old version");        echo.setFile(dest);        echo.execute();        dest.setReadOnly();                _publish.setOverwrite(true);        _publish.execute();        assertTrue(dest.exists());        BufferedReader reader = new BufferedReader(new FileReader(dest));        assertEquals("new version", reader.readLine());        reader.close();    }