<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Shad Aumann&#039;s Information Technology Leader &#187; Java</title>
	<atom:link href="http://blog.shadit.com/index.php/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.shadit.com</link>
	<description>Applying information technology as a business strategy multiplier.</description>
	<lastBuildDate>Tue, 19 Apr 2011 18:12:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Java Servlet Backend for Plupload</title>
		<link>http://blog.shadit.com/2010/10/28/java-servlet-plupload/</link>
		<comments>http://blog.shadit.com/2010/10/28/java-servlet-plupload/#comments</comments>
		<pubDate>Thu, 28 Oct 2010 23:37:15 +0000</pubDate>
		<dc:creator>Shad Aumann</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[browserplus]]></category>
		<category><![CDATA[dump.php plupload]]></category>
		<category><![CDATA[file management]]></category>
		<category><![CDATA[file upload]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[google gears]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[multiple]]></category>
		<category><![CDATA[Plupload]]></category>
		<category><![CDATA[plupload demo]]></category>
		<category><![CDATA[plupload java]]></category>
		<category><![CDATA[plupload java servlet]]></category>
		<category><![CDATA[Servlet]]></category>
		<category><![CDATA[silverlight]]></category>
		<category><![CDATA[upload]]></category>
		<category><![CDATA[upload files]]></category>

		<guid isPermaLink="false">http://blog.shadit.com/?p=228</guid>
		<description><![CDATA[I wanted to use a rich web upload client for a personal project, and in a search I found Plupload.  I am so impressed with Plupload!  You can configure a single upload widget, and it will automatically choose the best rich client technology supported by a client&#8217;s browser.  Who decides which rich client technology is [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to use a rich web upload client for a personal project, and in a search I found <a href="http://www.plupload.com/" target="_blank">Plupload</a>.  I am so impressed with Plupload!  You can configure a single upload widget, and it will automatically choose the best rich client technology supported by a client&#8217;s browser.  Who decides which rich client technology is best?  You do!  Plupload will use your prioritized list from the following choices: Flash, Gears, HTML 5, Silverlight, BrowserPlus, and HTML 4.  Did I mention Plupload is open source?  It does not get any better than this, folks!</p>
<p>For my project, I created a Java Servlet to receive the multi-part MIME POST request from Plupload.  My solution uses the <a href="http://commons.apache.org/fileupload/streaming.html" target="_blank">streaming API</a> from Apache Commons <a href="http://commons.apache.org/fileupload/" target="_blank">FileUpload</a>.  The nice thing about the streaming API is that your Servlet can receive files that are too large to fit into memory.</p>
<p><a title="Java Servlet Backend for Plupload" href="http://www.shadit.com/static/plupload.zip">Here is a link</a> to (a simplified version of) my implementation of a Java Servlet backend for Plupload.  The ZIP file contains the source code for the Servlet and a JSP dump page that fulfills the same function as the dump.php PHP page that comes with the Plupload distribution.  The Servlet I am sharing is at the demonstration level of quality; it is not the same implementation I would actually use for a real application.  But it is a good demonstration of how to handle the POST from Plupload.  Some of my thoughts on using the Servlet include:</p>
<ol>
<li>By default, the Servlet saves the uploaded files to the web application server&#8217;s temp directory.</li>
<li>Change the package for the Servlet class.  It is currently set to &#8220;shadhome&#8221;.</li>
<li>Add an entry in your web.xml configuration for the servlet.  The URL that you configure in your web.xml will be the same one you should configure for the page that is using Plupload.</li>
<li>For my project I have limited use for implementing the JSON responses that Plupload can accept, so that part is not very well represented.</li>
<li>Again, this is a demonstration level implementation.  Logging, exception handling, etc. are not well represented.</li>
</ol>
<p>One final thought: technically this demonstration Servlet would handle saving files from any multi-part MIME POST request (not just from Plupload).</p>
<p>Drop me a note if you end up using this Servlet, or if you have any comments / questions.</p>
<p>UPDATE ON 2011-04-19: Lars has <a href="https://github.com/jakobadam/plupload/" target="_blank">shared his example</a> of a JSP that can receive the HTTP POST request from Plupload.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shadit.com/2010/10/28/java-servlet-plupload/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Javadoc WIN &#8211; Map.keySet()</title>
		<link>http://blog.shadit.com/2010/01/08/javadoc-win-map-keyset/</link>
		<comments>http://blog.shadit.com/2010/01/08/javadoc-win-map-keyset/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 17:45:14 +0000</pubDate>
		<dc:creator>Shad Aumann</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://blog.shadit.com/?p=136</guid>
		<description><![CDATA[This week, I was writing a class that implements the Set interface but uses a Map internally to track usage information about the contents of the Set.  I was implementing the removeAll() method, and wanted to use an Iterator over the Set returned by Map.keySet() in my method. My question was, will the remove() method [...]]]></description>
			<content:encoded><![CDATA[<p>This week, I was writing a class that implements the <tt>Set </tt> interface but uses a <tt>Map</tt> internally to track usage information about the contents of the <tt>Set</tt>.  I was implementing the <tt>removeAll()</tt> method, and wanted to use an <tt>Iterator</tt> over the <tt>Set </tt>returned by <tt>Map.keySet()</tt> in my method.</p>
<p>My question was, will the <tt>remove()</tt> method from an <tt>Iterator</tt> over a <tt>Set </tt>returned by <tt>Map.keySet()</tt> un-map the item from the underlying <tt>Map</tt>?</p>
<p><strong><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Map.html#keySet()" target="_blank">The answer</a> is yes!</strong></p>
<p style="padding-left: 30px;">The set  supports element removal, which removes the corresponding mapping from  the map, via the <tt>Iterator.remove</tt>, <tt>Set.remove</tt>,  <tt>removeAll</tt> <tt>retainAll</tt>, and <tt>clear</tt> operations.  It does not support the <tt>add</tt> or <tt>addAll</tt> operations.</p>
<p>That is some <em>fine</em> documentation, folks!  As developers on our own systems, we know that our peers can always look at the code and try to figure out what is going on.  But, having documentation that allows the clients of your class to easily answer questions is vastly superior to people regularly resorting to looking at your code.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shadit.com/2010/01/08/javadoc-win-map-keyset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.646 seconds -->

