Adds a new resource to be associated to the current project.<p>

@param resourceName the resource name to add
777298
public void addProjectResource(String resourceName) {

        if ((m_throwable != null) || (m_projectName == null)) {
            return;
        }
        if (m_projectResources == null) {
            m_projectResources = new ArrayList<String>();
        }
        m_projectResources.add(resourceName);
    }
119267
public void setResourceId(String resourceId) {

        try {
            if (!m_type.isFolder()) {
                m_resourceId = new CmsUUID(resourceId);
            } else {
                m_resourceId = new CmsUUID();
            }
        } catch (Throwable e) {
            setThrowable(e);
        }
    }
496246
@Override
    public T addAsWebInfResource(final File resource, final String target) throws IllegalArgumentException {
        Validate.notNull(resource, "Resource should be specified");
        Validate.notNullOrEmpty(target, "Target should be specified");

        return addAsWebInfResource(new FileAsset(resource), target);
    }
113867
@Override
    public T addAsLibrary(String resourceName) throws IllegalArgumentException {
        Validate.notNull(resourceName, "ResourceName must be specified");
        File file = fileFromResource(resourceName);
        return addAsLibrary(file, new BasicPath(resourceName));
    }
1333747
@Override
    public T addAsApplicationResources(Package resourcePackage, String... resourceNames)
        throws IllegalArgumentException {
        Validate.notNull(resourcePackage, "ResourcePackage must be specified");
        Validate.notNullAndNoNullValues(resourceNames,
            "ResourceNames must be specified and can not container null values");
        for (String resourceName : resourceNames) {
            addAsApplicationResource(resourcePackage, resourceName);
        }
        return covarientReturn();
    }
345117
protected void setResource(CmsObject cms, CmsResource resource) {

        m_resource = CmsJspResourceWrapper.wrap(cms, resource);
    }
254722
@Override
    public T addAsManifestResources(Package resourcePackage, String... resourceNames) throws IllegalArgumentException {
        Validate.notNull(resourcePackage, "ResourcePackage must be specified");
        Validate.notNullAndNoNullValues(resourceNames,
            "ResourceNames must be specified and can not container null values");
        for (String resourceName : resourceNames) {
            addAsManifestResource(resourcePackage, resourceName);
        }
        return covarientReturn();
    }
271247
public void addResourceInitHandler(String clazz) {

        Object initClass;
        try {
            initClass = Class.forName(clazz).newInstance();
        } catch (Throwable t) {
            LOG.error(Messages.get().getBundle().key(Messages.LOG_RESOURCE_INIT_CLASS_INVALID_1, clazz), t);
            return;
        }
        if (initClass instanceof I_CmsResourceInit) {
            m_resourceInitHandlers.add((I_CmsResourceInit)initClass);
            if (CmsLog.INIT.isInfoEnabled()) {
                CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_RESOURCE_INIT_SUCCESS_1, clazz));
            }
        } else {
            if (CmsLog.INIT.isErrorEnabled()) {
                CmsLog.INIT.error(Messages.get().getBundle().key(Messages.INIT_RESOURCE_INIT_INVALID_CLASS_1, clazz));
            }
        }
    }
119293
protected void addSubResources(CmsObject cms, Set<CmsResource> resources) throws CmsException {

        List<CmsResource> subResources = new ArrayList<CmsResource>();
        CmsObject rootCms = OpenCms.initCmsObject(cms);
        rootCms.getRequestContext().setSiteRoot("");
        for (CmsResource res : resources) {
            if (res.isFolder()) {
                try {
                    List<CmsResource> childrenOfCurrentResource = rootCms.readResources(
                        res.getRootPath(),
                        CmsResourceFilter.ALL,
                        true);
                    subResources.addAll(childrenOfCurrentResource);
                } catch (CmsException e) {
                    LOG.error(e.getLocalizedMessage(), e);
                }
            }
        }
        resources.addAll(subResources);
    }
792200
@Override
    public T addAsWebInfResource(final String resourceName) throws IllegalArgumentException {
        Validate.notNull(resourceName, "ResourceName should be specified");

        return addAsWebInfResource(new ClassLoaderAsset(resourceName),
            AssetUtil.getNameForClassloaderResource(resourceName));
    }
775534
public void add(Object source) {
		if(source instanceof InputStream) {
			add((InputStream)source);
		} else if(source instanceof URL) {
			add((URL)source);
		} else if(source instanceof String) {
			add((String)source);
		} else {
			throw new JclException("Unknown Resource type");
		}

	}
1080213
private void updateProjectResources() throws CmsException {

        CmsObject cms = A_CmsUI.getCmsObject();
        Set<String> resourceRootPaths = getResourcePaths();
        // write the edited project resources
        CmsProject currentProject = cms.getRequestContext().getCurrentProject();
        // change the current project
        cms.getRequestContext().setCurrentProject(m_project);
        // store the current site root
        String currentSite = cms.getRequestContext().getSiteRoot();
        // copy the resources to the current project
        try {
            // switch to the root site
            cms.getRequestContext().setSiteRoot("");
            // remove deleted resources
            for (String resName : cms.readProjectResources(m_project)) {
                if (!resourceRootPaths.contains(resName)) {
                    cms.removeResourceFromProject(resName);
                }
            }
            // read project resources again!
            List<String> currentResNames = cms.readProjectResources(m_project);
            // copy missing resources
            for (String resName : resourceRootPaths) {
                if (!currentResNames.contains(resName)) {
                    cms.copyResourceToProject(resName);
                }
            }
        } finally {
            // switch back to current site and project
            cms.getRequestContext().setSiteRoot(currentSite);
            cms.getRequestContext().setCurrentProject(currentProject);
        }
    }
521801
public void addContainerElement(String name, CmsResource resource) {

        getContainerInfo(name).getResources().add(resource);
    }
932585
@Override
    public T addAsApplicationResource(String resourceName) throws IllegalArgumentException {
        Validate.notNull(resourceName, "ResourceName must be specified");

        return addAsApplicationResource(new ClassLoaderAsset(resourceName), resourceName);
    }
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
1192052
@Override
    public T addAsWebResources(Package resourcePackage, String... resourceNames) throws IllegalArgumentException {
        Validate.notNull(resourcePackage, "ResourcePackage must be specified");
        Validate.notNullAndNoNullValues(resourceNames,
            "ResourceNames must be specified and can not container null values");
        for (final String resourceName : resourceNames) {
            addAsWebResource(resourcePackage, resourceName);
        }
        return covarientReturn();
    }
1060836
@Override
    public T addAsWebResource(String resourceName, String target) throws IllegalArgumentException {
        Validate.notNull(resourceName, "ResourceName should be specified");
        Validate.notNull(target, "Target should be specified");

        return addAsWebResource(new ClassLoaderAsset(resourceName), target);
    }