Used in file styles.xml, in <office:master-styles>,<style:master-page />.

@throws IOException If an I/O error occurs
349073
@Override
    public void appendXMLToMasterStyle(final XMLUtil util, final Appendable appendable)
            throws IOException {
        RegionFooterHeader
                .appendRegionXMLToMasterStyle(util, appendable, this.leftRegion, "region-left");
        RegionFooterHeader
                .appendRegionXMLToMasterStyle(util, appendable, this.centerRegion, "region-center");
        RegionFooterHeader
                .appendRegionXMLToMasterStyle(util, appendable, this.rightRegion, "region-right");
    }
696197
public void process(RootDoc root) throws IOException {
        // out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
        out.println("<XMI xmi.version=\"1.1\" >");

        out.println(" <XMI.header>");
        out.println("  <XMI.metamodel href=\"/vol/acfiles7/egonw/SourceForge/CDK/cdk/reports/javadoc/test2.xmi\" version=\"1.1\" name=\"UML\" />");
        out.println("  <XMI.model href=\"/vol/acfiles7/egonw/SourceForge/CDK/cdk/reports/javadoc/test2.xmi\" version=\"1\" name=\"/vol/acfiles7/egonw/SourceForge/CDK/cdk/reports/javadoc/test2.xmi\" />");
        out.println(" </XMI.header>");

        out.println(" <XMI.content>");
        out.println("  <docsettings viewid=\"-1\" documentation=\"\" uniqueid=\"1\" />");
        out.println("  <umlobjects>");
        generateUMLClass(root.specifiedPackages());
        out.println("  </umlobjects>");
        out.println("  <diagrams/>");
        out.println("  <listview>");
        out.println("   <listitem open=\"1\" type=\"800\" id=\"-1\" label=\"Views\" >");
        generateLogicalView(root.specifiedPackages());
        out.println("    <listitem open=\"1\" type=\"802\" id=\"-1\" label=\"Use Case View\" />");
        out.println("   </listitem>");
        out.println("  </listview>");
        out.println(" </XMI.content>");
        out.println("</XMI>");
    }
385001
public void toAngelCodeXML(PrintStream out, String imageName) throws IOException {
		try {
			DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
			Document document = builder.newDocument();
			Element root = document.createElement("font");
			document.appendChild(root);
			
			Element info = document.createElement("info");
			info.setAttribute("face",fontName);
			info.setAttribute("size",""+size);
			info.setAttribute("bold","0");
			info.setAttribute("italic","0");
			info.setAttribute("charSet",setName);
			info.setAttribute("unicode",""+0);
			info.setAttribute("stretchH",""+100);
			info.setAttribute("smooth",""+0);
			info.setAttribute("aa",""+0);
			info.setAttribute("padding","0,0,0,0");
			info.setAttribute("spacing","0,0");
			root.appendChild(info);
			Element common = document.createElement("common");
			common.setAttribute("lineHeight",""+lineHeight);
			common.setAttribute("base","0");
			common.setAttribute("scaleW",""+width);
			common.setAttribute("scaleH",""+height);
			common.setAttribute("pages","1");
			common.setAttribute("packed","0");
			root.appendChild(common);
			Element pages = document.createElement("pages");
			Element page = document.createElement("page");
			page.setAttribute("id","0");
			page.setAttribute("file",imageName);
			root.appendChild(pages);
			pages.appendChild(page);
			
			Element charsElement = document.createElement("chars");
			charsElement.setAttribute("count",""+chars.size());
			root.appendChild(charsElement);
			for (int i=0;i<chars.size();i++) {
				CharData c = (CharData) chars.get(i);
				Element charElement = document.createElement("char");
				
				charElement.setAttribute("id", ""+c.getID());
				charElement.setAttribute("x", ""+c.getX());
				charElement.setAttribute("y", ""+c.getY());
				charElement.setAttribute("width", ""+c.getWidth());
				charElement.setAttribute("height", ""+c.getHeight());
				charElement.setAttribute("xoffset", "0");
				charElement.setAttribute("yoffset", ""+c.getYOffset());
				charElement.setAttribute("xadvance", ""+c.getXAdvance());
				charElement.setAttribute("page", "0");
				charElement.setAttribute("chnl", "0");
				charsElement.appendChild(charElement);
			}
			
			Element kernsElement = document.createElement("kernings");
			kernsElement.setAttribute("count",""+kerning.size());
			root.appendChild(kernsElement);
			for (int i=0;i<kerning.size();i++) {
				KerningData k = (KerningData) kerning.get(i);
				Element kernElement = document.createElement("kerning");
				
				kernElement.setAttribute("first", ""+k.first);
				kernElement.setAttribute("second", ""+k.second);
				kernElement.setAttribute("amount", ""+k.offset);
				kernsElement.appendChild(kernElement);
			}
			
			Result result = new StreamResult(new OutputStreamWriter(out,
					"utf-8"));
			DOMSource source = new DOMSource(document);
			TransformerFactory factory = TransformerFactory.newInstance();
			factory.setAttribute("indent-number", new Integer(2));
			Transformer xformer = factory.newTransformer();
			xformer.setOutputProperty(OutputKeys.INDENT, "yes");
			
			xformer.transform(source, result);
		} catch (Exception e) {
			e.printStackTrace();
			IOException x = new IOException();
			x.initCause(e);
			
			throw x;
		}
	}
