|
Re: how to create an IFile in the same IFolder of another IFile? [message #739407 is a reply to message #739381] |
Mon, 17 October 2011 12:50 |
Leonardo Kenji Shikida Messages: 37 Registered: July 2009 |
Member |
|
|
this is so funny...
If it´s a root project node, then you have to do something, otherwise, you can do it in a intuitive way
Of course, "getFolder(null)" is not documented...
IPath path = targetFolder.getLocation();
IProject project = targetFolder.getProject();
IFile file = null;
if (path.equals(project.getLocation())){
file = project.getFile(cdu.getNome()+".other");
}else{
IFolder folder = targetFolder.getFolder(null);
file = folder.getFile(cdu.getNome()+".other");
}
InputStream source = new ByteArrayInputStream(baos.toByteArray());
file.create(source, IResource.NONE, null);
TIA
Leo K.
[Updated on: Mon, 17 October 2011 12:51] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03101 seconds