Adds a resource to the list of immutable resources that should remain
unchanged when resources are imported.<p>

@param immutableResource a resources uri in the OpenCms VFS
191773
public void addImmutableResource(String immutableResource) {

        if (LOG.isDebugEnabled()) {
            LOG.debug(
                Messages.get().getBundle().key(
                    Messages.LOG_IMPORTEXPORT_ADDED_IMMUTABLE_RESOURCE_1,
                    immutableResource));
        }
        m_immutableResources.add(immutableResource);
    }
900504
public void setResourceTagList(java.util.Collection<ResourceTag> resourceTagList) {
        if (resourceTagList == null) {
            this.resourceTagList = null;
            return;
        }

        this.resourceTagList = new com.amazonaws.internal.SdkInternalList<ResourceTag>(resourceTagList);
    }
451773
private static void putCachedResource( String baseName, Resources resources )
    {
        synchronized( ResourceManager.class )
        {
            WeakReference<Resources> ref = new WeakReference<Resources>( resources );
            RESOURCES.put( baseName, ref );
        }
    }
376208
public void setDiscoveredResourceList(java.util.Collection<DiscoveredResource> discoveredResourceList) {
        if (discoveredResourceList == null) {
            this.discoveredResourceList = null;
            return;
        }

        this.discoveredResourceList = new java.util.ArrayList<DiscoveredResource>(discoveredResourceList);
    }
681003
def add_changed_resources(self, resources, change=None):
        
        for resource in resources:
            rc = Resource(resource=resource, change=change)
            self.add(rc)
233711
protected void setResourcesParam(List<String> resources) {

        m_collectorParameter += I_CmsListResourceCollector.SEP_PARAM
            + I_CmsListResourceCollector.PARAM_RESOURCES
            + I_CmsListResourceCollector.SEP_KEYVAL;
        if (resources == null) {
            // search anywhere
            m_collectorParameter += "/";
        } else {
            m_collectorParameter += CmsStringUtil.collectionAsString(resources, "#");
        }
    }
168492
def add(self, resource, replace=False):
        """"""
        uri = resource.uri
        if (uri in self and not replace):
            raise ResourceListDupeError(
                "Attempt to add resource already in resource_list")
        self[uri] = resource
1236574
@Override
    public T addAsModules(final File... resources) throws IllegalArgumentException {
        // Precondition checks
        Validate.notNull(resources, "resources must be specified");

        // Add each
        for (final File resource : resources) {
            this.addAsModule(resource);
        }

        // Return
        return this.covarientReturn();
    }
1106029
public void setResources(java.util.Collection<Resource> resources) {
        if (resources == null) {
            this.resources = null;
            return;
        }

        this.resources = new java.util.ArrayList<Resource>(resources);
    }