370669
private void writeResources() throws IOException
   {
      writeAttributeTypes("resource_types", ResourceField.values());

      m_writer.writeStartList("resources");
      for (Resource resource : m_projectFile.getResources())
      {
         writeFields(null, resource, ResourceField.values());
      }
      m_writer.writeEndList();
   }
716749
protected void generateFrameFile() throws IOException {
        Content frameset = getFrameDetails();
        if (configuration.windowtitle.length() > 0) {
            printFramesetDocument(configuration.windowtitle, configuration.notimestamp,
                    frameset);
        } else {
            printFramesetDocument(configuration.getText("doclet.Generated_Docs_Untitled"),
                    configuration.notimestamp, frameset);
        }
    }
10023
@Override
	public void loadFromXML(final InputStream in) throws IOException {
		lock.writeLock().lock();
		try {
			properties.loadFromXML(in);
		} finally {
			lock.writeLock().unlock();
		}
	}
374216
public void appendXMLToAutomaticStyle(final XMLUtil util,
										  final Appendable appendable) throws IOException {
		this.pageLayoutStyle.appendXMLToAutomaticStyle(util, appendable);
	}
485149
private void read() throws IOException {
        lastModified = jobFile.lastModified();
        if (jobFile.exists()) {
            try (final InputStream in = new FileInputStream(jobFile)) {
                final XMLReader parser = XMLUtils.getXMLReader();
                parser.setContentHandler(new JobHandler(prop, files));

                parser.parse(new InputSource(in));
            } catch (final SAXException e) {
                throw new IOException("Failed to read job file: " + e.getMessage());
            }
        } else {
            // defaults
            prop.put(PROPERTY_GENERATE_COPY_OUTER, Generate.NOT_GENERATEOUTTER.toString());
            prop.put(PROPERTY_ONLY_TOPIC_IN_MAP, Boolean.toString(false));
            prop.put(PROPERTY_OUTER_CONTROL, OutterControl.WARN.toString());
        }
    }
925434
private boolean checkStyle(String style) throws IOException {
		if (CSL.supportsStyle(style)) {
			//style is supported
			return true;
		}

		//style is not supported. look for alternatives.
		String message = "Could not find style in classpath: " + style;
		Set<String> availableStyles = CSL.getSupportedStyles();
		
		//output alternative
		if (!availableStyles.isEmpty()) {
			String dyms = ToolUtils.getDidYouMeanString(availableStyles, style);
			if (dyms != null && !dyms.isEmpty()) {
				message += "\n\n" + dyms;
			}
		}
		
		error(message);
		return false;
	}
