/** * Closes the zip file.<p> */ public void closeFile() { if (getZipFile() != null) { try { getZipFile().close(); } catch (IOException e) { CmsMessageContainer message = Messages.get().container( Messages.ERR_IMPORTEXPORT_ERROR_CLOSING_ZIP_ARCHIVE_1, getZipFile().getName()); if (LOG.isDebugEnabled()) { LOG.debug(message.key(), e); } } } }
/** * Closes the zip file.<p> */ public void closeFile() { if (getZipFile() != null) { try { getZipFile().close(); } catch (IOException e) { CmsMessageContainer message = Messages.get().container( Messages.ERR_IMPORTEXPORT_ERROR_CLOSING_ZIP_ARCHIVE_1, getZipFile().getName()); if (LOG.isDebugEnabled()) { LOG.debug(message.key(), e); } } } }
/** Returns the zip entry for a file in the archive. * @param filename the file name * @return the zip entry for the file with the provided name * @throws ZipException thrown if the file is not in the zip archive */ protected ZipEntry getZipEntry(String filename) throws ZipException { // yes ZipEntry entry = getZipFile().getEntry(filename); // path to file might be relative, too if ((entry == null) && filename.startsWith("/")) { entry = m_zipFile.getEntry(filename.substring(1)); } if (entry == null) { throw new ZipException( Messages.get().getBundle().key(Messages.LOG_IMPORTEXPORT_FILE_NOT_FOUND_IN_ZIP_1, filename)); } return entry; } }
InputStream stream = null; if (getZipFile() != null) { ZipEntry entry = getZipFile().getEntry(fileName); entry = getZipFile().getEntry(fileName.substring(1)); stream = getZipFile().getInputStream(entry); } else {
InputStream stream = null; if (getZipFile() != null) { ZipEntry entry = getZipFile().getEntry(fileName); entry = getZipFile().getEntry(fileName.substring(1)); stream = getZipFile().getInputStream(entry); } else {
public long getFileModification(String filename) throws CmsImportExportException { long modificationTime = 0; try { // is this a zip-file? if (getZipFile() != null) { // yes ZipEntry entry = getZipEntry(filename); modificationTime = entry.getTime(); } else { // no - use directory File file = getFile(filename); modificationTime = file.lastModified(); } if (modificationTime < 0) { return 0; } else { return modificationTime; } } catch (IOException ioe) { CmsMessageContainer msg = Messages.get().container( Messages.ERR_IMPORTEXPORT_ERROR_READING_FILE_1, filename); if (LOG.isErrorEnabled()) { LOG.error(msg.key(), ioe); } throw new CmsImportExportException(msg, ioe); } }
if (getZipFile() != null) { ZipEntry entry = getZipFile().getEntry(filename); InputStream stream = getZipFile().getInputStream(entry); int size = new Long(entry.getSize()).intValue(); return CmsFileUtil.readFully(stream, size);
if (getZipFile() != null) { InputStream stream = getZipFile().getInputStream(entry); int size = new Long(entry.getSize()).intValue(); return CmsFileUtil.readFully(stream, size);
helper.openFile(); m_importResource = helper.getFolder(); m_importZip = helper.getZipFile(); m_docXml = CmsXmlUtils.unmarshalHelper(helper.getFileBytes(CmsImportExportManager.EXPORT_MANIFEST), null);
helper.openFile(); m_importResource = helper.getFolder(); m_importZip = helper.getZipFile(); m_docXml = CmsXmlUtils.unmarshalHelper(helper.getFileBytes(CmsImportExportManager.EXPORT_MANIFEST), null);
helper.openFile(); m_importResource = helper.getFolder(); m_importZip = helper.getZipFile(); m_docXml = CmsXmlUtils.unmarshalHelper(helper.getFileBytes(CmsImportExportManager.EXPORT_MANIFEST), null);
helper.openFile(); m_importResource = helper.getFolder(); m_importZip = helper.getZipFile(); m_docXml = CmsXmlUtils.unmarshalHelper(helper.getFileBytes(CmsImportExportManager.EXPORT_MANIFEST), null);
helper.openFile(); m_importResource = helper.getFolder(); m_importZip = helper.getZipFile(); m_docXml = CmsXmlUtils.unmarshalHelper(helper.getFileBytes(CmsImportExportManager.EXPORT_MANIFEST), null);
helper.openFile(); m_importResource = helper.getFolder(); m_importZip = helper.getZipFile(); m_docXml = CmsXmlUtils.unmarshalHelper(helper.getFileBytes(CmsImportExportManager.EXPORT_MANIFEST), null);
helper.openFile(); m_importResource = helper.getFolder(); m_importZip = helper.getZipFile(); m_docXml = CmsXmlUtils.unmarshalHelper(helper.getFileBytes(CmsImportExportManager.EXPORT_MANIFEST), null);
helper.openFile(); m_importResource = helper.getFolder(); m_importZip = helper.getZipFile(); m_docXml = CmsXmlUtils.unmarshalHelper(helper.getFileBytes(CmsImportExportManager.EXPORT_MANIFEST), null);