Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

PDT Dev2Dev - Copy Files the Eclipse way

In case you want a convenient way to copy files the way Eclipse does, plus to have ability to copy directories, to track errors and have progress reported by monitor and several additional options, you are welcome:

new LocalFile(new File(source)).copy(new LocalFile(new File(destination)), EFS.NONE, monitor);

--Seva Lapsha 11:59, 6 November 2007 (EST)

Note that LocalFile has "discouraged access", and will result in a warning given the typical Java compiler settings within Eclipse. This can be avoided by adding an annotation to the function thusly:

@SuppressWarnings("restriction")

Alternatively, you can disable the restriction warning in Window->Preferences...->Java->Compiler->Errors/Warnings->Deprecated and restricted API

PS: Thank you very much.. quite handy.

PPS: This worked with Helios SR2.

--Mstorer3772.gmail.com 19:27, 23 March 2011 (UTC)

Back to the top