1063063
private void init(InputStream in) throws java.io.IOException {
        if (in.available() > 2000000) {
        	throw new IOException("Font too big");
        }
        this.file = IOUtils.toByteArray(in);
        this.fsize = this.file.length;
        if (fsize > 2000000) {
        	throw new IOException("Font too big");
        }
        this.current = 0;
    }
1373907
private static void writeVersionToVerFile(String version) throws IOException {
        //declared in a try-with-resource statement, it will be closed regardless of it completes normally or not      
    	try (PrintWriter writer = new PrintWriter(new File(DoradusServer.class.getResource("/" + VERSION_FILE).getPath()))) {
    		writer.write(version);
    	}

    }
1051095
@PostConstruct
	protected void init() throws IOException {
		// base configuration from XML file
		if (null != configurationFile) {
			log.debug("Get base configuration from {}", configurationFile);
			manager = new DefaultCacheManager(configurationFile);
		} else {
			GlobalConfigurationBuilder builder = new GlobalConfigurationBuilder();
			builder.globalJmxStatistics().allowDuplicateDomains(true);
			manager = new DefaultCacheManager(builder.build());
		}

		if (listener == null) {
			listener = new InfinispanCacheListener();
		}
		manager.addListener(listener);

		// cache for caching the cache configurations (hmmm, sounds a bit strange)
		Map<String, Map<CacheCategory, CacheService>> cacheCache = 
				new HashMap<String, Map<CacheCategory, CacheService>>();

		// build default configuration
		if (null != defaultConfiguration) {
			setCaches(cacheCache, null, defaultConfiguration);
		}

		// build layer specific configurations
		for (Layer layer : layerMap.values()) {
			CacheInfo ci = configurationService.getLayerExtraInfo(layer.getLayerInfo(), CacheInfo.class);
			if (null != ci) {
				setCaches(cacheCache, layer, ci);
			}
		}
	}
890374
private void docTrain() throws IOException {
    // load training parameters file
    final String paramFile = this.parsedArguments.getString("params");
    final TrainingParameters params = IOUtils.loadTrainingParameters(paramFile);
    String outModel = null;
    if (params.getSettings().get("OutputModel") == null
        || params.getSettings().get("OutputModel").length() == 0) {
      outModel = Files.getNameWithoutExtension(paramFile) + ".bin";
      params.put("OutputModel", outModel);
    } else {
      outModel = Flags.getModel(params);
    }
    final DocumentClassifierTrainer docTrainer = new DocumentClassifierTrainer(
        params);
    final DocumentClassifierModel trainedModel = docTrainer.train(params);
    CmdLineUtil.writeModel("ixa-pipe-ml", new File(outModel), trainedModel);
  }
