Writes the specified bootstrap property and value to the provided server's bootstrap.properties file.
777452
public void writeBootstrapProperty(LibertyServer server, String propKey, String propValue) throws Exception {
        String bootProps = getBootstrapPropertiesFilePath(server);
        appendBootstrapPropertyToFile(bootProps, propKey, propValue);
    }
1162724
public void writeValue (String name, Object value) {
		try {
			writer.name(name);
		} catch (IOException ex) {
			throw new JsonException(ex);
		}
		if (value == null)
			writeValue(value, null, null);
		else
			writeValue(value, value.getClass(), null);
	}
1129952
private void writePropertyData() {
		try (PrintStream out = new PrintStream(
				ExampleHelpers.openExampleFileOuputStream("properties.csv"))) {

			out.println("Id" + ",Label" + ",Description" + ",URL" + ",Datatype"
					+ ",Uses in statements" + ",Items with such statements"
					+ ",Uses in statements with qualifiers"
					+ ",Uses in qualifiers" + ",Uses in references"
					+ ",Uses total" + ",Related properties");

			List<Entry<PropertyIdValue, PropertyRecord>> list = new ArrayList<Entry<PropertyIdValue, PropertyRecord>>(
					this.propertyRecords.entrySet());
			Collections.sort(list, new UsageRecordComparator());
			for (Entry<PropertyIdValue, PropertyRecord> entry : list) {
				printPropertyRecord(out, entry.getValue(), entry.getKey());
			}

		} catch (IOException e) {
			e.printStackTrace();
		}
	}
970663
private void writeBean(String currentIndent, String tagName, StringBuilder attrs, Class<?> propType, Bean value) throws IOException {
        if (value == null) {
            throw new IllegalArgumentException("Bean cannot be null");
        }
        output.append(currentIndent).append('<').append(tagName).append(attrs);
        if (value.getClass() != propType) {
            String typeStr = SerTypeMapper.encodeType(value.getClass(), settings, basePackage, knownTypes);
            appendAttribute(output, TYPE, typeStr);
        }
        if (willWriteBean(value)) {
            output.append('>').append(settings.getNewLine());
            writeBean(value, currentIndent + settings.getIndent());
            output.append(currentIndent).append('<').append('/').append(tagName).append('>').append(settings.getNewLine());
        } else {
            output.append('/').append('>').append(settings.getNewLine());
        }
    }
886759
public void writeJSON(JSONValue jc, JSONWriter jb, boolean writeClass)
            throws IOException {
        String key;
        Object value;
        jb.objectBegin();
        for (Map.Entry<String, Object> entry : objectMap.entrySet()) {
            key = entry.getKey();
            jb.objectItem(key);
            value = entry.getValue();
            if (value == null)
                jb.valueNull();
            else
                jc.writeValue(value, jb, writeClass);
        }
        jb.objectEnd();
    }
1072869
private void writeProperties() throws IOException
   {
      writeAttributeTypes("property_types", ProjectField.values());
      writeFields("property_values", m_projectFile.getProjectProperties(), ProjectField.values());
   }
881457
public void write(Object object, Object value) {
        if(object == null) {
            String msg = "Can not update the identifier \"" + _identifier + "\" on a null value object.";
            LOGGER.error(msg);
            throw new RuntimeException(msg);
        }

        if(TRACE_ENABLED)
            LOGGER.trace("Update property named \"" + _identifier + "\" on object of type: \"" + object.getClass().getName() + "\"");

        if(object instanceof Map)
            mapUpdate((Map)object, _identifier, value);
        else if(object instanceof List) {
            int i = parseIndex(_identifier);
            listUpdate((List)object, i, value);
        }
        else if(object.getClass().isArray()) {
            int i = parseIndex(_identifier);
            arrayUpdate(object, i, value);
        }
        else beanUpdate(object, _identifier, value);
    }
48118
def Write(self):
    """"""
    if self.writeback:
      self.writeback.SaveData(self.writeback_data)
    else:
      raise RuntimeError("Attempting to write a configuration without a "
                         "writeback location.")
