<?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>Persönlicher Blog von Robert Erlinger &#187; JAVA</title>
	<atom:link href="http://blog.databyte.at/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.databyte.at</link>
	<description>Persönlicher Blog von Robert Erlinger</description>
	<lastBuildDate>Tue, 10 May 2011 14:21:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Mobile Web Development from Scratch</title>
		<link>http://blog.databyte.at/2010/03/mobile-web-development-from-scratch/</link>
		<comments>http://blog.databyte.at/2010/03/mobile-web-development-from-scratch/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 13:12:17 +0000</pubDate>
		<dc:creator>Robert Erlinger</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[FH Hagenberg]]></category>
		<category><![CDATA[hagenberg]]></category>
		<category><![CDATA[JAVA]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[Mobile Apps]]></category>
		<category><![CDATA[Nokia]]></category>

		<guid isPermaLink="false">http://blog.databyte.at/?p=186</guid>
		<description><![CDATA[Anbei meine Präsentation bei den Nokia Mobile Developer Forum @ FH Hagenberg vom 6.3.2010. Thema: &#8220;Mobile Web Development from Scratch am Beispiel Pressehandbuch&#8221;.
Mobile Web Development from Scratch
View more presentations from NokiaAppForumAlps.

]]></description>
			<content:encoded><![CDATA[<p>Anbei meine Präsentation bei den <a href="http://www.nokiaappforum.com/conference/" target="_blank">Nokia Mobile Developer Forum</a> @ FH Hagenberg vom 6.3.2010. Thema: &#8220;Mobile Web Development from Scratch am Beispiel Pressehandbuch&#8221;.</p>
<div style="width:425px" id="__ss_3350015"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/NokiaAppForumAlps/mobile-web-development-from-scratch-3350015" title="Mobile Web Development from Scratch">Mobile Web Development from Scratch</a></strong><object width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=mobilewebdevelopmentphb-100306053935-phpapp01&#038;stripped_title=mobile-web-development-from-scratch-3350015" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=mobilewebdevelopmentphb-100306053935-phpapp01&#038;stripped_title=mobile-web-development-from-scratch-3350015" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/NokiaAppForumAlps">NokiaAppForumAlps</a>.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.databyte.at/2010/03/mobile-web-development-from-scratch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSR-286: Caching, brauche ich das denn?</title>
		<link>http://blog.databyte.at/2009/03/jsr-286-caching-brauche-ich-das-denn/</link>
		<comments>http://blog.databyte.at/2009/03/jsr-286-caching-brauche-ich-das-denn/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 09:58:49 +0000</pubDate>
		<dc:creator>Robert Erlinger</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[jsr-286]]></category>
		<category><![CDATA[jsr286]]></category>
		<category><![CDATA[optimierung]]></category>
		<category><![CDATA[optimize]]></category>
		<category><![CDATA[sun]]></category>

		<guid isPermaLink="false">http://blog.databyte.at/?p=127</guid>
		<description><![CDATA[Das Thema Caching wird in der Praxis durch Entwickler leider sehr oft vernachlässigt. Viele Entwickler meinen, dass dies ein Thema des Betriebs sei. Doch genau diese Haltung bringt oft extreme Probleme im Betrieb einer Portalanwendung mit sich, die auch nicht durch eine Erweiterung von Hardware (mehr CPU, Hauptspeicher, etc.) erschlagen werden kann. Vielmehr muss der [...]]]></description>
			<content:encoded><![CDATA[<p>Das Thema Caching wird in der Praxis durch Entwickler leider sehr oft vernachlässigt. Viele Entwickler meinen, dass dies ein Thema des Betriebs sei. Doch genau diese Haltung bringt oft extreme Probleme im Betrieb einer Portalanwendung mit sich, die auch nicht durch eine Erweiterung von Hardware (mehr CPU, Hauptspeicher, etc.) erschlagen werden kann. Vielmehr muss der Entwickler der Anwendung selbst auf diverse Caching Mechanismen Rücksicht nehmen und diese in die eigene Anwendung integrieren. <a href="http://developers.sun.com/portalserver/reference/techart/jsr168/" target="_blank">JSR-286</a> soll das Thema Caching in der JAVA-Welt mehr in den Vordergrund rücken.</p>
<p>Natürlich bieten moderne Portalsysteme von Haus aus schon mitgelieferte Caching Möglichkeiten an, jedoch hat mit JSR-268 der Entwickler selbst schon einen ersten Angriffspunkt für Optimierungen.</p>
<p><strong>Links:</strong></p>
<ul>
<li><a href="http://developers.sun.com/portalserver/reference/techart/jsr168/" target="_blank">Introducing Java Portlet Specifications: JSR 168 and JSR 286</a></li>
<li><a href="http://blogs.sun.com/karthikks/entry/caching_in_jsr_286" target="_blank">http://blogs.sun.com/karthikks/entry/caching_in_jsr_286</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.databyte.at/2009/03/jsr-286-caching-brauche-ich-das-denn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaRebel</title>
		<link>http://blog.databyte.at/2009/03/javarebel/</link>
		<comments>http://blog.databyte.at/2009/03/javarebel/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 13:06:25 +0000</pubDate>
		<dc:creator>Robert Erlinger</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[Application Server]]></category>
		<category><![CDATA[Instrumentation API]]></category>
		<category><![CDATA[JavaRebel]]></category>
		<category><![CDATA[Tomcat]]></category>

		<guid isPermaLink="false">http://blog.databyte.at/?p=125</guid>
		<description><![CDATA[Welcher JAVA Entwickler kennt dieses Problem nicht: Änderungen an JAVA-Klassen durchführen, Build-Prozess durchlaufen lassen und die geänderten JAVA-Klassen in den Application Server deployen.
Abhilfe schafft das kommerzielle Tool JavaRebel, welches als JAR-File in den Application Server (z.B. Tomcat) deployed wird. Der Clou: Änderungen am Quellcode werden so in der laufenden Anwendung sofort und ohne Neustarten des [...]]]></description>
			<content:encoded><![CDATA[<p>Welcher JAVA Entwickler kennt dieses Problem nicht: Änderungen an JAVA-Klassen durchführen, Build-Prozess durchlaufen lassen und die geänderten JAVA-Klassen in den Application Server deployen.</p>
<p>Abhilfe schafft das kommerzielle Tool <a href="http://www.zeroturnaround.com/javarebel/" target="_blank">JavaRebel</a>, welches als JAR-File in den Application Server (z.B. Tomcat) deployed wird. Der Clou: Änderungen am Quellcode werden so in der laufenden Anwendung sofort und ohne Neustarten des Application Servers aktiv. Dies spart viel Zeit, Nerven und Geld beim Entwicklen von JAVA Anwendungen.</p>
<p>JavaRebel ist ab Java 5 einsetzbar, da das Tool die Instrumentation API (java.lang.instrument) verwendet, um kompilierten JAVA Klassen zu überwachen.</p>
<p><strong>Links:</strong></p>
<ul>
<li><a href="http://www.zeroturnaround.com/javarebel/" target="_blank">http://www.zeroturnaround.com/javarebel/</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.databyte.at/2009/03/javarebel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tipp: JavaDeus 2008 @ FH St. Pölten</title>
		<link>http://blog.databyte.at/2008/04/tipp-javadeus-2008-fh-st-polten/</link>
		<comments>http://blog.databyte.at/2008/04/tipp-javadeus-2008-fh-st-polten/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 19:53:16 +0000</pubDate>
		<dc:creator>Robert Erlinger</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[JAVA]]></category>
		<category><![CDATA[Seminare]]></category>

		<guid isPermaLink="false">http://blog.databyte.at/index.php/79</guid>
		<description><![CDATA[Am 19. Juni 2008 findet von 9:30 &#8211; 18:00 Uhr die von Sun initiierte Developer Konferenz an der FH St. Pölten statt. Die Teilnahme zu dieser Veranstaltung ist kostenlos. Ausklang findet diese mit einem Open Air Fest inkl. EM Live-Übertragung.
Nähere Informationen gibt es unter http://at.sun.com/sunnews/events/2008/jun/javadeus08/
]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.databyte.at/wp-content/uploads/2008/04/l2_javadeus.jpg" alt="l2_javadeus.jpg" />Am 19. Juni 2008 findet von 9:30 &#8211; 18:00 Uhr die von Sun initiierte Developer Konferenz an der FH St. Pölten statt. Die Teilnahme zu dieser Veranstaltung ist kostenlos. Ausklang findet diese mit einem Open Air Fest inkl. EM Live-Übertragung.</p>
<p>Nähere Informationen gibt es unter <a href="http://at.sun.com/sunnews/events/2008/jun/javadeus08/">http://at.sun.com/sunnews/events/2008/jun/javadeus08/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.databyte.at/2008/04/tipp-javadeus-2008-fh-st-polten/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New g4j &#8211; GMail API for Java released!</title>
		<link>http://blog.databyte.at/2007/11/new-g4j-gmail-api-for-java-released/</link>
		<comments>http://blog.databyte.at/2007/11/new-g4j-gmail-api-for-java-released/#comments</comments>
		<pubDate>Fri, 02 Nov 2007 23:48:50 +0000</pubDate>
		<dc:creator>Robert Erlinger</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://blog.databyte.at/index.php/59</guid>
		<description><![CDATA[          GMailer API for Java (g4j) is set of API that allows          Java programmer to communicate to GMail. With G4J programmers can made          Java based application that based [...]]]></description>
			<content:encoded><![CDATA[<p>          GMailer API for Java<strong> (g4j)</strong> is set of API that allows          Java programmer to communicate to GMail. With G4J programmers can made          Java based application that based on huge storage of GMail.</p>
<p><strong>See more:</strong></p>
<ul>
<li><a href="http://blog.databyte.at/wp-content/uploads/2007/11/g4j-0319.zip">Download the g4j-0.3.19 stable revision</a></li>
</ul>
<p><a href="http://g4j.sourceforge.net/" title="source-forge-logo.gif"><img src="http://blog.databyte.at/wp-content/uploads/2007/11/source-forge-logo.gif" alt="source-forge-logo.gif" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.databyte.at/2007/11/new-g4j-gmail-api-for-java-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse PlugIns</title>
		<link>http://blog.databyte.at/2007/09/eclipse-plugins/</link>
		<comments>http://blog.databyte.at/2007/09/eclipse-plugins/#comments</comments>
		<pubDate>Fri, 14 Sep 2007 11:41:24 +0000</pubDate>
		<dc:creator>Robert Erlinger</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[JAVA]]></category>

		<guid isPermaLink="false">http://blog.databyte.at/?p=42</guid>
		<description><![CDATA[EasyStruts
Project URL: http://easystruts.sourceforge.net/
Screenshots: http://easystruts.sourceforge.net/screenshots.html
Befindet sich leider noch in Refactoring Phase, Plugin ist im Moment nur für Eclipse 2.x verfügbar, für Version 3.x wird daran gearbeitet. 
StrutsIDE
Project URL: http://amateras.sourceforge.jp/cgi-bin/fswiki_en/wiki.cgi?page=StrutsIDE 
SysDEO Plugin
Project URL: http://www.eclipsetotale.com/tomcatPlugin.html


]]></description>
			<content:encoded><![CDATA[<p align="left"><strong>EasyStruts<br />
</strong>Project URL: <span class="nobr"><a rel="nofollow" href="http://easystruts.sourceforge.net/">http://easystruts.sourceforge.net/</a><br />
Screenshots: <span class="nobr"><a href="http://easystruts.sourceforge.net/screenshots.html">http://easystruts.sourceforge.net/screenshots.html</a></span></span></p>
<p><span class="nobr"><span class="nobr">Befindet sich leider noch in Refactoring Phase, Plugin ist im Moment nur für Eclipse 2.x verfügbar, für Version 3.x wird daran gearbeitet.</span></span><span class="nobr"><span class="nobr"> </span></span><span class="nobr"><span class="nobr"></p>
<p align="left"><strong>StrutsIDE</strong><br />
Project URL: <span class="nobr"><a rel="nofollow" href="http://amateras.sourceforge.jp/cgi-bin/fswiki_en/wiki.cgi?page=StrutsIDE ">http://amateras.sourceforge.jp/cgi-bin/fswiki_en/wiki.cgi?page=StrutsIDE </a></p>
<p align="left"><strong>SysDEO Plugin</strong><br />
Project URL: <span class="nobr"><a rel="nofollow" href="http://www.eclipsetotale.com/tomcatPlugin.html">http://www.eclipsetotale.com/tomcatPlugin.html</a></span></p>
<p></span></p>
<p></span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.databyte.at/2007/09/eclipse-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bug in Apache Roller 2.1 with some newer JDBC Connectors</title>
		<link>http://blog.databyte.at/2007/08/bug-in-apache-roller-21-with-some-newer-jdbc-connectors/</link>
		<comments>http://blog.databyte.at/2007/08/bug-in-apache-roller-21-with-some-newer-jdbc-connectors/#comments</comments>
		<pubDate>Thu, 09 Aug 2007 20:51:30 +0000</pubDate>
		<dc:creator>Robert Erlinger</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[JAVA]]></category>

		<guid isPermaLink="false">http://blog.databyte.at/?p=23</guid>
		<description><![CDATA[Es gibt einen bekannten Bug bezüglich Connector/J 3.1.12 und MySQL 4.1, Details hierzu von Roller:
For MySQL 4.1.X users, we recommend that you use the J/Connector 3.0.X JDBC drivers instead of the newer 3.1.X series. If you must use J/Connector/J 3.1.X then please read Installation FAQ page item #13 on the Roller wiki.
Help! I&#8217;m seeing &#8220;You [...]]]></description>
			<content:encoded><![CDATA[<p>Es gibt einen bekannten Bug bezüglich Connector/J 3.1.12 und MySQL 4.1, Details hierzu von Roller:</p>
<p>For MySQL 4.1.X users, we recommend that you use the J/Connector 3.0.X JDBC drivers instead of the newer 3.1.X series. If you must use J/Connector/J 3.1.X then please read Installation FAQ page item #13 on the Roller wiki.</p>
<p>Help! I&#8217;m seeing &#8220;You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#8216;?&#8217; at line 1&#8243; [#13]</p>
<p>This appears to be due to a MySQL and Connector/J bug that occurs if you use the MySQL 4.1.X server with Connector/J 3.1.X drivers. We recommend that you use the Connector/J 3.0.16 (or later 3.0.X series) drivers with MySQL 4.1.X to avoid this. You can download them from the MySQL site. Drop the jar in your CATALINA_HOME/common/lib and remove any 3.1.X drivers that you have there.</p>
<p>An alternate workaround that will allow you to keep the Connector/J 3.1.X drivers is to disable use of server-side prepared statements by setting the additional property useServerPrepStmts=false in both of the MySQL JDBC URLs in the context configuration.</p>
<p>Roller user Lee Gwun Wai has reported on the roller-user mailing list that this can also occur in the typical ISP-hosted situation where one&#8217;s database is using UTF-8 but the overall server character set is something other than UTF-8. He suggests dropping the useUnicode=true from all JDBC URLs. There is additional information on hosted database configuration on our MySQL i18n Configuration Page. We have still only seen this reported with the Connector/J 3.1.X drivers.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.databyte.at/2007/08/bug-in-apache-roller-21-with-some-newer-jdbc-connectors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yellow Belt on javablackbelt.com</title>
		<link>http://blog.databyte.at/2007/07/yellow-belt-on-javablackbeltcom/</link>
		<comments>http://blog.databyte.at/2007/07/yellow-belt-on-javablackbeltcom/#comments</comments>
		<pubDate>Thu, 26 Jul 2007 14:25:03 +0000</pubDate>
		<dc:creator>Robert Erlinger</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[JAVA]]></category>

		<guid isPermaLink="false">http://blog.databyte.at/?p=20</guid>
		<description><![CDATA[Today I successfully finished the following exams with the yellow belt on javablackbelt.com:

 												OO for Java &#8211; Basic
 												Java SE &#8211; Basic


]]></description>
			<content:encoded><![CDATA[<p>Today I successfully finished the following exams with the yellow belt on javablackbelt.com:</p>
<ul>
<li> 												OO for Java &#8211; Basic</li>
<li> 												Java SE &#8211; Basic</li>
</ul>
<p><img src="http://www.javablackbelt.com/imgs/level/belt1_L.gif" title="yellow belt" alt="yellow belt" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.databyte.at/2007/07/yellow-belt-on-javablackbeltcom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java &#8211; call by value</title>
		<link>http://blog.databyte.at/2007/07/java-call-by-value/</link>
		<comments>http://blog.databyte.at/2007/07/java-call-by-value/#comments</comments>
		<pubDate>Tue, 24 Jul 2007 13:40:04 +0000</pubDate>
		<dc:creator>Robert Erlinger</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[JAVA]]></category>

		<guid isPermaLink="false">http://blog.databyte.at/?p=18</guid>
		<description><![CDATA[Im Gegensatz zu anderen Programmiersprachen wie z.B. Pascal oder C++ arbeitet Java mit der Methode &#8220;call by value&#8221;. Dies funktioniert folgendermaßen:
JAVA-Code: 

	public class Test3 {
		public static void main(String [] args)
		{
			int i = 0;

			Point pnt = new Point(1, 1);
			System.out.println("X: " + pnt.getX());
			System.out.println("Y: " + pnt.getY());
			System.out.println("i: " + i);
			changeValues(pnt);
			changeInt(i);
			System.out.println("X: " + pnt.getX());
			System.out.println("Y: " + pnt.getY());
			System.out.println("i: " + [...]]]></description>
			<content:encoded><![CDATA[<p>Im Gegensatz zu anderen Programmiersprachen wie z.B. Pascal oder C++ arbeitet Java mit der Methode &#8220;call by value&#8221;. Dies funktioniert folgendermaßen:</p>
<p><strong>JAVA-Code: </strong></p>
<pre>
	public class Test3 {
		public static void main(String [] args)
		{
			int i = 0;

			Point pnt = new Point(1, 1);
			System.out.println("X: " + pnt.getX());
			System.out.println("Y: " + pnt.getY());
			System.out.println("i: " + i);
			changeValues(pnt);
			changeInt(i);
			System.out.println("X: " + pnt.getX());
			System.out.println("Y: " + pnt.getY());
			System.out.println("i: " + i);
		}

		private static void changeValues(Point pnt) {
			pnt.setX(5);
			pnt.setY(5);
		}

		private static void changeInt(int i) {

			i = 666;

		}
	}</pre>
<p><strong>Ausgabe:</strong></p>
<pre>
	X: 1
	Y: 1
	i: 0
	X: 5
	Y: 5
	i: 0</pre>
<p>Wird in JAVA ein neues Objekt erstellt, dann wird das Objekt an und für sich im HEAP abgelegt, die Referenz auf dieses Objekt wird dabei im Stack erstellt und zeigt auf das Objekt im HEAP.</p>
<p>z.B.</p>
<pre>
	Point pnt = new Point(1, 1);</pre>
<p>&#8220;pnt&#8221; wäre dann die Referenz auf das Objekt.</p>
<p>Wenn nun &#8220;pnt&#8221; einer Methode übergeben wird, wird intern in JAVA &#8220;Call-by-value&#8221; angewendet, das bedeutet aber nicht, dass hier das komplette Objekt &#8220;kopiert&#8221; wird, sondern <strong>nur</strong>(!) die Referenz auf das Objekt. Im ersten Eindruck könnte man glauben, dass es sich hierbei um &#8220;Call-by-Reference&#8221; handelt, stimmt aber nicht, da ja die Referenz auf das Objekt &#8220;kopiert&#8221; wird und die alte Referenz (also jene außerhalb der Methode) erhalten bleibt. Somit gibt es nach dem Methodenaufruf 2 unterschiedliche Referenzen auf ein und dasselbe Objekt. Die Referenzen werden im STACK-Speicher abgelegt und zeigen auf das Objekt, welches sich im HEAP-Speicher befindet.</p>
<p><strong>Nun so gut, aber wie ist das mit primitiven Datentypen ála int, char, String, etc.?</strong><br />
Primitive Datentypen sind in JAVA an und für sich keine Objekte und werden dadurch direkt im STACK-Speicher der JVM abgelegt. Dadruch existieren auch keine Referenzen auf irgendein Objekt.</p>
<p><strong> Was passiert nun bei Parameterübergabe einer Methode?</strong><br />
Hier wird wieder, wie überall in JAVA, &#8220;Call-by-value&#8221; angewendet. Da es bei den primitiven Datentypen keine Referenzen auf Objekte gibt, werden die Werte der Variablen direkt im Stack für die aufzurufende Methode kopiert. Dh. die neuen Werte sind nur innerhalb der Methode gültig.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.databyte.at/2007/07/java-call-by-value/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generate filename for uploaded file in JAVA</title>
		<link>http://blog.databyte.at/2007/07/generate-filename-for-uploaded-file-in-java/</link>
		<comments>http://blog.databyte.at/2007/07/generate-filename-for-uploaded-file-in-java/#comments</comments>
		<pubDate>Tue, 17 Jul 2007 11:20:27 +0000</pubDate>
		<dc:creator>Robert Erlinger</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.databyte.at/?p=17</guid>
		<description><![CDATA[    /**
     * Takes the original file name's suffix and generated a new random file name with the oringial file suffix.
     * @param oldFileName The original file name of the uploaed file.
     * @return String The generated new random file [...]]]></description>
			<content:encoded><![CDATA[<pre>    /**
     * Takes the original file name's suffix and generated a new random file name with the oringial file suffix.
     * @param oldFileName The original file name of the uploaed file.
     * @return String The generated new random file name.
     */
    private String convertFileName(String originalFileName) {

    	// Get the extension (suffix) of the original file name.
    	originalFileName = originalFileName.trim();

        //... Find the position of the last dot.  Get extension.
        int dotPos = originalFileName.lastIndexOf(".");
        String extension = originalFileName.substring(dotPos);

    	Random random = new Random((new Date()).getTime());
    	String fileName =  "uploadfile_" + generateRandomStringForFileName(8) + Math.abs(random.nextInt()) + extension;
    	return fileName;
    }

    /**
     * Generates a random string.
     * @param length The length of the random string.
     * @return The generated random string.
     */
    private static String generateRandomStringForFileName (int length) {
    	String randomString = "";
    	for (int i=0; i&lt;length; i++) {
    		randomString += generateRandomCharForFileName();
    	}
    	return randomString;
    }

    /**
     * Generates a random character for the file name.
     * @return char Returns a random character.
     */
    private static char generateRandomCharForFileName() {
    	int zuf = generateRandomIntForFileName(25);
   		zuf += 97;
   		return ((char)zuf);
    }

    /**
     * Generates a random int.
     * @param max The maximum number for the character.
     * @return int
     */
    public static int generateRandomIntForFileName(int max){
    	int number;
    	Random generate = new Random();
    	number = generate.nextInt(max);
    	return number;
    }</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.databyte.at/2007/07/generate-filename-for-uploaded-file-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