1374143
private void processResourceData() throws IOException
   {
      FieldMap fieldMap = new FieldMap12(m_file.getProjectProperties(), m_file.getCustomFields());
      fieldMap.createResourceFieldMap(m_projectProps);

      FieldMap enterpriseCustomFieldMap = new FieldMap12(m_file.getProjectProperties(), m_file.getCustomFields());
      enterpriseCustomFieldMap.createEnterpriseCustomFieldMap(m_projectProps, ResourceField.class);

      DirectoryEntry rscDir = (DirectoryEntry) m_projectDir.getEntry("TBkndRsc");
      VarMeta rscVarMeta = new VarMeta12(new DocumentInputStream(((DocumentEntry) rscDir.getEntry("VarMeta"))));
      Var2Data rscVarData = new Var2Data(rscVarMeta, new DocumentInputStream(((DocumentEntry) rscDir.getEntry("Var2Data"))));
      FixedMeta rscFixedMeta = new FixedMeta(new DocumentInputStream(((DocumentEntry) rscDir.getEntry("FixedMeta"))), 37);
      FixedData rscFixedData = new FixedData(rscFixedMeta, m_inputStreamFactory.getInstance(rscDir, "FixedData"));
      FixedMeta rscFixed2Meta = new FixedMeta(new DocumentInputStream(((DocumentEntry) rscDir.getEntry("Fixed2Meta"))), 49);
      FixedData rscFixed2Data = new FixedData(rscFixed2Meta, m_inputStreamFactory.getInstance(rscDir, "Fixed2Data"));
      Props12 props = new Props12(m_inputStreamFactory.getInstance(rscDir, "Props"));
      //System.out.println(rscVarMeta);
      //System.out.println(rscVarData);
      //System.out.println(rscFixedMeta);
      //System.out.println(rscFixedData);
      //System.out.println(rscFixed2Meta);
      //System.out.println(rscFixed2Data);
      //System.out.println(props);

      // Process aliases
      new CustomFieldAliasReader(m_file.getCustomFields(), props.getByteArray(RESOURCE_FIELD_NAME_ALIASES)).process();

      TreeMap<Integer, Integer> resourceMap = createResourceMap(fieldMap, rscFixedMeta, rscFixedData);
      Integer[] uniqueid = rscVarMeta.getUniqueIdentifierArray();
      Integer id;
      Integer offset;
      byte[] data;
      byte[] metaData;
      Resource resource;

      String notes;

      for (int loop = 0; loop < uniqueid.length; loop++)
      {
         id = uniqueid[loop];
         offset = resourceMap.get(id);
         if (offset == null)
         {
            continue;
         }

         data = rscFixedData.getByteArrayValue(offset.intValue());
         byte[] metaData2 = rscFixed2Meta.getByteArrayValue(offset.intValue());
         byte[] data2 = rscFixed2Data.getByteArrayValue(offset.intValue());
         //metaData = rscFixedMeta.getByteArrayValue(offset.intValue());
         //MPPUtility.dataDump(data, true, true, true, true, true, true, true);
         //MPPUtility.dataDump(metaData, true, true, true, true, true, true, true);
         //MPPUtility.varDataDump(rscVarData, id, true, true, true, true, true, true);

         resource = m_file.addResource();

         resource.disableEvents();
         fieldMap.populateContainer(ResourceField.class, resource, id, new byte[][]
         {
            data,
            data2
         }, rscVarData);

         enterpriseCustomFieldMap.populateContainer(ResourceField.class, resource, id, null, rscVarData);

         resource.enableEvents();

         resource.setBudget((metaData2[8] & 0x20) != 0);

         resource.setGUID(MPPUtility.getGUID(data2, 0));

         processHyperlinkData(resource, rscVarData.getByteArray(id, fieldMap.getVarDataKey(ResourceField.HYPERLINK_DATA)));

         resource.setID(Integer.valueOf(MPPUtility.getInt(data, 4)));

         resource.setOutlineCode1(m_outlineCodeVarData.getUnicodeString(Integer.valueOf(rscVarData.getInt(id, 2, fieldMap.getVarDataKey(ResourceField.OUTLINE_CODE1_INDEX))), OUTLINECODE_DATA));
         resource.setOutlineCode2(m_outlineCodeVarData.getUnicodeString(Integer.valueOf(rscVarData.getInt(id, 2, fieldMap.getVarDataKey(ResourceField.OUTLINE_CODE2_INDEX))), OUTLINECODE_DATA));
         resource.setOutlineCode3(m_outlineCodeVarData.getUnicodeString(Integer.valueOf(rscVarData.getInt(id, 2, fieldMap.getVarDataKey(ResourceField.OUTLINE_CODE3_INDEX))), OUTLINECODE_DATA));
         resource.setOutlineCode4(m_outlineCodeVarData.getUnicodeString(Integer.valueOf(rscVarData.getInt(id, 2, fieldMap.getVarDataKey(ResourceField.OUTLINE_CODE4_INDEX))), OUTLINECODE_DATA));
         resource.setOutlineCode5(m_outlineCodeVarData.getUnicodeString(Integer.valueOf(rscVarData.getInt(id, 2, fieldMap.getVarDataKey(ResourceField.OUTLINE_CODE5_INDEX))), OUTLINECODE_DATA));
         resource.setOutlineCode6(m_outlineCodeVarData.getUnicodeString(Integer.valueOf(rscVarData.getInt(id, 2, fieldMap.getVarDataKey(ResourceField.OUTLINE_CODE6_INDEX))), OUTLINECODE_DATA));
         resource.setOutlineCode7(m_outlineCodeVarData.getUnicodeString(Integer.valueOf(rscVarData.getInt(id, 2, fieldMap.getVarDataKey(ResourceField.OUTLINE_CODE7_INDEX))), OUTLINECODE_DATA));
         resource.setOutlineCode8(m_outlineCodeVarData.getUnicodeString(Integer.valueOf(rscVarData.getInt(id, 2, fieldMap.getVarDataKey(ResourceField.OUTLINE_CODE8_INDEX))), OUTLINECODE_DATA));
         resource.setOutlineCode9(m_outlineCodeVarData.getUnicodeString(Integer.valueOf(rscVarData.getInt(id, 2, fieldMap.getVarDataKey(ResourceField.OUTLINE_CODE9_INDEX))), OUTLINECODE_DATA));
         resource.setOutlineCode10(m_outlineCodeVarData.getUnicodeString(Integer.valueOf(rscVarData.getInt(id, 2, fieldMap.getVarDataKey(ResourceField.OUTLINE_CODE10_INDEX))), OUTLINECODE_DATA));

         resource.setUniqueID(id);

         metaData = rscFixedMeta.getByteArrayValue(offset.intValue());
         resource.setFlag(1, (metaData[28] & 0x40) != 0);
         resource.setFlag(2, (metaData[28] & 0x80) != 0);
         resource.setFlag(3, (metaData[29] & 0x01) != 0);
         resource.setFlag(4, (metaData[29] & 0x02) != 0);
         resource.setFlag(5, (metaData[29] & 0x04) != 0);
         resource.setFlag(6, (metaData[29] & 0x08) != 0);
         resource.setFlag(7, (metaData[29] & 0x10) != 0);
         resource.setFlag(8, (metaData[29] & 0x20) != 0);
         resource.setFlag(9, (metaData[29] & 0x40) != 0);
         resource.setFlag(10, (metaData[28] & 0x20) != 0);
         resource.setFlag(11, (metaData[29] & 0x80) != 0);
         resource.setFlag(12, (metaData[30] & 0x01) != 0);
         resource.setFlag(13, (metaData[30] & 0x02) != 0);
         resource.setFlag(14, (metaData[30] & 0x04) != 0);
         resource.setFlag(15, (metaData[30] & 0x08) != 0);
         resource.setFlag(16, (metaData[30] & 0x10) != 0);
         resource.setFlag(17, (metaData[30] & 0x20) != 0);
         resource.setFlag(18, (metaData[30] & 0x40) != 0);
         resource.setFlag(19, (metaData[30] & 0x80) != 0);
         resource.setFlag(20, (metaData[31] & 0x01) != 0);

         notes = resource.getNotes();
         if (m_reader.getPreserveNoteFormatting() == false)
         {
            notes = RtfHelper.strip(notes);
         }
         resource.setNotes(notes);

         //
         // Configure the resource calendar
         //
         resource.setResourceCalendar(m_resourceMap.get(id));

         //
         // Process any enterprise columns
         //
         processResourceEnterpriseColumns(resource, metaData2);

         //
         // Process cost rate tables
         //
         CostRateTableFactory crt = new CostRateTableFactory();
         crt.process(resource, 0, rscVarData.getByteArray(id, fieldMap.getVarDataKey(ResourceField.COST_RATE_A)));
         crt.process(resource, 1, rscVarData.getByteArray(id, fieldMap.getVarDataKey(ResourceField.COST_RATE_B)));
         crt.process(resource, 2, rscVarData.getByteArray(id, fieldMap.getVarDataKey(ResourceField.COST_RATE_C)));
         crt.process(resource, 3, rscVarData.getByteArray(id, fieldMap.getVarDataKey(ResourceField.COST_RATE_D)));
         crt.process(resource, 4, rscVarData.getByteArray(id, fieldMap.getVarDataKey(ResourceField.COST_RATE_E)));

         //
         // Process availability table
         //
         AvailabilityFactory af = new AvailabilityFactory();
         af.process(resource.getAvailability(), rscVarData.getByteArray(id, fieldMap.getVarDataKey(ResourceField.AVAILABILITY_DATA)));

         //
         // Process resource type
         //
         if ((metaData[9] & 0x02) != 0)
         {
            resource.setType(ResourceType.WORK);
         }
         else
         {
            if ((metaData2[8] & 0x10) != 0)
            {
               resource.setType(ResourceType.COST);
            }
            else
            {
               resource.setType(ResourceType.MATERIAL);
            }
         }

         m_eventManager.fireResourceReadEvent(resource);
      }
   }
