Friday, April 3, 2015
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)));
}
}
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() : "";
}
static String convertStreamToString(java.io.InputStream is) {
java.util.Scanner s = new java.util.Scanner(is).useDelimiter("\\A");
return s.hasNext() ? s.next() : "";
}
Wednesday, February 18, 2015
EP 128 The 12 Step Plan for Creating a Rich Life with Nicole Lapin - SoundCloud
https://soundcloud.com/lewishowes/nicole-lapin
Friday, February 13, 2015
Thursday, February 12, 2015
Thursday, February 5, 2015
My Experience Talk:What I learnt from a year of start up experience
Sirish Reddy Gongal Reddy has sent you a link to a blog:
Blog: My Experience Talk
Post: What I learnt from a year of start up experience
Link: http://www.myexperiencetalk.com/2014/10/what-i-learnt-from-year-of-start-up.html
--
Powered by Blogger
http://www.blogger.com/
Blog: My Experience Talk
Post: What I learnt from a year of start up experience
Link: http://www.myexperiencetalk.com/2014/10/what-i-learnt-from-year-of-start-up.html
--
Powered by Blogger
http://www.blogger.com/
Wednesday, January 7, 2015
Sterling Integrator Purge All Tables
1. EDI_COMPLIANCE_RPT
2. EDI_DOCUMENT_STATE
3. WF_INST_S
4. WORKFLOW_CONTEXT
5. WORKFLOW_LIFESPAN
6. WORKFLOW_DATA
7. EDIINTDOC
8. MSGMDNDUP
9. MSGMDNCORRELATION
10. WEBX_MINED_DATA
11. WF_INACTIVE
12. GENERIC_ACK
13. CORRELATION_SET
14. ACT_SESSION
15. ACT_AUTHENTICATE
16. ACT_AUTHORIZE
17. ACT_XFER
18. ACT_NON_XFER
19. DATA_FLOW
20. DMI_ROUTE
21. DMI_ROUTE_FACT
22. MBX_MESSAGE
23. TRANS_DATA
2. EDI_DOCUMENT_STATE
3. WF_INST_S
4. WORKFLOW_CONTEXT
5. WORKFLOW_LIFESPAN
6. WORKFLOW_DATA
7. EDIINTDOC
8. MSGMDNDUP
9. MSGMDNCORRELATION
10. WEBX_MINED_DATA
11. WF_INACTIVE
12. GENERIC_ACK
13. CORRELATION_SET
14. ACT_SESSION
15. ACT_AUTHENTICATE
16. ACT_AUTHORIZE
17. ACT_XFER
18. ACT_NON_XFER
19. DATA_FLOW
20. DMI_ROUTE
21. DMI_ROUTE_FACT
22. MBX_MESSAGE
23. TRANS_DATA
Tuesday, January 6, 2015
Sunday, November 9, 2014
Startup Notes
Here are the some notes
out of many Start-up entrepreneurs interviews and from their failed stories...
- Every start-up savvy must read all the articles listed
here http://www.paulgraham.com/articles.html
- thehackernews.com or Google it on hacker news.... Post
the product / idea here and get the early feed back and work on it.
- Try out and fail..
- Never work in isolation, Do frequent release of the
product have early user access and pay attention to users feedback. It's
okey to be crappy but fix the damn thing.
- Research the idea in targeted market segment.
- Getting priorities right..Logo is not important :)
Build and Ship.
- Write content and share with right audience and market
your self.
- Customer feedback is extremely important. Let them talk
and listen to them.
How do you turn your mind into the type that
startup ideas form in unconsciously?
(1) Learn a lot about things that matter, then
(2) work on problems that interest you
(3) with people you like and respect. The third part, incidentally, is how you get co-founders at the same time as the idea.
(4) Look for a Startup Mentor, You need one who can guide you in all aspects right from Decisions, Marketing and Customer handling etc..
Thursday, November 6, 2014
Free SSL Certificate (Class1)
http://www.startssl.com/ is good place to get a Class1 SSL Certificate for FREE!!. One User for One Year.
Thursday, October 30, 2014
Subscribe to:
Posts (Atom)