295352
public static void main(String[] args)
    throws IOException
  {
    Properties properties = new Properties();
    for (int i=0; i < args.length; i++) {
      String name = args[i];
      if (name.startsWith("-") && name.length() > 1 && ++i < args.length) {
        name = name.substring(1);
        if ("properties".equals(name)) {
          try ( InputStream propsStream = Bootstrapper.class.getClassLoader().getResourceAsStream(name) ) {
            if (propsStream == null) throw new IOException("Could not read bootstrapper properties");
            Properties props = new Properties();
            props.load(propsStream);
            props.putAll(properties);
            properties = props;
          }
        } else {
          properties.put(name, args[i]);
        }
      } else {
        System.err.println("invalid argument: "+name);
        System.err.println(getUsage());
        System.exit(1);
      }
    }

    String invalid = joinList(listInvalidKeys(properties));
    if (invalid != null && invalid.length() > 0) {
      System.err.println("invalid arguments: "+invalid);
      System.err.println(getUsage());
      System.exit(1);
    }

// TODO: catch invalid argument exceptions and provide feedback
    new Bootstrapper().makeServer(properties);

    System.out.println(
      "Created "+properties.getProperty("restserver")+
      " server on "+properties.getProperty("restport")+
      " port for "+properties.getProperty("restdb")+
      " database"
    );
  }
541517
private void saveProperties() {
		assert Thread.holdsLock(properties);
		try {
			// Create a properties instance that sorts the output by keys (case-insensitive)
			Properties writer = new Properties() {
				private static final long serialVersionUID = 6953022173340009928L;
				@Override
				public Enumeration<Object> keys() {
					SortedSet<Object> sortedSet = new TreeSet<>(Collator.getInstance(Locale.ROOT));
					Enumeration<Object> e = super.keys();
					while(e.hasMoreElements()) sortedSet.add(e.nextElement());
					return Collections.enumeration(sortedSet);
				}
			};
			writer.putAll(properties);
			File tmpFile = File.createTempFile("ApplicationResources", null, sourceFile.getParentFile());
			OutputStream out = new BufferedOutputStream(new FileOutputStream(tmpFile));
			try {
				// Write any comments from when file was read
				if(sourceFileComments!=null) {
					for(String line : sourceFileComments) {
						out.write(line.getBytes(propertiesCharset));
						out.write(EOL.getBytes(propertiesCharset));
					}
				}
				// Wrap to skip any comments generated by Properties code
				out = new SkipCommentsFilterOutputStream(out);
				writer.store(out, null);
			} finally {
				out.close();
			}
			FileUtils.renameAllowNonAtomic(tmpFile, sourceFile);
		} catch(IOException err) {
			throw new RuntimeException(err);
		}
	}
1257179
private static void writeField(ObjectOutput out, Fieldable field) throws IOException
   {
      // Name
      out.writeUTF(field.name());
      // Flags
      writeFlags(out, field);
      if (field.getBoost() != 1.0f)
      {
         // Boost
         out.writeFloat(field.getBoost());
      }
      // Value
      writeValue(out, field);
   }
588489
async function writeCustomPropertiesToCssFile(to, customProperties) {
	const cssContent = Object.keys(customProperties).reduce((cssLines, name) => {
		cssLines.push(`\t${name}: ${customProperties[name]};`);

		return cssLines;
	}, []).join('\n');
	const css = `:root {\n${cssContent}\n}\n`;

	await writeFile(to, css);
}
859648
def rewrite_properties(self, properties):
        """"""
        with self.__properties_lock:
            self.__properties = properties
        self.__write_properties(None)
