private PortletApplicationDefinition parsePortlets(
     String modulePath, PortalDeployDefinition define, String moduleName)
     throws FileNotFoundException, IOException {
   FileInputStream input = null;
   try {
     File f = new File(modulePath + "/portalspec/portlet.xml");
     if (!f.exists()) return null;
     input = new FileInputStream(f);
     PortletApplicationDefinition pad =
         (PortletApplicationDefinition)
             PortalServiceUtil.getPortletAppDescriptorService().read(moduleName, input);
     List<PortletDefinition> pList = pad.getPortlets();
     Iterator<PortletDefinition> pit = pList.iterator();
     while (pit.hasNext()) {
       PortletDefinition p = pit.next();
       ContainerRuntimeOption cr = new ContainerRuntimeOption();
       cr.setName(ContainerRuntimeOption.MODULE);
       cr.addValue(moduleName);
       p.getContainerRuntimeOptions().add(cr);
     }
     return pad;
   } finally {
     if (input != null)
       try {
         input.close();
       } catch (IOException e) {
         LfwLogger.error(e.getMessage(), e);
       }
   }
 }