Jump to: navigation, search

PDT Dev2Dev - Copy Files the Eclipse way

Revision as of 14:28, 23 March 2011 by Mstorer3772.gmail.com (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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:


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)