521303
public void configure() throws IOException {
        if (archetypesPomFile != null) {
            archetypesPomArtifactIds = loadArchetypesPomArtifactIds(archetypesPomFile);
        }
        catalogXmlFile.getParentFile().mkdirs();
        LOG.info("Writing catalog: " + catalogXmlFile);
        printWriter = new PrintWriter(new OutputStreamWriter(new FileOutputStream(catalogXmlFile), "UTF-8"));

        printWriter.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
            "<archetype-catalog xmlns=\"http://maven.apache.org/plugins/maven-archetype-plugin/archetype-catalog/1.0.0\"\n" +
            indent + indent + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
            indent + indent + "xsi:schemaLocation=\"http://maven.apache.org/plugins/maven-archetype-plugin/archetype-catalog/1.0.0 http://maven.apache.org/xsd/archetype-catalog-1.0.0.xsd\">\n" +
            indent + "<archetypes>");

        if (bomFile != null && bomFile.exists()) {
            // read all properties of the bom, so we have default values for ${ } placeholders
            String text = IOHelpers.readFully(bomFile);
            Document doc = archetypeUtils.parseXml(new InputSource(new StringReader(text)));
            Element root = doc.getDocumentElement();

            // lets load all the properties defined in the <properties> element in the bom pom.
            NodeList propertyElements = root.getElementsByTagName("properties");
            if (propertyElements.getLength() > 0)  {
                Element propertyElement = (Element) propertyElements.item(0);
                NodeList children = propertyElement.getChildNodes();
                for (int cn = 0; cn < children.getLength(); cn++) {
                    Node e = children.item(cn);
                    if (e instanceof Element) {
                        versionProperties.put(e.getNodeName(), e.getTextContent());
                    }
                }
            }
            if (LOG.isDebugEnabled()) {
                for (Map.Entry<String, String> entry : versionProperties.entrySet()) {
                    LOG.debug("bom property: {}={}", entry.getKey(), entry.getValue());
                }
            }
        }
    }
480444
public void writeVisibleDataStyles(final XMLUtil util, final Appendable appendable)
            throws IOException {
        final Iterable<DataStyle> dataStyles = this.dataStylesContainer
                .getValues(Dest.STYLES_COMMON_STYLES);
        for (final DataStyle dataStyle : dataStyles) {
            assert !dataStyle.isHidden() : dataStyle.toString() + " - " + dataStyle.getName() +
                    TableCellStyle.DEFAULT_CELL_STYLE.toString();

            dataStyle.appendXMLContent(util, appendable);
        }
    }
1103428
public void load() throws IOException {
        if (resource.toExternalForm().endsWith(".xml")) {
            // XML Format
            bundle = new XMLResourceBundle(resource.openStream());
        } else {
            // Properties file (loaded using UTF-8)
            bundle = new UTF8PropertiesResourceBundle(resource.openStream());
        }

        if (bundle.keySet().isEmpty()) {
            throw new IOException(resource.toExternalForm() + " is not a valid resource - no keys");
        }
    }