Thursday, February 26, 2015

Java get system environment variable details

Get System environment variable details. import java.util.Map; /** * * @author Uttesh Kumar T.H. */ public class FindJdk { public static void main(String[] args) { Map<String, String> env = System.getenv(); for (String envName : env.keySet()) { System.out.format("%s=%s%n",envName,env.get(envName)); ...

Command execution by Java Processor

sample code to execute any command on operating system by using java processor. for example : To find jdk installed in system, We can run the command "where javac" for window and "where is javac" for linux the above command will return path javac.exe/javac.bin, by using that path we have to go to...

Wednesday, February 25, 2015

Monday, February 23, 2015

Whois domain detail by java

Apache commmon org.apache.commons.net.whois.WhoisClient class provides the domain details. Following details: Domain Name: UTTESH.COM Registrar: GODADDY.COM, LLC Sponsoring Registrar IANA ID: 146 Whois Server: whois.godaddy.com Referral URL: http://registrar.godaddy.com Name Server: NS63.DOMAINCONTROL.COM Name...

JAVA8 Lambda part1

Lambda expressions are a new and important feature included in Java SE 8. Lambda expressions also improve the Collection libraries making it easier to iterate through, filter, and extract data from a Collection. In addition, new concurrency features improve performance. Lambda Expression Syntax (Arguments)...

Thursday, February 19, 2015

Exciting Features In Java 8 That Will Change How We Code?

5 features that we feel an absolute must for you to know about. 1.Lambda expressions. 2.Parallel operations. 3.Java + JavaScript :) 4.New date / time APIs. 5.Concurrent accumulators 1.Lambda expressions Lambda expressions have taken the programming world by storm in the last few years. Most modern...

Tuesday, February 17, 2015

Is in Daylight Saving Time (DST)? for given date and timezone

Daylight Saving Time (DST) is the practice of turning the clock ahead as warmer weather approaches and back as it becomes colder again so that people will have one more hour of daylight in the afternoon and evening during the warmer season of the year. i.e In the spring when DST starts (= lose one...

Screen capture by Java robot class

Came across a rare util class of java "Robot" class, which provie the control/auto typing of letter/keyboard controll and screen capering. sample code This file contains bidirectional Unicode text that may be interpreted or compiled...

Monday, February 16, 2015

JAXB sample

JAXB, stands for Java Architecture for XML Binding, using JAXB annotation to convert Java object to / from XML file. No need of external jar library files. JAXB is bundled in from JDK 1.6. Basic features : Marshalling – Convert a Java object into a XML file. Unmarshalling – Convert XML content into...

Wednesday, February 11, 2015