<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;C0UFQX05cCp7ImA9WhRRFEk.&quot;"><id>tag:blogger.com,1999:blog-6992383079306108004</id><updated>2011-11-27T16:46:50.328-08:00</updated><category term="ERP" /><category term="agile" /><category term="agility" /><category term="enterprise" /><title>System Development Technology</title><subtitle type="html" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://dev-tech.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://dev-tech.blogspot.com/" /><author><name>I Wayan Widi Pradnyana</name><uri>http://www.blogger.com/profile/14095407453844606111</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://bp0.blogger.com/_Yab3i39qvd0/SHTGoTZ9NYI/AAAAAAAAACk/aBOQx4nB1Ug/S220/307596200l.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/SoftwareDevelopmentTechnology" /><feedburner:info uri="softwaredevelopmenttechnology" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;Ck4DQ304eSp7ImA9Wx9aEk0.&quot;"><id>tag:blogger.com,1999:blog-6992383079306108004.post-4808086106809541220</id><published>2011-03-03T17:09:00.000-08:00</published><updated>2011-03-03T17:09:32.331-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-03T17:09:32.331-08:00</app:edited><title>Binary file producing with REST</title><content type="html">Now I would like to share my experience about generating binary content with REST.&lt;br /&gt;
This is just a simple example. The focus is on using StreamingOutput API.&lt;br /&gt;
Below is the sample source for providing zip file from http request.&lt;br /&gt;
&lt;pre class="prettyprint lang-html"&gt;package com.test;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URL;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.StreamingOutput;

import org.apache.commons.io.IOUtils;