125085
async function writeExportsToJsonFile(to, customMedia, customProperties, customSelectors) {
	const jsonContent = JSON.stringify({
		'custom-media': customMedia,
		'custom-properties': customProperties,
		'custom-selectors': customSelectors
	}, null, '  ');
	const json = `${jsonContent}\n`;

	await writeFile(to, json);
}
1206200
private function writeProperty(
        PropertyInterface $property,
        PropertyInterface $blockProperty,
        $value,
        $index,
        NodeInterface $node,
        $userId,
        $webspaceKey,
        $languageCode,
        $segmentKey,
        $isImport = false
    ) {
        // save sub property
        $contentType = $this->contentTypeManager->get($property->getContentTypeName());
        $blockPropertyWrapper = new BlockPropertyWrapper($property, $blockProperty, $index);
        $blockPropertyWrapper->setValue($value);

        if ($isImport && $contentType instanceof ContentTypeExportInterface) {
            return $contentType->importData(
                new SuluNode($node),
                $blockPropertyWrapper,
                $value,
                $userId,
                $webspaceKey,
                $languageCode,
                $segmentKey
            );
        }

        $contentType->write(
            new SuluNode($node),
            $blockPropertyWrapper,
            $userId,
            $webspaceKey,
            $languageCode,
            $segmentKey
        );
    }
363709
protected void write(Font font, Properties styleAttributes) throws IOException {
        if (font == null || !isOtherFont(font) /* || styleAttributes == null*/) return;
        write(" ");
        write(HtmlTags.STYLE);
        write("=\"");
        if (styleAttributes != null) {
            String key;
            for (Enumeration e = styleAttributes.propertyNames(); e.hasMoreElements(); ) {
                key = (String)e.nextElement();
                writeCssProperty(key, styleAttributes.getProperty(key));
            }
        }
        if (isOtherFont(font)) {
            writeCssProperty(Markup.CSS_KEY_FONTFAMILY, font.getFamilyname());
            
            if (font.getSize() != Font.UNDEFINED) {
                writeCssProperty(Markup.CSS_KEY_FONTSIZE, font.getSize() + "pt");
            }
            if (font.getColor() != null) {
                writeCssProperty(Markup.CSS_KEY_COLOR, HtmlEncoder.encode(font.getColor()));
            }
            
            int fontstyle = font.getStyle();
            BaseFont bf = font.getBaseFont();
            if (bf != null) {
                String ps = bf.getPostscriptFontName().toLowerCase();
                if (ps.indexOf("bold") >= 0) {
                    if (fontstyle == Font.UNDEFINED)
                        fontstyle = 0;
                    fontstyle |= Font.BOLD;
                }
                if (ps.indexOf("italic") >= 0 || ps.indexOf("oblique") >= 0) {
                    if (fontstyle == Font.UNDEFINED)
                        fontstyle = 0;
                    fontstyle |= Font.ITALIC;
                }
            }
            if (fontstyle != Font.UNDEFINED && fontstyle != Font.NORMAL) {
                switch (fontstyle & Font.BOLDITALIC) {
                    case Font.BOLD:
                        writeCssProperty(Markup.CSS_KEY_FONTWEIGHT, Markup.CSS_VALUE_BOLD);
                        break;
                    case Font.ITALIC:
                        writeCssProperty(Markup.CSS_KEY_FONTSTYLE, Markup.CSS_VALUE_ITALIC);
                        break;
                    case Font.BOLDITALIC:
                        writeCssProperty(Markup.CSS_KEY_FONTWEIGHT, Markup.CSS_VALUE_BOLD);
                        writeCssProperty(Markup.CSS_KEY_FONTSTYLE, Markup.CSS_VALUE_ITALIC);
                        break;
                }
                
                // CSS only supports one decoration tag so if both are specified
                // only one of the two will display
                if ((fontstyle & Font.UNDERLINE) > 0) {
                    writeCssProperty(Markup.CSS_KEY_TEXTDECORATION, Markup.CSS_VALUE_UNDERLINE);
                }
                if ((fontstyle & Font.STRIKETHRU) > 0) {
                    writeCssProperty(Markup.CSS_KEY_TEXTDECORATION, Markup.CSS_VALUE_LINETHROUGH);
                }
            }
        }
        write("\"");
    }
308869
def write_properties_from_env(cls, path):
        '''
        
        '''
        with open(path, 'w') as f:
            f.write("# Autogenerated by kclboot v%s on %s\n\n" % (PACKAGE_VERSION, datetime.now()))
            for env_var, prop_var in ENV_TO_PROPERTY.items():
                env_value = os.environ.get(env_var)
                if env_value:
                    f.write("%s=%s\n" % (prop_var, env_value))