/** * @see org.opencms.file.wrapper.I_CmsResourceWrapper#copyResource(org.opencms.file.CmsObject, java.lang.String, java.lang.String, org.opencms.file.CmsResource.CmsResourceCopyMode) */ public boolean copyResource(CmsObject cms, String source, String destination, CmsResourceCopyMode siblingMode) throws CmsException, CmsIllegalArgumentException { if (m_isWrappedResource) { cms.copyResource(source, destination, siblingMode); return true; } return false; }
/** * @see org.opencms.file.wrapper.I_CmsResourceWrapper#copyResource(org.opencms.file.CmsObject, java.lang.String, java.lang.String, org.opencms.file.CmsResource.CmsResourceCopyMode) */ public boolean copyResource(CmsObject cms, String source, String destination, CmsResourceCopyMode siblingMode) throws CmsException, CmsIllegalArgumentException { if (m_isWrappedResource) { cms.copyResource(source, destination, siblingMode); return true; } return false; }
/** * Copies a resource.<p> * * The copied resource will always be locked to the current user * after the copy operation.<p> * * Siblings will be treated according to the * <code>{@link org.opencms.file.CmsResource#COPY_PRESERVE_SIBLING}</code> mode.<p> * * @param source the name of the resource to copy (full current site relative path) * @param destination the name of the copy destination (full current site relative path) * * @throws CmsException if something goes wrong * @throws CmsIllegalArgumentException if the <code>destination</code> argument is null or of length 0 * * @see #copyResource(String, String, CmsResource.CmsResourceCopyMode) */ public void copyResource(String source, String destination) throws CmsException, CmsIllegalArgumentException { copyResource(source, destination, CmsResource.COPY_PRESERVE_SIBLING); }
/** * Copies a resource.<p> * * The copied resource will always be locked to the current user * after the copy operation.<p> * * Siblings will be treated according to the * <code>{@link org.opencms.file.CmsResource#COPY_PRESERVE_SIBLING}</code> mode.<p> * * @param source the name of the resource to copy (full current site relative path) * @param destination the name of the copy destination (full current site relative path) * * @throws CmsException if something goes wrong * @throws CmsIllegalArgumentException if the <code>destination</code> argument is null or of length 0 * * @see #copyResource(String, String, CmsResource.CmsResourceCopyMode) */ public void copyResource(String source, String destination) throws CmsException, CmsIllegalArgumentException { copyResource(source, destination, CmsResource.COPY_PRESERVE_SIBLING); }
/** * Copies a resource.<p> * * The copied resource will always be locked to the current user * after the copy operation.<p> * * @param source the name of the resource to copy (full path) * @param destination the name of the copy destination (full path) * @param siblingMode indicates how to handle siblings during copy * * @throws CmsException if something goes wrong * @throws CmsIllegalArgumentException if the <code>destination</code> argument is null or of length 0 * * @deprecated use {@link #copyResource(String, String, CmsResource.CmsResourceCopyMode)} method instead */ public void copyResource(String source, String destination, int siblingMode) throws CmsException, CmsIllegalArgumentException { copyResource(source, destination, CmsResource.CmsResourceCopyMode.valueOf(siblingMode)); }
m_cms.copyResource(source, destination, siblingMode);
m_cms.copyResource(source, destination, siblingMode);
/** * Copies the explorer type icons.<p> * * @param iconPaths the path to the location where the icons are located * * @throws CmsException if something goes wrong */ private void cloneExplorerTypeIcons(Map<String, String> iconPaths) throws CmsException { for (Map.Entry<String, String> entry : iconPaths.entrySet()) { String source = ICON_PATH + entry.getKey(); String target = ICON_PATH + entry.getValue(); if (getCms().existsResource(source) && !getCms().existsResource(target)) { getCms().copyResource(source, target); } } }
/** * @see org.opencms.file.wrapper.A_CmsResourceWrapper#copyResource(org.opencms.file.CmsObject, java.lang.String, java.lang.String, org.opencms.file.CmsResource.CmsResourceCopyMode) */ @Override public boolean copyResource(CmsObject cms, String source, String destination, CmsResourceCopyMode siblingMode) throws CmsException, CmsIllegalArgumentException { CmsResource res = getResource(cms, source); if (res != null) { cms.copyResource( CmsResourceWrapperUtils.removeFileExtension(cms, source, getExtension()), CmsResourceWrapperUtils.removeFileExtension(cms, destination, getExtension()), siblingMode); return true; } return false; }
/** * @see org.opencms.file.wrapper.A_CmsResourceWrapper#copyResource(org.opencms.file.CmsObject, java.lang.String, java.lang.String, org.opencms.file.CmsResource.CmsResourceCopyMode) */ @Override public boolean copyResource(CmsObject cms, String source, String destination, CmsResourceCopyMode siblingMode) throws CmsException, CmsIllegalArgumentException { CmsResource res = getResource(cms, source); if (res != null) { cms.copyResource( CmsResourceWrapperUtils.removeFileExtension(cms, source, getExtension()), CmsResourceWrapperUtils.removeFileExtension(cms, destination, getExtension()), siblingMode); return true; } return false; }
cms.copyResource(source, destination, siblingMode); return true; } else {
for (CmsResource res : propertyFiles) { if (!getCms().existsResource(targetClassesPath + res.getName())) { getCms().copyResource(res.getRootPath(), targetClassesPath + res.getName());
cms.copyResource(SAMPLE_SCHEMA, schemaFile, CmsResource.COPY_AS_NEW); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_resInfo.getSchemaTypeName())) { String smallIcon = CmsStringUtil.joinPaths(filetypesFolder, m_resInfo.getName() + ".png"); if (!cms.existsResource(smallIcon)) { cms.copyResource(SAMPLE_ICON_SMALL, smallIcon, CmsResource.COPY_AS_NEW); moduleResource.add(smallIcon); String bigIcon = CmsStringUtil.joinPaths(filetypesFolder, m_resInfo.getName() + "_big.png"); if (!cms.existsResource(bigIcon)) { cms.copyResource(SAMPLE_ICON_BIG, bigIcon, CmsResource.COPY_AS_NEW); moduleResource.add(bigIcon);
getCms().copyResource(sitePrefix + source, finalTarget, copyMode);
cms.copyResource(source, destination, siblingMode); return true; } else {
getCms().copyResource(sitePrefix + source, finalTarget, copyMode);
/** The dialog mode. */ public static enum DialogMode { /** Allow copy only. */ copy, /** Allow copy and move. */ copy_and_move, /** Allow move only. */ move }
} else { CmsResource copyResource = m_cms.readResource(copyId); m_cms.copyResource(copyResource.getRootPath(), newFilePath); m_cms.writePropertyObject(newFilePath, titleProp); m_cms.writePropertyObject(newFilePath, descriptionProp);
cms.copyResource(getParamTempfile(), getParamResource(), CmsResource.COPY_AS_NEW);
cms.copyResource(getParamTempfile(), getParamResource(), CmsResource.COPY_AS_NEW);