gt:                 CmsFile file = m_cms.readFile(res);
context: /*
   * This library is part of OpenCms -
   * the Open Source Content Management System
   *
   * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com)
   *
   * This library is free software; you can redistribute it and/or
   * modify it under the terms of the GNU Lesser General Public
   * License as published by the Free Software Foundation; either
   * version 2.1 of the License, or (at your option) any later version.
   *
   * This library is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   * Lesser General Public License for more details.
   *
   * For further information about Alkacon Software GmbH & Co. KG, please see the
   * company website: http://www.alkacon.com
   *
   * For further information about OpenCms, please see the
   * project website: http://www.opencms.org
   *
   * You should have received a copy of the GNU Lesser General Public
   * License along with this library; if not, write to the Free Software
   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   */
  
  package org.opencms.importexport;
  
  import org.opencms.configuration.CmsParameterConfiguration;
  import org.opencms.file.CmsFile;
  import org.opencms.file.CmsObject;
  import org.opencms.file.CmsProperty;
  import org.opencms.file.CmsResource;
  import org.opencms.file.types.CmsResourceTypePlain;
  import org.opencms.file.types.I_CmsResourceType;
  import org.opencms.i18n.CmsMessageContainer;
  import org.opencms.loader.CmsLoaderException;
  import org.opencms.main.CmsException;
  import org.opencms.main.CmsLog;
  import org.opencms.main.OpenCms;
  import org.opencms.relations.I_CmsLinkParseable;
  import org.opencms.report.I_CmsReport;
  import org.opencms.security.CmsAccessControlEntry;
  import org.opencms.security.CmsRole;
  import org.opencms.security.I_CmsPasswordHandler;
  import org.opencms.security.I_CmsPrincipal;
  import org.opencms.util.CmsDateUtil;
  import org.opencms.util.CmsUUID;
  import org.opencms.xml.CmsXmlException;
  import org.opencms.xml.CmsXmlUtils;
  
  import java.io.File;
  import java.io.IOException;
  import java.text.ParseException;
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.HashMap;
  import java.util.Iterator;
  import java.util.List;
  import java.util.Map;
  import java.util.zip.ZipFile;
  
  import org.apache.commons.logging.Log;
  
  import org.dom4j.Document;
  import org.dom4j.Element;
  import org.dom4j.Node;
  
  /**
   * Implementation of the OpenCms Import Interface ({@link org.opencms.importexport.I_CmsImport}) for
   * the import version 4.<p>
   *
   * This import format is used in OpenCms since 5.1.6.<p>
   *
   * @since 6.0.0
   *
   * @see org.opencms.importexport.A_CmsImport
   *
   * @deprecated this import class is no longer in use and should only be used to import old export files
   */
  @Deprecated
  public class CmsImportVersion4 extends A_CmsImport {
  
      /** The version number of this import implementation.<p> */
      private static final int IMPORT_VERSION = 4;
  
      /** The log object for this class. */
      private static final Log LOG = CmsLog.getLog(CmsImportVersion4.class);
  
      /** Stores all resource of type that implements the {@link I_CmsLinkParseable} interface. */
      private List<CmsResource> m_parseables;
  
      /**
       * Creates a new CmsImportVerion4 object.<p>
       */
      public CmsImportVersion4() {
  
          m_convertToXmlPage = true;
      }
  
      /**
       * @see org.opencms.importexport.I_CmsImport#getVersion()
       * @return the version number of this import implementation
       */
      public int getVersion() {
  
          return CmsImportVersion4.IMPORT_VERSION;
      }
  
      /**
       * @see org.opencms.importexport.I_CmsImport#importData(CmsObject, I_CmsReport, CmsImportParameters)
       */
      public void importData(CmsObject cms, I_CmsReport report, CmsImportParameters params)
      throws CmsImportExportException, CmsXmlException {
  
          // initialize the import
          initialize();
          m_cms = cms;
          m_importPath = params.getDestinationPath();
          m_report = report;
  
          m_linkStorage = new HashMap<String, String>();
          m_linkPropertyStorage = new HashMap<String, List<CmsProperty>>();
          m_parseables = new ArrayList<CmsResource>();
  
          CmsImportHelper helper = new CmsImportHelper(params);
          try {
              helper.openFile();
              m_importResource = helper.getFolder();
              m_importZip = helper.getZipFile();
              m_docXml = CmsXmlUtils.unmarshalHelper(helper.getFileBytes(CmsImportExportManager.EXPORT_MANIFEST), null);
              // first import the user information
              if (OpenCms.getRoleManager().hasRole(m_cms, CmsRole.ACCOUNT_MANAGER)) {
                  importGroups();
                  importUsers();
              }
              // now import the VFS resources
              readResourcesFromManifest();
              convertPointerToSiblings();
              rewriteParseables();
          } catch (IOException ioe) {
              CmsMessageContainer msg = Messages.get().container(
                  Messages.ERR_IMPORTEXPORT_ERROR_READING_FILE_1,
                  CmsImportExportManager.EXPORT_MANIFEST);
              if (LOG.isErrorEnabled()) {
                  LOG.error(msg.key(), ioe);
              }
              throw new CmsImportExportException(msg, ioe);
          } finally {
              helper.closeFile();
              cleanUp();
          }
      }
  
      /**
       * @see org.opencms.importexport.I_CmsImport#importResources(org.opencms.file.CmsObject, java.lang.String, org.opencms.report.I_CmsReport, java.io.File, java.util.zip.ZipFile, org.dom4j.Document)
       *
       * @deprecated use {@link #importData(CmsObject, I_CmsReport, CmsImportParameters)} instead
       */
      @Deprecated
      public void importResources(
          CmsObject cms,
          String importPath,
          I_CmsReport report,
          File importResource,
          ZipFile importZip,
          Document docXml)
      throws CmsImportExportException {
  
          CmsImportParameters params = new CmsImportParameters(
              importResource != null ? importResource.getAbsolutePath() : importZip.getName(),
              importPath,
              true);
  
          try {
              importData(cms, report, params);
          } catch (CmsXmlException e) {
              throw new CmsImportExportException(e.getMessageContainer(), e);
          }
      }
  
      /**
       * @see org.opencms.importexport.A_CmsImport#importUser(String, String, String, String, String, String, long, Map, List)
       */
      @Override
      protected void importUser(
          String name,
          String flags,
          String password,
          String firstname,
          String lastname,
          String email,
          long dateCreated,
          Map<String, Object> userInfo,
          List<String> userGroups)
      throws CmsImportExportException {
  
          boolean convert = false;
  
          CmsParameterConfiguration config = OpenCms.getPasswordHandler().getConfiguration();
          if ((config != null) && config.containsKey(I_CmsPasswordHandler.CONVERT_DIGEST_ENCODING)) {
              convert = config.getBoolean(I_CmsPasswordHandler.CONVERT_DIGEST_ENCODING, false);
          }
  
          if (convert) {
              password = convertDigestEncoding(password);
          }
  
          super.importUser(name, flags, password, firstname, lastname, email, dateCreated, userInfo, userGroups);
      }
  
      /**
       * Rewrites all parseable files, to assure link check.<p>
       */
      protected void rewriteParseables() {
  
          if (m_parseables.isEmpty()) {
              return;
          }
  
          m_report.println(Messages.get().container(Messages.RPT_START_PARSE_LINKS_0), I_CmsReport.FORMAT_HEADLINE);
  
          int i = 0;
          Iterator<CmsResource> it = m_parseables.iterator();
          while (it.hasNext()) {
              CmsResource res = it.next();
  
              m_report.print(
                  org.opencms.report.Messages.get().container(
                      org.opencms.report.Messages.RPT_SUCCESSION_2,
                      String.valueOf(i + 1),
                      String.valueOf(m_parseables.size())),
                  I_CmsReport.FORMAT_NOTE);
  
              m_report.print(
                  Messages.get().container(Messages.RPT_PARSE_LINKS_FOR_1, m_cms.getSitePath(res)),
                  I_CmsReport.FORMAT_NOTE);
              m_report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0));
  
              try {
                  // make sure the date last modified is kept...
  