/** * Opens the import file.<p> * * @throws IOException if the file could not be opened */ public void openFile() throws IOException { // get the import resource m_folder = new File(OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf(m_params.getPath())); // if it is a file it must be a zip-file if (m_folder.isFile()) { m_zipFile = new ZipFile(m_params.getPath()); m_folder = null; } }
/** * Returns the name of the import file, without zip extension.<p> * * @return the name of the import file, without zip extension */ public String getFileName() { String fileName = m_params.getPath().replace('\\', '/'); String zipName = fileName.substring(fileName.lastIndexOf('/') + 1); String result; if (zipName.toLowerCase().endsWith(".zip")) { result = zipName.substring(0, zipName.lastIndexOf('.')); int pos = result.lastIndexOf('_'); if (pos > 0) { result = result.substring(0, pos); } } else { result = zipName; } return result; }
/** * Opens the import file.<p> * * @throws IOException if the file could not be opened */ public void openFile() throws IOException { // get the import resource m_folder = new File(OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf(m_params.getPath())); // if it is a file it must be a zip-file if (m_folder.isFile()) { m_zipFile = new ZipFile(m_params.getPath()); m_folder = null; } } }
/** * Returns the name of the import file, without zip extension.<p> * * @return the name of the import file, without zip extension */ public String getFileName() { String fileName = m_params.getPath().replace('\\', '/'); String zipName = fileName.substring(fileName.lastIndexOf('/') + 1); String result; if (zipName.toLowerCase().endsWith(".zip")) { result = zipName.substring(0, zipName.lastIndexOf('.')); int pos = result.lastIndexOf('_'); if (pos > 0) { result = result.substring(0, pos); } } else { result = zipName; } return result; }
CmsMessageContainer message = Messages.get().container( Messages.ERR_IMPORTEXPORT_ERROR_OPENING_ZIP_ARCHIVE_1, parameters.getPath()); if (LOG.isDebugEnabled()) { LOG.debug(message.key(), e);
CmsMessageContainer message = Messages.get().container( Messages.ERR_IMPORTEXPORT_ERROR_OPENING_ZIP_ARCHIVE_1, parameters.getPath()); if (LOG.isDebugEnabled()) { LOG.debug(message.key(), e);
Messages.get().container(Messages.RPT_IMPORT_DB_NO_CLASS_1, parameters.getPath()), I_CmsReport.FORMAT_WARNING);
Messages.get().container(Messages.RPT_IMPORT_DB_NO_CLASS_1, parameters.getPath()), I_CmsReport.FORMAT_WARNING);
CmsModule importedModule = readModuleFromImport(parameters.getPath());
CmsModule importedModule = readModuleFromImport(parameters.getPath());
} catch (Exception e) { throw new CmsImportExportException( Messages.get().container(Messages.ERR_IO_MODULE_IMPORT_1, parameters.getPath()), e); } finally {
throw new CmsImportExportException(Messages.get().container( Messages.ERR_IO_MODULE_IMPORT_1, parameters.getPath()), e); } finally { helper.closeFile();