sets attributes of a file on Windows system

@param res
@param attributes
@throws PageException
@throws IOException
16405
public static String translateAttribute(String attributes) throws IOException {
	short[] flags = strAttrToBooleanFlags(attributes);

	StringBuilder sb = new StringBuilder();
	if (flags[READ_ONLY] == YES) sb.append(" +R");
	else if (flags[READ_ONLY] == NO) sb.append(" -R");

	if (flags[HIDDEN] == YES) sb.append(" +H");
	else if (flags[HIDDEN] == NO) sb.append(" -H");

	if (flags[SYSTEM] == YES) sb.append(" +S");
	else if (flags[SYSTEM] == NO) sb.append(" -S");

	if (flags[ARCHIVE] == YES) sb.append(" +A");
	else if (flags[ARCHIVE] == NO) sb.append(" -A");

	return sb.toString();
    }
378714
function setAttributes(el, attributes) {
	console.log('setting attributes on element...', el, attributes);
    _.each(attributes, (value, name) => el.setAttribute(name, value));
}
73028
public PlatformApplication withAttributes(java.util.Map<String, String> attributes) {
        setAttributes(attributes);
        return this;
    }
1044933
public void setAttr(String attr, Object val) throws NamingException {
    getAttributes().put(attr, val);
  }
1019103
public static final void setStringAttribute(Path path, String attribute, String value, LinkOption... options) throws IOException
    {
        attribute = attribute.startsWith("user:") ? attribute : "user:"+attribute;
        if (value != null)
        {
            Files.setAttribute(path, attribute, value.getBytes(UTF_8), options);
        }
        else
        {
            Files.setAttribute(path, attribute, null, options);
        }
    }
1161769
public void setAttribute(String attrname, String value) {
        if (attributes == null)
            attributes = new ArrayList<Attribute>();
        Attribute.setAttribute(attributes, attrname, value);
    }
1231142
public void setAttributes(java.util.Collection<TypedLinkAttributeDefinition> attributes) {
        if (attributes == null) {
            this.attributes = null;
            return;
        }

        this.attributes = new java.util.ArrayList<TypedLinkAttributeDefinition>(attributes);
    }
1135291
public void setWriteAttributes(java.util.Collection<String> writeAttributes) {
        if (writeAttributes == null) {
            this.writeAttributes = null;
            return;
        }

        this.writeAttributes = new java.util.ArrayList<String>(writeAttributes);
    }
459950
public final void setLink(Attributes attributes) {
        lineValues[GpxMetadata.LINELINK_HREF] = attributes.getValue(GPXTags.HREF);
    }
824353
public void setAttributes(String path, SftpFileAttributes attrs)
			throws SftpStatusException, SshException {
		try {
			UnsignedInteger32 requestId = nextRequestId();

			Packet msg = createPacket();
			msg.write(SSH_FXP_SETSTAT);
			msg.writeInt(requestId.longValue());
			msg.writeString(path, CHARSET_ENCODING);
			msg.write(attrs.toByteArray());

			sendMessage(msg);

			getOKRequestStatus(requestId);
		} catch (SshIOException ex) {
			throw ex.getRealException();
		} catch (IOException ex) {
			throw new SshException(ex, SshException.INTERNAL_ERROR);
		}
	}
1112208
@SuppressWarnings("unchecked") // Checked with instanceof
    public void set(String name, Object obj) throws IOException {
        if (name.equalsIgnoreCase(MAP)) {
            if (!(obj instanceof List)) {
              throw new IOException("Attribute value should be of" +
                                    " type List.");
            }
            maps = (List<CertificatePolicyMap>)obj;
        } else {
          throw new IOException("Attribute name not recognized by " +
                        "CertAttrSet:PolicyMappingsExtension.");
        }
        encodeThis();
    }
1087946
public void set(String name, Object obj) throws IOException {
        if (name.equalsIgnoreCase(KEY)) {
            this.key = (PublicKey)obj;
        } else {
            throw new IOException("Attribute name not recognized by " +
                                  "CertAttrSet: CertificateX509Key.");
        }
    }
1134351
public void set(String name, Object val)
    throws CertificateException, IOException {
        X509AttributeName attrName = new X509AttributeName(name);

        int attr = attributeMap(attrName.getPrefix());
        if (attr == 0) {
            throw new CertificateException("Attribute name not recognized: "
                                           + name);
        }
        // set rawCertInfo to null, so that we are forced to re-encode
        rawCertInfo = null;
        String suffix = attrName.getSuffix();

        switch (attr) {
        case ATTR_VERSION:
            if (suffix == null) {
                setVersion(val);
            } else {
                version.set(suffix, val);
            }
            break;

        case ATTR_SERIAL:
            if (suffix == null) {
                setSerialNumber(val);
            } else {
                serialNum.set(suffix, val);
            }
            break;

        case ATTR_ALGORITHM:
            if (suffix == null) {
                setAlgorithmId(val);
            } else {
                algId.set(suffix, val);
            }
            break;

        case ATTR_ISSUER:
            setIssuer(val);
            break;

        case ATTR_VALIDITY:
            if (suffix == null) {
                setValidity(val);
            } else {
                interval.set(suffix, val);
            }
            break;

        case ATTR_SUBJECT:
            setSubject(val);
            break;

        case ATTR_KEY:
            if (suffix == null) {
                setKey(val);
            } else {
                pubKey.set(suffix, val);
            }
            break;

        case ATTR_ISSUER_ID:
            setIssuerUniqueId(val);
            break;

        case ATTR_SUBJECT_ID:
            setSubjectUniqueId(val);
            break;

        case ATTR_EXTENSIONS:
            if (suffix == null) {
                setExtensions(val);
            } else {
                if (extensions == null)
                    extensions = new CertificateExtensions();
                extensions.set(suffix, val);
            }
            break;
        }
    }
1180849
public static void setAttribute(String key, Object value) {
        assertInitialized();
        getAppFramework().setAttribute(key, value);
    }
764494
public void setReadAttributes(java.util.Collection<String> readAttributes) {
        if (readAttributes == null) {
            this.readAttributes = null;
            return;
        }

        this.readAttributes = new java.util.ArrayList<String>(readAttributes);
    }
341482
public void setAttributes(Map<String, Attribute> attributes) {
		if (null == attributes) {
			throw new IllegalArgumentException("Attributes should be not-null.");
		}
		this.attributes = attributes;
		this.attributesLoaded = true;
	}
374977
def set_attributes(self, attributes):
        
        for k, v in attributes.items():
            self.set_attribute(k, v)