Thursday, June 11, 2015

Mule Fundamentals Video Tutorial

To ensure delivery, add no-reply@vimeo.com to your address book.
Vimeo
Mule Fundamentals
by Mulesoft Training /
Forward this email to your friends and family so that they can watch the video too.

              
TM + © Vimeo, LLC
555 West 18th Street, New York, NY 10011
Terms | Privacy Policy

Jack Ma Speech - How to Run Business


Wednesday, June 10, 2015

Intellij IDEA for Students FREE (1 Year)

Folks,
          Jetbrains is offering Intellij IDEA Ultimate Edition for one year FREE for students with edu email address. If you are student and you got .edu email address go and download the most intelligent IDE.

                            https://www.jetbrains.com/estore/students/


Happy Coding!

Friday, June 5, 2015

Introduction To Mule Application Development - Part I

Send Command / Process to Back Ground From Terminal

Here are the list of command to send a process or command to back ground from terminal

1) Press ctrl+z
2) Then type bg (bg means back ground)
3) Then type "disown"

To make sure process is running in back ground execute below command,
ps auxw | grep

Friday, April 3, 2015

#1 Mistake for Startup E-Commerce Web Sites

Contacting Manufacturers of Brand Names For Your Ecommerce Store

XML To JSON Converter

Have the following jars in the classpath,

 commons-beanutils-1.6.1.jar
 commons-collections-3.2.jar
 commons-lang-2.1.jar
 commons-logging-1.1.jar
 ezmorph-1.0.4.jar
 json-lib-2.3-jdk15.jar
 xom-1.0.jar

import net.sf.json.JSON;
import net.sf.json.xml.XMLSerializer;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;

public class XML2JSONConverter {
    public String convertXMLTOJSON(String inputXML) {
        String jsonString = "";
        try {
            JSON objJson = new XMLSerializer().read(inputXML);
            jsonString = objJson.toString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return jsonString;
    }

    static String convertStreamToString(java.io.InputStream is) {
        java.util.Scanner s = new java.util.Scanner(is).useDelimiter("\\A");
        return s.hasNext() ? s.next() : "";
    }

    public static void main(String[] args) throws Exception {
        File inputFile = new File("input xml file path");
        InputStream inputStreams = new FileInputStream(inputFile);
        XML2JSONConverter toJASON = new XML2JSONConverter();
        System.out.println("JASON Object:" + toJASON.convertXMLTOJSON(convertStreamToString(inputStreams)));
    }
}

Java InputStream to String Covertion

Found this small method to convert InputStream to String, This will help to avoid using Apache IOUtils etc.,

 static String convertStreamToString(java.io.InputStream is) {
        java.util.Scanner s = new java.util.Scanner(is).useDelimiter("\\A");
        return s.hasNext() ? s.next() : "";
    }