546899
public void importResource() {

        m_resourceIdWasNull = false;

        try {
            if (m_throwable != null) {
                getReport().println(m_throwable);
                getReport().addError(m_throwable);

                CmsMessageContainer message = Messages.get().container(
                    Messages.ERR_IMPORTEXPORT_ERROR_IMPORTING_RESOURCES_0);
                if (LOG.isDebugEnabled()) {
                    LOG.debug(message.key(), m_throwable);
                }
                m_throwable = null;
                m_importACEs = false;
                m_resource = null;

                return;
            }

            // apply name translation and import path
            String translatedName = getRequestContext().addSiteRoot(
                CmsStringUtil.joinPaths(m_parameters.getDestinationPath(), m_destination));

            boolean resourceImmutable = checkImmutable(translatedName);
            translatedName = getRequestContext().removeSiteRoot(translatedName);
            // if the resource is not immutable and not on the exclude list, import it
            if (!resourceImmutable) {
                // print out the information to the report
                getReport().print(Messages.get().container(Messages.RPT_IMPORTING_0), I_CmsReport.FORMAT_NOTE);
                getReport().print(
                    org.opencms.report.Messages.get().container(
                        org.opencms.report.Messages.RPT_ARGUMENT_1,
                        translatedName));
                getReport().print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0));

                boolean exists = getCms().existsResource(translatedName, CmsResourceFilter.ALL);

                byte[] content = null;
                // get the file content

                if (m_source != null) {
                    content = m_helper.getFileBytes(m_source);
                }
                int size = 0;
                if (content != null) {
                    size = content.length;
                }
                setDefaultsForEmptyResourceFields();
                // create a new CmsResource
                CmsResource resource = createResourceObjectFromFields(translatedName, size);

                if (m_resourceBuilder.getType().isFolder()
                    || m_resourceIdWasNull
                    || hasContentInVfsOrImport(resource)) {
                    // import this resource in the VFS
                    m_resource = getCms().importResource(
                        translatedName,
                        resource,
                        content,
                        new ArrayList<CmsProperty>(m_properties.values()));
                }

                if (m_resource != null) {
                    m_indexToStructureId.put(Integer.valueOf(m_fileCounter), m_resource.getStructureId());
                }

                // only set permissions if the resource did not exists or if the keep permissions flag is not set
                m_importACEs = (m_resource != null) && (!exists || !m_parameters.isKeepPermissions());

                if (m_resource != null) {
                    getReport().println(
                        org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0),
                        I_CmsReport.FORMAT_OK);

                    if (OpenCms.getResourceManager().getResourceType(
                        m_resource.getTypeId()) instanceof I_CmsLinkParseable) {
                        // store for later use
                        m_parseables.add(m_resource);
                    }
                    if (LOG.isInfoEnabled()) {
                        LOG.info(
                            Messages.get().getBundle().key(
                                Messages.LOG_IMPORTING_4,
                                new Object[] {
                                    String.valueOf(m_fileCounter),
                                    String.valueOf(m_totalFiles),
                                    translatedName,
                                    m_destination}));
                    }
                } else {
                    // resource import failed, since no CmsResource was created
                    getReport().print(Messages.get().container(Messages.RPT_SKIPPING_0), I_CmsReport.FORMAT_NOTE);
                    getReport().println(
                        org.opencms.report.Messages.get().container(
                            org.opencms.report.Messages.RPT_ARGUMENT_1,
                            translatedName));

                    if (LOG.isInfoEnabled()) {
                        LOG.info(
                            Messages.get().getBundle().key(
                                Messages.LOG_SKIPPING_3,
                                String.valueOf(m_fileCounter),
                                String.valueOf(m_totalFiles),
                                translatedName));
                    }
                }
            } else {
                m_resource = null;
                // skip the file import, just print out the information to the report
                getReport().print(Messages.get().container(Messages.RPT_SKIPPING_0), I_CmsReport.FORMAT_NOTE);
                getReport().println(
                    org.opencms.report.Messages.get().container(
                        org.opencms.report.Messages.RPT_ARGUMENT_1,
                        translatedName));

                if (LOG.isInfoEnabled()) {
                    LOG.info(
                        Messages.get().getBundle().key(
                            Messages.LOG_SKIPPING_3,
                            String.valueOf(m_fileCounter),
                            String.valueOf(m_totalFiles),
                            translatedName));
                }
                // do not import ACEs
                m_importACEs = false;
            }
        } catch (Exception e) {
            m_resource = null;
            m_importACEs = false;

            getReport().println(e);
            getReport().addError(e);

            CmsMessageContainer message = Messages.get().container(
                Messages.ERR_IMPORTEXPORT_ERROR_IMPORTING_RESOURCES_0);
            if (LOG.isDebugEnabled()) {
                LOG.debug(message.key(), e);
            }

            return;
        }
    }
1198594
public ConfigurationSourcesModuleBuilder addSource(ConfigurationSource configurationSource) {
    if (configurationSource == null) {
      throw new NullPointerException("configurationSource: null");
    }
    configurationSources.add(configurationSource);
    return this;
  }
120515
public void addJsResource(final ApplicationResource resource) {
		WApplicationModel model = getOrCreateComponentModel();
		if (model.jsResources == null) {
			model.jsResources = new ArrayList<>();
		} else if (model.jsResources.contains(resource)) {
			return;
		}
		model.jsResources.add(resource);
		MemoryUtil.checkSize(model.jsResources.size(), this.getClass().getSimpleName());
	}
