SupportWriter space ↗
REFERENCE LIBRARY

References from other publishers

Republished articles with source attribution. This collection is separate from Diary Coding’s original guides and does not display ads.

Read original guides → · Editorial policy

FOR YOUR CURIOSITY

Latest notes.

CORE API / NOTES</>↗
Core API18 Nov 2007

How do I store properties as XML file?

In the previous example, How do I load properties from XML file? we read properties from XML file. Now it’s the turn on how to store the properties as XML file. package org.kodejava.io; import java.io.FileOutputStream; import java.nio.charset.StandardCharsets; import java.util.Properties; public class PropertiesToXml { public static void main(String[] args) throws Exception { Properties properties = new […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API16 Nov 2007

How do I load properties from XML file?

Reading XML properties can be easily done using the java.util.Properties.loadFromXML() method. Just like reading the properties from a file that contains a key=value pairs, the XML file will also contain a key and value wrapped in the following XML format. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> <properties> <comment>Application Configuration</comment> <entry key="data.folder">D:\AppData</entry> <entry key="...

Wayan · 2 min read
CORE API / NOTES</>↗
Core API13 Nov 2007

How do I convert InputStream to String?

This example will show you how to convert an InputStream into String. In the code snippet below we read a data.txt file, could be from common directory or from inside a jar file. package org.kodejava.io; import java.io.*; import java.nio.charset.StandardCharsets; public class StreamToString { public static void main(String[] args) throws Exception { StreamToString demo = new […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API11 Nov 2007

How do I convert string into InputStream?

Here you will find how to convert string into java.io.InputStream object using java.io.ByteArrayInputStream class. package org.kodejava.io; import java.io.*; import java.nio.charset.StandardCharsets; public class StringToStream { public static void main(String[] args) { String text = "Converting String to InputStream Example"; // Convert String to InputStream using ByteArrayInputStream // class. This class constructor takes the string byte array […]

Wayan · 1 min read
APACHE COMMONS / NOTES</>↗
Apache Commons08 Nov 2007

How do I determine bean’s property type?

Using the PropertyUtils.getPropertyType() we can determine the bean property type. This method return a Class object of bean’s property type. package org.kodejava.commons.beanutils; import org.apache.commons.beanutils.PropertyUtils; import org.kodejava.commons.beanutils.support.Record; public class PropertyType { public static void main(String[] args) { Record record = new Record(); record.setTitle("Magical Mystery Tour"); try { /* * Using PropertyUtils.getPropertyType() to d...

Wayan · 2 min read
APACHE COMMONS / NOTES</>↗
Apache Commons03 Nov 2007

How do I read mapped bean’s property value?

In this example you’ll see how to read mapped property value of a bean. We use PropertyUtils.getMappedProperty() method the read the mapped property of the Record object that consist of Track objects. package org.kodejava.commons.beanutils; import org.apache.commons.beanutils.PropertyUtils; import org.kodejava.commons.beanutils.support.Track; import org.kodejava.commons.beanutils.support.Record; import java.util.HashMap; import java.util.Map; public class ReadMapProperty { pu...

Wayan · 2 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.