Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Copying file from *absolute* path
Copying file from *absolute* path [message #262763] Tue, 20 July 2004 22:36 Go to next message
Kazuya Mori is currently offline Kazuya MoriFriend
Messages: 3
Registered: July 2009
Junior Member
I want copy from a file into a directory of my project.
How can I do it? I checked API to get IFile object from
the workspace and found the followings:

ResourcesPlugin.getWorkspace().getRoot().getFile(path)

But this does not suite to what I want because this "path"
must be relative to the workspace.

My "path" points an absolute (from OS filesystem) file.
Re: Copying file from *absolute* path [message #262876 is a reply to message #262763] Wed, 21 July 2004 13:41 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

If you want to copy into your workspace, you use the standard java.io
FileInputStream on your file that you want to copy from (in your file
system), and then use the IFile.setContents() to the file in the
workspace that you want to copy into. Note, this will make a copy, so
timestamps on the new IFile will not be the same as the timestamps from
the file in your system.

--
Thanks, Rich Kulp

Previous Topic:Eclipse and cmdline -classpath
Next Topic:managed make
Goto Forum:
  


Current Time: Sun Apr 23 14:06:47 GMT 2017

Powered by FUDForum. Page generated in 0.01955 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software