/** * @param project * @param destinationPath * @param classpathToMigrate */ private void migrateSourceFiles( IProject project, IPath destinationPath, IClasspathEntry[] classpathToMigrate) { IPath relativeDestinationPath = ((IPath) destinationPath.clone()).makeRelativeTo(newProject.getFullPath()); System.out.println( "migrate source destination: " + destinationPath + " relative: " + relativeDestinationPath); IFolder destination = newProject.getFolder(relativeDestinationPath); for (IClasspathEntry entry : classpathToMigrate) { if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE) { try { IPath relativeSourcePath = entry.getPath().makeRelativeTo(project.getFullPath()); IFolder source = project.getFolder(relativeSourcePath); SPLMigrationUtils.recursiveCopyFiles(source, destination); newProject.refreshLocal(IProject.DEPTH_INFINITE, null); } catch (CoreException e) { CorePlugin.getDefault().logError(e); e.printStackTrace(); } } } }