001/* 002 * This library is part of OpenCms - 003 * the Open Source Content Management System 004 * 005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com) 006 * 007 * This library is free software; you can redistribute it and/or 008 * modify it under the terms of the GNU Lesser General Public 009 * License as published by the Free Software Foundation; either 010 * version 2.1 of the License, or (at your option) any later version. 011 * 012 * This library is distributed in the hope that it will be useful, 013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 015 * Lesser General Public License for more details. 016 * 017 * For further information about Alkacon Software GmbH & Co. KG, please see the 018 * company website: http://www.alkacon.com 019 * 020 * For further information about OpenCms, please see the 021 * project website: http://www.opencms.org 022 * 023 * You should have received a copy of the GNU Lesser General Public 024 * License along with this library; if not, write to the Free Software 025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 026 */ 027 028package org.opencms.importexport; 029 030/** 031 * Import parameters.<p> 032 * 033 * @since 7.0.4 034 */ 035public class CmsImportParameters { 036 037 /** The path in the OpenCms VFS to import into.*/ 038 private String m_destinationPath; 039 040 /** If set, the permissions set on existing resources will not be modified.*/ 041 private boolean m_keepPermissions; 042 043 /** The file path, could be a folder or a zip file. */ 044 private String m_path; 045 046 /** If set, the manifest.xml file will be validated during the import. */ 047 private boolean m_xmlValidation; 048 049 /** 050 * Constructor.<p> 051 * 052 * @param path the file path, could be a folder or a zip file 053 * @param destination path in the OpenCms VFS to import into 054 * @param keepPermissions if set, the permissions set on existing resources will not be modified 055 */ 056 public CmsImportParameters(String path, String destination, boolean keepPermissions) { 057 058 setPath(path); 059 setDestinationPath(destination); 060 setKeepPermissions(keepPermissions); 061 } 062 063 /** 064 * Returns the path in the OpenCms VFS to import into.<p> 065 * 066 * @return the path in the OpenCms VFS to import into 067 */ 068 public String getDestinationPath() { 069 070 return m_destinationPath; 071 } 072 073 /** 074 * Returns the file path, could be a folder or a zip file.<p> 075 * 076 * @return the file path 077 */ 078 public String getPath() { 079 080 return m_path; 081 } 082 083 /** 084 * Returns the keep permissions flags. 085 * if set, the permissions set on existing resources will not be modified.<p> 086 * 087 * @return the keep permissions flag 088 */ 089 public boolean isKeepPermissions() { 090 091 return m_keepPermissions; 092 } 093 094 /** 095 * Checks if the manifest.xml file will be validated during the import.<p> 096 * 097 * @return the xml validation flag 098 */ 099 public boolean isXmlValidation() { 100 101 return m_xmlValidation; 102 } 103 104 /** 105 * Sets the path in the OpenCms VFS to import into.<p> 106 * 107 * @param importPath the import path to set 108 */ 109 public void setDestinationPath(String importPath) { 110 111 m_destinationPath = importPath; 112 } 113 114 /** 115 * Sets the keep permissions flag. 116 * If set, the permissions set on existing resources will not be modified.<p> 117 * 118 * @param keepPermissions the keep permissions flag to set 119 */ 120 public void setKeepPermissions(boolean keepPermissions) { 121 122 m_keepPermissions = keepPermissions; 123 } 124 125 /** 126 * Sets the file path, could be a folder or a zip file.<p> 127 * 128 * @param path the file path, could be a folder or a zip file 129 */ 130 public void setPath(String path) { 131 132 m_path = path; 133 } 134 135 /** 136 * Sets the xml validation flag. If set, the manifest.xml file will be validated during the import.<p> 137 * 138 * @param xmlValidation the xml validation flag to set 139 */ 140 public void setXmlValidation(boolean xmlValidation) { 141 142 m_xmlValidation = xmlValidation; 143 } 144}