Set user-defined-attribute
@param path
@param attribute user:attribute name. user: can be omitted.. user: can be omitted.
@param value
@param options
@throws IOException
485435
public static final void setIntAttribute(Path path, String attribute, int value, LinkOption... options) throws IOException
    {
        attribute = attribute.startsWith("user:") ? attribute : "user:"+attribute;
        Files.setAttribute(path, attribute, Primitives.writeInt(value), options);
    }
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.");
        }
    }
813524
public static final long getLongAttribute(Path path, String attribute, long def, LinkOption... options) throws IOException
    {
        attribute = attribute.startsWith("user:") ? attribute : "user:"+attribute;
        byte[] attr = (byte[]) Files.getAttribute(path, attribute, options);
        if (attr == null)
        {
            return def;
        }      
        if (attr.length != 8)
        {
            throw new IllegalArgumentException(attribute+" not correct type");
        }
        return Primitives.readLong(attr);
    }
59538
@Override
    public void setAttribute(final String name, final String value) {
        hash.put(name, value);
    }
635596
public static void changeLocalFileUser(String path, String user) throws IOException {
    UserPrincipalLookupService lookupService =
        FileSystems.getDefault().getUserPrincipalLookupService();
    PosixFileAttributeView view =
        Files.getFileAttributeView(Paths.get(path), PosixFileAttributeView.class,
            LinkOption.NOFOLLOW_LINKS);
    UserPrincipal userPrincipal = lookupService.lookupPrincipalByName(user);
    view.setOwner(userPrincipal);
  }
898293
public static void setUser(Object user)
    {
        HttpSession session = WebContextFactory.get().getSession(true);
        session.setAttribute(USER, user);
    }
1338182
public void setAttribute(String key, Object attribute) {
		if(!isValid()) {
			throw new IllegalStateException("Can not bind object to session that has been invalidated!!");
		}
		if(key == null) {
			throw new NullPointerException("Name of attribute to bind cant be null!!!");
		}
		if(attribute == null) {
			throw new NullPointerException("Attribute that is to be bound cant be null!!!");
		}

		// Construct an event with the new value
		SipSessionBindingEvent event = null;

        // Call the valueBound() method if necessary
        if (attribute instanceof SipSessionBindingListener) {
            // Don't call any notification if replacing with the same value
            Object oldValue = getAttributeMap().get(key);
            if (attribute != oldValue) {
            	event = new SipSessionBindingEvent(this, key);
                try {
                    ((SipSessionBindingListener) attribute).valueBound(event);
                } catch (Throwable t){
                	logger.error("SipSessionBindingListener threw exception", t);
                }
            }
        }

		Object previousValue = this.getAttributeMap().put(key, attribute);

		if (previousValue != null && previousValue != attribute &&
	            previousValue instanceof SipSessionBindingListener) {
            try {
                ((SipSessionBindingListener) previousValue).valueUnbound
                    (new SipSessionBindingEvent(this, key));
            } catch (Throwable t) {
            	logger.error("SipSessionBindingListener threw exception", t);
            }
        }

		// Notifying Listeners of attribute addition or modification
		SipListeners sipListenersHolder = this.getSipApplicationSession().getSipContext().getListeners();
		List<SipSessionAttributeListener> listenersList = sipListenersHolder.getSipSessionAttributeListeners();
		if(listenersList.size() > 0) {
			if(event == null) {
				event = new SipSessionBindingEvent(this, key);
			}
			if (previousValue == null) {
				// This is initial, we need to send value bound event
				for (SipSessionAttributeListener listener : listenersList) {
					if(logger.isDebugEnabled()) {
						logger.debug("notifying SipSessionAttributeListener " + listener.getClass().getCanonicalName() + " of attribute added on key "+ key);
					}
					try {
						listener.attributeAdded(event);
					} catch (Throwable t) {
						logger.error("SipSessionAttributeListener threw exception", t);
					}
				}
			} else {
				for (SipSessionAttributeListener listener : listenersList) {
					if(logger.isDebugEnabled()) {
						logger.debug("notifying SipSessionAttributeListener " + listener.getClass().getCanonicalName() + " of attribute replaced on key "+ key);
					}
					try {
						listener.attributeReplaced(event);
					} catch (Throwable t) {
						logger.error("SipSessionAttributeListener threw exception", t);
					}
				}
			}
		}
	}
517889
public void setSrcPath(String in) throws IOException {
    srcPath= new Path(in);
    if (!srcPath.isAbsolute() || !srcPath.toUri().isAbsolute()) {
      throw new IOException("Path " + in +  " is not absolute.");
    }
  }
1141877
public ImmutableMap<String, Object> readAttributes(
      JimfsPath path, String attributes, Set<? super LinkOption> options) throws IOException {
    File file = lookUpWithLock(path, options).requireExists(path).file();
    return store.readAttributes(file, attributes);
  }
376778
public function enterAttribute(AttributePath $path): void
    {
        if ($this->done) {
            return;
        }

        $name = $path->getName();
        $value = $this->getValue($path, $this->attributes);
        $pattern = $path->getTypePattern();

        $this->validateValue($name, $value, $pattern);

        $this->uri .= $value;
    }
526523
public void setAttribute(File file, String attribute, Object value, boolean create) {
    String view = getViewName(attribute);
    String attr = getSingleAttribute(attribute);
    setAttributeInternal(file, view, attr, value, create);
  }
481914
public function setAttribute($path, $attribute, $value) {
		if ($attribute === 'system.dos_attr.mode' and is_int($value)) {
			$value = '0x' . dechex($value);
		}

		return $this->getState()->setxattr($this->buildUrl($path), $attribute, $value);
	}
444227
public void set(String name, Object obj) throws IOException {
        if (name.equalsIgnoreCase(SKIP_CERTS)) {
            if (!(obj instanceof Integer))
                throw new IOException("Attribute value should be of type Integer.");
            int skipCertsValue = ((Integer)obj).intValue();
            if (skipCertsValue < -1)
                throw new IOException("Invalid value for skipCerts");
            if (skipCertsValue == -1) {
                skipCerts = Integer.MAX_VALUE;
            } else {
                skipCerts = skipCertsValue;
            }
        } else
            throw new IOException("Attribute name not recognized by " +
                                  "CertAttrSet:InhibitAnyPolicy.");
        encodeThis();
    }
1099338
public void set(String name, Object obj) throws IOException {
        if (!(obj instanceof Integer)) {
            throw new IOException("Attribute must be of type Integer.");
        }
        if (name.equalsIgnoreCase(VERSION)) {
            version = ((Integer)obj).intValue();
        } else {
            throw new IOException("Attribute name not recognized by " +
                                  "CertAttrSet: CertificateVersion.");
        }
    }
131719
void setAttribute(File file, String attribute, Object value) {
    state.checkOpen();
    // TODO(cgdecker): Change attribute stuff to avoid the sad boolean parameter
    attributes.setAttribute(file, attribute, value, false);
  }
630355
void setAttribute(CryptoPath cleartextPath, String attribute, Object value, LinkOption... options) throws IOException {
		readonlyFlag.assertWritable();
		fileAttributeByNameProvider.setAttribute(cleartextPath, attribute, value, options);
	}
271535
public void setAttribute(String name, Object value)
  {
    if (_stream != null) {
      _stream.setAttribute(name, value);
    }
  }