[opencms-dev] method importFolder

Flavio flavio.suigo at dinamys.it
Thu Dec 4 10:54:02 CET 2003


How  can I use this method to import a folder?
This code inside a JSP is wrong, why?

     com.opencms.flex.jsp.CmsJspActionElement cms = new
com.opencms.flex.jsp.CmsJspActionElement(pageContext, request, response);
               com.opencms.file.CmsObject cmsObj = cms.getCmsObject();

     File cartella = new File("C:/MyOpenCMS/Import");

     if (cartella.exists())
     {
          File[] elenco = cartella.listFiles();
          int tot = elenco.length;
          File archivio = null;

          for (int cont=0; cont<tot; cont++)
          {
               archivio = elenco[cont];

               if (archivio.isDirectory())
               {
                    cmsObj.importFolder(archivio.getAbsolutePath(),
"/mysite/myfolder/");   //???????
               }
          }
     }

Thanks!!!

Flavio Suigo





More information about the opencms-dev mailing list