if(header==null){
header ="";
}
IResource portletFolderResource = FileUtils.createFolder(parent, portletName);
IFolder portletFolder = (IFolder) portletFolderResource;
String tmlInclude = header + "\n<tml:include ref=\"{'::mode-' + portlet.mode}\"/>";
ByteArrayInputStream input = new ByteArrayInputStream(tmlInclude.getBytes());
IFile portletFile = portletFolder.getFile("portlet.tml");
portletFile.create(input, true, new NullProgressMonitor());
portletFolder.getFile("form.tml").create(new ByteArrayInputStream(header.getBytes()), true, new NullProgressMonitor());
//TODO Form for form.tml
Iterator<String> it = modes.iterator();
while (it.hasNext()) {
String current = it.next();
portletFolder.getFile("mode-"+current+".tml").create(new ByteArrayInputStream(header.getBytes()), true, new NullProgressMonitor());
}
return portletFile;
}