AWS Organizations Demo
AWS Organizations is used to manage multiply AWS account. Let me show you an example. Let's say we have a Master account and a sub-account. Invite new account to your…
AWS Organizations is used to manage multiply AWS account. Let me show you an example. Let's say we have a Master account and a sub-account. Invite new account to your…
Two ways to do this, Using core JavaUsing OpenCSV Let's start with the core Java way. Using core Java Write content to the CSV file. public void writeContentToCSVFile() throws IOException…
This post will show you how to parse content from an XML file and convert it to Java Object. XML file <Books> <Book> <Id>1</Id> <Name>Java Programming</Name> <Author>Andrew Programming</Author> </Book> <Book>…
Maven dependencies <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.10.0</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.8.11.1</version> </dependency> Convert Object to Json Core Logic package jsondemo; import com.fasterxml.jackson.core.JsonGenerationException; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; import java.io.File; import java.io.IOException;…
package FileDemo; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; public class BufferedWriterDemo { public static void main(String[] args) throws IOException { BufferedWriter bw = null; File file = new…
Three ways to do this FileIutputStream and FileOutputStreamDataInputStream and DataOutputStreamBufferedInputStream and BufferedInputStream FileIutputStream and FileOutputStream package FileDemo; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; public class ReadAndWriteContentWithFile { public static void…
Import Maven dependency <!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core --> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <version>2.12.1</version> </dependency> <!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api --> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-api</artifactId> <version>2.12.1</version> </dependency> Configuration File <?xml version="1.0" encoding="UTF-8"?> <Configuration status="INFO"> <Properties> <Property name="logPath">./</Property> <Property…
HttpURLConnection package urlconnectiondemo; import java.net.HttpURLConnection; import java.net.URL; public class UrlConnectionDemo { public static void main(String[] args) { try { URL url = new URL("http://www.baidu.com"); HttpURLConnection huc = (HttpURLConnection) url.openConnection(); for…
The properties file is used to store the properties. Developers can read and write properties from or into it. This post will show: How to write into the write properties…
Three ways to do this: Decimal FormatString.formatBigDecimal Decimal Format import java.math.RoundingMode; import java.text.DecimalFormat; public class DecimalFormatDemo { private static DecimalFormat df = new DecimalFormat("#.###"); public static void main(String[] args) {…