@Path("/zipfileservice/")
public class ZipService {

&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;@GET
&amp;nbsp;&amp;nbsp; &amp;nbsp;@Path("/helloWorld/{caller}/") 
&amp;nbsp;&amp;nbsp; &amp;nbsp;@Produces("application/text")
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;public String helloWorld(String caller) throws Exception{
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;return "Hello";
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;@GET
&amp;nbsp;&amp;nbsp; &amp;nbsp;@Path("/helloWorldZip/{caller}/") 
&amp;nbsp;&amp;nbsp; &amp;nbsp;@Produces("application/zip")
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;public StreamingOutput helloWorldZip(String caller) throws Exception{
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;return new StreamingOutput(){

&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;@Override
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;public void write(OutputStream arg0) throws IOException, WebApplicationException {
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;// TODO Auto-generated method stub
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;BufferedOutputStream bus = new BufferedOutputStream(arg0);
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;try {
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;//ByteArrayInputStream reader &amp;nbsp;= (ByteArrayInputStream) Thread.currentThread().getContextClassLoader().getResourceAsStream();&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;//byte[] input = new byte[2048];&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;URL uri = Thread.currentThread().getContextClassLoader().getResource("");
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;File file = new File(uri.getPath()+File.separator+"WHATSNEW.zip");
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;FileInputStream fizip = new FileInputStream(file);
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;byte[] buffer2 = IOUtils.toByteArray(fizip);
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;bus.write(buffer2);
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;} catch (Exception e) {
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;// TODO Auto-generated catch block
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;e.printStackTrace();
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;}
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;}
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;};
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}
}
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6992383079306108004-4808086106809541220?l=dev-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/fTv0GU8B_1HuwszVRSCwBiflE68/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fTv0GU8B_1HuwszVRSCwBiflE68/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/fTv0GU8B_1HuwszVRSCwBiflE68/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fTv0GU8B_1HuwszVRSCwBiflE68/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SoftwareDevelopmentTechnology/~4/POeh2qS1G3g" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dev-tech.blogspot.com/feeds/4808086106809541220/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6992383079306108004&amp;postID=4808086106809541220" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6992383079306108004/posts/default/4808086106809541220?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6992383079306108004/posts/default/4808086106809541220?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SoftwareDevelopmentTechnology/~3/POeh2qS1G3g/binary-file-producing-with-rest.html" title="Binary file producing with REST" /><author><name>I Wayan Widi Pradnyana</name><uri>http://www.blogger.com/profile/14095407453844606111</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://bp0.blogger.com/_Yab3i39qvd0/SHTGoTZ9NYI/AAAAAAAAACk/aBOQx4nB1Ug/S220/307596200l.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://dev-tech.blogspot.com/2011/03/binary-file-producing-with-rest.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0YCR3o5eCp7ImA9Wx5TFks.&quot;"><id>tag:blogger.com,1999:blog-6992383079306108004.post-2518577454989958834</id><published>2010-08-01T06:26:00.000-07:00</published><updated>2010-08-01T06:26:06.420-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-01T06:26:06.420-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="agility" /><category scheme="http://www.blogger.com/atom/ns#" term="agile" /><category scheme="http://www.blogger.com/atom/ns#" term="enterprise" /><title>Enterprise Agility</title><content type="html">Good article about enterprise agility . Check it &lt;a href="http://bradapp.blogspot.com/2006/05/business-agility-defined.html"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6992383079306108004-2518577454989958834?l=dev-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/H66SZciIqy_be0G_3K8sz8BteHI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/H66SZciIqy_be0G_3K8sz8BteHI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/H66SZciIqy_be0G_3K8sz8BteHI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/H66SZciIqy_be0G_3K8sz8BteHI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SoftwareDevelopmentTechnology/~4/oi9vlLxkYeo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dev-tech.blogspot.com/feeds/2518577454989958834/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6992383079306108004&amp;postID=2518577454989958834" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6992383079306108004/posts/default/2518577454989958834?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6992383079306108004/posts/default/2518577454989958834?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SoftwareDevelopmentTechnology/~3/oi9vlLxkYeo/enterprise-agility.html" title="Enterprise Agility" /><author><name>I Wayan Widi Pradnyana</name><uri>http://www.blogger.com/profile/14095407453844606111</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://bp0.blogger.com/_Yab3i39qvd0/SHTGoTZ9NYI/AAAAAAAAACk/aBOQx4nB1Ug/S220/307596200l.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://dev-tech.blogspot.com/2010/08/enterprise-agility.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEcARnw4eip7ImA9WxFTGE8.&quot;"><id>tag:blogger.com,1999:blog-6992383079306108004.post-5924847188857703628</id><published>2010-04-09T08:11:00.000-07:00</published><updated>2010-04-09T08:14:07.232-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-09T08:14:07.232-07:00</app:edited><title>Schema parsing using XSOM</title><content type="html">Here are references for parsing XML schema. &lt;a href="http://it.toolbox.com/blogs/enterprise-web-solutions/parsing-an-xsd-schema-in-java-32565"&gt;Here&lt;/a&gt; and &lt;a href="http://fupeg.blogspot.com/2006/12/xml-schema-parsing.html"&gt;here &lt;/a&gt;&lt;br /&gt;Wooh, its been long time ago, parsing schema things.&lt;br /&gt;Hope you're enjoy in this cafe ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6992383079306108004-5924847188857703628?l=dev-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2jhEhJeeKNJ7pj5w9sg7XENw30U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2jhEhJeeKNJ7pj5w9sg7XENw30U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/2jhEhJeeKNJ7pj5w9sg7XENw30U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2jhEhJeeKNJ7pj5w9sg7XENw30U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SoftwareDevelopmentTechnology/~4/mLJ5TZez-u4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dev-tech.blogspot.com/feeds/5924847188857703628/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6992383079306108004&amp;postID=5924847188857703628" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6992383079306108004/posts/default/5924847188857703628?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6992383079306108004/posts/default/5924847188857703628?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SoftwareDevelopmentTechnology/~3/mLJ5TZez-u4/schema-parsing-using-xsom.html" title="Schema parsing using XSOM" /><author><name>I Wayan Widi Pradnyana</name><uri>http://www.blogger.com/profile/14095407453844606111</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://bp0.blogger.com/_Yab3i39qvd0/SHTGoTZ9NYI/AAAAAAAAACk/aBOQx4nB1Ug/S220/307596200l.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://dev-tech.blogspot.com/2010/04/schema-parsing-using-xsom.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEYDRHozeyp7ImA9WBFQFks.&quot;"><id>tag:blogger.com,1999:blog-6992383079306108004.post-570626702783716106</id><published>2007-03-11T17:56:00.000-07:00</published><updated>2007-03-11T19:22:55.483-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-03-11T19:22:55.483-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ERP" /><title>ERP software selection</title><content type="html">Nowadays, mostly big companies use enterprise resource planning (ERP) software as it's center for information sources. There were many products kind of ERP available at software market.&lt;br /&gt;Company who wants to implement its ERP system should do selection process. Below is an simple article that can be used as guide how to select which ERP software are the best suitable for their system.&lt;br /&gt;Fetched from: http://www.softselect.com/enterprise_software_management/erp_comparison.htm&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6992383079306108004-570626702783716106?l=dev-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Dnc3TRrL0ExrUpWu9ToHJn1vV2k/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Dnc3TRrL0ExrUpWu9ToHJn1vV2k/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Dnc3TRrL0ExrUpWu9ToHJn1vV2k/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Dnc3TRrL0ExrUpWu9ToHJn1vV2k/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SoftwareDevelopmentTechnology/~4/8T368gosWHU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dev-tech.blogspot.com/feeds/570626702783716106/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6992383079306108004&amp;postID=570626702783716106" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6992383079306108004/posts/default/570626702783716106?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6992383079306108004/posts/default/570626702783716106?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SoftwareDevelopmentTechnology/~3/8T368gosWHU/erp-software-selection.html" title="ERP software selection" /><author><name>I Wayan Widi Pradnyana</name><uri>http://www.blogger.com/profile/14095407453844606111</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://bp0.blogger.com/_Yab3i39qvd0/SHTGoTZ9NYI/AAAAAAAAACk/aBOQx4nB1Ug/S220/307596200l.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://dev-tech.blogspot.com/2007/03/erp-software-selection.html</feedburner:origLink></entry></feed>

