Set Attachment

@param type the attachment type
@param url the attachment url
@param is_reusable whether to be reusable or not
336799
public void setAttachment(String type, String url, Boolean is_reusable)
    {
        this.message_attachment.put("type", type);
        this.message_attachment.put("url", url);
        this.message_attachment.put("is_reusable", String.valueOf(is_reusable));
    }
41461
public void setImageUrlAttribute(String name, String value) {
		Attribute attribute = getAttributes().get(name);
		if (!(attribute instanceof ImageUrlAttribute)) {
			throw new IllegalStateException("Cannot set imageUrl value on attribute with different type, " +
					attribute.getClass().getName() + " setting value " + value);
		}
		((ImageUrlAttribute) attribute).setValue(value);
	}
355395
@Override
	public void setUrls(int type, List<String> urls) throws DatabaseException {
		this.deleteAllUrlsForType(type);
		for (String url : urls) {
			this.insert(type, url);
		}
	}
1320631
func (s *GenericAttachment) SetAttachmentLinkUrl(v string) *GenericAttachment {
	s.AttachmentLinkUrl = &v
	return s
}
1338087
function (url, type) {
      switch (type.toLowerCase()) {
        // css files can be reloaded dynamically by replacing the link element                               
        case "text/css":
          var link = currentLinkElements[url],
              html = document.body.parentNode,
              head = link.parentNode,
              next = link.nextSibling,
              newLink = document.createElement("link");

          html.className = html.className.replace(/\s*livejs\-loading/gi, '') + ' livejs-loading';
          newLink.setAttribute("type", "text/css");
          newLink.setAttribute("rel", "stylesheet");
          newLink.setAttribute("href", url + "?now=" + new Date() * 1);
          next ? head.insertBefore(newLink, next) : head.appendChild(newLink);
          currentLinkElements[url] = newLink;
          oldLinkElements[url] = link;

          // schedule removal of the old link
          Live.removeoldLinkElements();
          break;

        // check if an html resource is our current url, then reload                               
        case "text/html":
          if (url != document.location.href)
            return;

          // local javascript changes cause a reload as well
        case "text/javascript":
        case "application/javascript":
        case "application/x-javascript":
          document.location.reload();
      }
    }
241552
public void setDestinationUrl(GlobusURL dest)
        throws UrlCopyException {
        if (dest == null) {
            throw new IllegalArgumentException("Desitination url cannot be null");
        }
        checkUrl(dest);
        dstUrl = dest;
    }
725614
public AbstractSheet<TRow, TColumn, TCell> setAttachments(List<Attachment> attachments) {
        this.attachments = attachments;
        return this;
    }
677369
public void setImageUrl(final String imageUrl) {
		LinkModel model = getOrCreateComponentModel();
		model.imageUrl = imageUrl;
		model.image = null;
	}
204449
public static void put(String url, HttpConsumer<HttpExchange> endpoint, MediaTypes... mediaTypes) {
        addResource(Methods.PUT, url, endpoint, mediaTypes);
    }
1170203
public void setTreeResource(String type, String value) {

        if (value == null) {
            return;
        }
        if (value.startsWith(CmsResource.VFS_FOLDER_SYSTEM + "/") && (!value.startsWith(m_currentSite))) {
            // restrict access to /system/
            value = "/";
        }
        m_treeType.put(type, value);
    }
131487
@Override
    public void setCacheability(String cacheability) {
        Preconditions.checkArgument(
                this.urlType == UrlType.RESOURCE,
                "UrlType must be %s but was %s",
                UrlType.RESOURCE,
                this.urlType);
        this.cacheability = cacheability;
    }
682060
public void setButton(String type, String title, String url, String payload)
    {
        HashMap<String, String> button = new HashMap<String, String>();
        button.put("type", type);
        button.put("title", title);
        button.put("url", url);
        button.put("payload", payload);
        this.buttons.add(button);
    }
385744
private void loadMimeType(URL url) {
    try {
      Stopwatch watch = new Stopwatch(true);
      InputStream im = url.openStream();
      contentTypes.load(im);
      logger.info("Load {} content types in {}", contentTypes.size(), watch);
      im.close();
    } catch (IOException e) {
      logger.error("load " + url + " error", e);
    }
  }
1162674
public static void patch(String url, HttpConsumer<HttpExchange> endpoint, MediaTypes... mediaTypes) {
        addResource(Methods.PATCH, url, endpoint, mediaTypes);
    }
407461
public void setType(String type) throws ApplicationException {
	if (StringUtil.isEmpty(type, true)) return;
	type = type.toLowerCase().trim();

	if (type.equals("url")) param.setType(HttpParamBean.TYPE_URL);
	else if (type.equals("formfield") || type.equals("form")) param.setType(HttpParamBean.TYPE_FORM);
	else if (type.equals("cgi")) param.setType(HttpParamBean.TYPE_CGI);
	else if (type.startsWith("head") || type.startsWith("header")) param.setType(HttpParamBean.TYPE_HEADER);
	else if (type.equals("cookie")) param.setType(HttpParamBean.TYPE_COOKIE);
	else if (type.equals("file")) param.setType(HttpParamBean.TYPE_FILE);
	else if (type.equals("xml")) param.setType(HttpParamBean.TYPE_XML);
	else if (type.equals("body")) param.setType(HttpParamBean.TYPE_BODY);
	else throw new ApplicationException("invalid type [" + type + "], valid types are [body,cgi,cookie,file,form,head,url,xml]");
    }
654913
public void setMimeattach(String strMimeattach, String fileName, String type, String disposition, String contentID, boolean removeAfterSend) throws PageException {
	Resource file = ResourceUtil.toResourceNotExisting(pageContext, strMimeattach);
	pageContext.getConfig().getSecurityManager().checkFileLocation(file);
	if (!file.exists()) throw new ApplicationException("can't attach file " + strMimeattach + ", this file doesn't exist");

	smtp.addAttachment(file, fileName, type, disposition, contentID, removeAfterSend);

    }
751848
public void urlCheckAndSave(BasicCheckInfo basicCheckInfo, ParamType paramType, ReqUrl reqUrl, Class<?> type) {
        if (!this.validationConfig.isFreshUrlSave() || !basicCheckInfo.isUrlMapping()) {
            return;
        }

        List<ValidationData> datas = this.validationDataRepository.findByParamTypeAndMethodAndUrl(paramType, reqUrl.getMethod(), reqUrl.getUrl());
        if (datas.isEmpty()) {
            this.saveParameter(basicCheckInfo.getDetailParam(), paramType, reqUrl, null, type, 0, this.validationConfig.getMaxDeepLevel());
            this.validationDataRepository.flush();
            this.validationStore.refresh();
        }
    }