138893
protected List<CmsPublishedResource> addMovedLinkSources(
        CmsObject cms,
        List<CmsPublishedResource> publishedResources) {

        long timer = System.currentTimeMillis();
        if (LOG.isDebugEnabled()) {
            LOG.debug(Messages.get().getBundle().key(Messages.LOG_SCRUB_EXPORT_START_MOVED_SOURCES_0));
        }
        publishedResources = new ArrayList<CmsPublishedResource>(publishedResources);
        Set<String> pubResources = new HashSet<String>(publishedResources.size());
        // this is needed since the CmsPublishedResource#equals(Object) method just compares ids and not paths
        // and with moved files you have 2 entries with the same id and different paths...
        for (CmsPublishedResource pubRes : publishedResources) {
            pubResources.add(pubRes.getRootPath());
        }
        boolean modified = true;
        // until no more resources are added
        while (modified) {
            modified = false;
            Iterator<CmsPublishedResource> itPrePubRes = new ArrayList<CmsPublishedResource>(
                publishedResources).iterator();
            while (itPrePubRes.hasNext()) {
                CmsPublishedResource res = itPrePubRes.next();
                if (res.getMovedState() != CmsPublishedResource.STATE_MOVED_DESTINATION) {
                    // handle only resources that are destination of move operations
                    continue;
                }
                List<CmsRelation> relations = null;
                try {
                    // get all link sources to this resource
                    relations = cms.getRelationsForResource(
                        cms.getRequestContext().removeSiteRoot(res.getRootPath()),
                        CmsRelationFilter.SOURCES);
                } catch (CmsException e) {
                    // should never happen
                    if (LOG.isErrorEnabled()) {
                        LOG.error(e.getLocalizedMessage(), e);
                    }
                }
                if ((relations == null) || relations.isEmpty()) {
                    // continue with next resource if no link sources found
                    continue;
                }
                Iterator<CmsRelation> itRelations = relations.iterator();
                while (itRelations.hasNext()) {
                    CmsRelation relation = itRelations.next();
                    CmsPublishedResource source = null;
                    try {
                        // get the link source
                        source = new CmsPublishedResource(relation.getSource(cms, CmsResourceFilter.ALL));
                    } catch (CmsException e) {
                        // should never happen
                        if (LOG.isWarnEnabled()) {
                            LOG.warn(e.getLocalizedMessage());
                        }
                    }
                    if ((source == null) || pubResources.contains(source.getRootPath())) {
                        // continue if the link source could not been retrieved or if the list already contains it
                        continue;
                    }
                    // add it, and set the modified flag to give it another round
                    modified = true;
                    pubResources.add(source.getRootPath());
                    publishedResources.add(source);
                }
            }
        }
        if (LOG.isDebugEnabled()) {
            LOG.debug(
                Messages.get().getBundle().key(
                    Messages.LOG_SCRUB_EXPORT_FINISH_MOVED_SOURCES_1,
                    (System.currentTimeMillis() - timer) + ""));
        }
        return publishedResources;
    }
475953
private static CmsPriorityTitleResourceComparator create(CmsResource resource, CmsObject cms) {

        CmsPriorityTitleResourceComparator result = new CmsPriorityTitleResourceComparator(null);
        result.init(resource, cms);
        return result;
    }
1277819
public UriMappingResolver addResource(String uri, String resource) {
        uriMap.put(uri, resource);
        return this;
    }
431330
protected void addPropertySources(ConfigurableEnvironment environment,
			ResourceLoader resourceLoader) {
		RandomValuePropertySource.addToEnvironment(environment);
		new Loader(environment, resourceLoader).load();
	}
346865
public void addResourceMetadata(String resourceName,
      ResourceMetadata resourceMetadata) {
    if (resourceMetadataMap.put(resourceName, resourceMetadata) != null) {
      throw new RuntimeException("Resource name " + resourceName +
          " already exists!");
    }
  }