<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1891246178551476682</id><updated>2024-09-20T16:23:32.352+05:30</updated><title type='text'>JavaFX, PHP ,IT Technologies By Prakash</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://prakasv.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1891246178551476682/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://prakasv.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Prakash</name><uri>http://www.blogger.com/profile/12000903947892917697</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1891246178551476682.post-8752542315252476742</id><published>2011-09-12T13:08:00.002+05:30</published><updated>2011-09-13T14:44:30.844+05:30</updated><title type='text'>Java Single Application Instance</title><content type='html'>/**&lt;br /&gt;*&lt;br /&gt;* @author&lt;br /&gt;*&lt;br /&gt;* V Prakash&lt;br /&gt;*&lt;br /&gt;* Software Engineer&lt;br /&gt;*&lt;br /&gt;*&lt;br /&gt;*&lt;br /&gt;*/&lt;br /&gt;import java.net.ServerSocket;&lt;br /&gt;import javax.swing.JOptionPane;&lt;br /&gt;import javax.swing.JFrame;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.net.BindException;&lt;br /&gt;&lt;br /&gt;public class SingleInstance&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;public static ServerSocket serverSocket;&lt;br /&gt;public static String errortype = &quot;Access Error&quot;;&lt;br /&gt;public static String error = &quot;Application already running.....&quot;;&lt;br /&gt;public static void main(String as[])&lt;br /&gt;{&lt;br /&gt;try{&lt;br /&gt;//creating object of server socket and bind to some port number&lt;br /&gt;serverSocket = new ServerSocket(16892);&lt;br /&gt;&lt;br /&gt;//do not put common port number like 80,8080,8081 etc.&lt;br /&gt;//Because they are already used by system&lt;br /&gt;&lt;br /&gt;JFrame jf = new JFrame();&lt;br /&gt;jf.setVisible(true);&lt;br /&gt;jf.setSize(200, 200);&lt;br /&gt;}&lt;br /&gt;catch (BindException exc){&lt;br /&gt;JOptionPane.showMessageDialog(null,error,errortype,JOptionPane.ERROR_MESSAGE);&lt;br /&gt;System.exit(0);&lt;br /&gt;}&lt;br /&gt;catch (IOException exc){&lt;br /&gt;JOptionPane.showMessageDialog(null, error, errortype, JOptionPane.ERROR_MESSAGE);&lt;br /&gt;System.exit(0);&lt;br /&gt;}&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;!-- &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;                                                 A single instance application is one that only allows for 1  of the application to run no matter how many times the user tries to  launch.  Windows and linux native applications have an API to detect the  instance of an application but when in Java, it is not quite as easy or  reliable.  To complicate matters, often times the requirement will be  for the original application instance to react in some way to the  launch, as in bringing the window to the front, opening a file or  displaying a message.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;Fortunately it&#39;s not all that difficult to  code this if you know the trick.  In this article I&#39;ll give you all the  code you need to copy and paste into your application to make it single  instance.  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt; I&#39;ve seen suggestions to use files as a cross-instance lock, but that is  unreliable as application crashes and other IO errors may not allow for  the file to be cleaned up.  The better solution in my opinion is to use  a local server socket.  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;This code example works by having the  first instance attempt to open a listening socket on the localhost  interface.  If it&#39;s able to open the socket, it is assumed that this is  the first instance of the application to be launched.  If not, the  assumption is that an instance of this application is already running.   The new instance must notify the existing instance that a launch was  attempted, then exit.  The existing instance takes over after receiving  the notification and fires an event to the listener that handles the  action.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;For security, I added a shared key that is used between  the sender the receiver.  In my implementation, the only constraint is  that it must end with a newline character.  That was just for ease of  coding.  The imports are all in java.io or java.net.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;color: rgb(255, 0, 0);&quot; class=&quot;code&quot;&gt;public class ApplicationInstanceManager {&lt;br /&gt;&lt;br /&gt;  private static ApplicationInstanceListener subListener;&lt;br /&gt;&lt;br /&gt;  /** Randomly chosen, but static, high socket number */&lt;br /&gt;  public static final int SINGLE_INSTANCE_NETWORK_SOCKET = 44331;&lt;br /&gt;&lt;br /&gt;  /** Must end with newline */&lt;br /&gt;  public static final String SINGLE_INSTANCE_SHARED_KEY = &quot;$$NewInstance$$\n&quot;;&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * Registers this instance of the application.&lt;br /&gt;   *&lt;br /&gt;   * @return true if first instance, false if not.&lt;br /&gt;   */&lt;br /&gt;  public static boolean registerInstance() {&lt;br /&gt;      // returnValueOnError should be true if lenient (allows app to run on network error) or false if strict.&lt;br /&gt;      boolean returnValueOnError = true;&lt;br /&gt;      // try to open network socket&lt;br /&gt;      // if success, listen to socket for new instance message, return true&lt;br /&gt;      // if unable to open, connect to existing and send new instance message, return false&lt;br /&gt;      try {&lt;br /&gt;          final ServerSocket socket = new ServerSocket(SINGLE_INSTANCE_NETWORK_SOCKET, 10, InetAddress&lt;br /&gt;                  .getLocalHost());&lt;br /&gt;          log.debug(&quot;Listening for application instances on socket &quot; + SINGLE_INSTANCE_NETWORK_SOCKET);&lt;br /&gt;          Thread instanceListenerThread = new Thread(new Runnable() {&lt;br /&gt;              public void run() {&lt;br /&gt;                  boolean socketClosed = false;&lt;br /&gt;                  while (!socketClosed) {&lt;br /&gt;                      if (socket.isClosed()) {&lt;br /&gt;                          socketClosed = true;&lt;br /&gt;                      } else {&lt;br /&gt;                          try {&lt;br /&gt;                              Socket client = socket.accept();&lt;br /&gt;                              BufferedReader in = new BufferedReader(new InputStreamReader(client.getInputStream()));&lt;br /&gt;                              String message = in.readLine();&lt;br /&gt;                              if (SINGLE_INSTANCE_SHARED_KEY.trim().equals(message.trim())) {&lt;br /&gt;                                  log.debug(&quot;Shared key matched - new application instance found&quot;);&lt;br /&gt;                                  fireNewInstance();&lt;br /&gt;                              }&lt;br /&gt;                              in.close();&lt;br /&gt;                              client.close();&lt;br /&gt;                          } catch (IOException e) {&lt;br /&gt;                              socketClosed = true;&lt;br /&gt;                          }&lt;br /&gt;                      }&lt;br /&gt;                  }&lt;br /&gt;              }&lt;br /&gt;          });&lt;br /&gt;          instanceListenerThread.start();&lt;br /&gt;          // listen&lt;br /&gt;      } catch (UnknownHostException e) {&lt;br /&gt;          log.error(e.getMessage(), e);&lt;br /&gt;          return returnValueOnError;&lt;br /&gt;      } catch (IOException e) {&lt;br /&gt;          log.debug(&quot;Port is already taken.  Notifying first instance.&quot;);&lt;br /&gt;          try {&lt;br /&gt;              Socket clientSocket = new Socket(InetAddress.getLocalHost(), SINGLE_INSTANCE_NETWORK_SOCKET);&lt;br /&gt;              OutputStream out = clientSocket.getOutputStream();&lt;br /&gt;              out.write(SINGLE_INSTANCE_SHARED_KEY.getBytes());&lt;br /&gt;              out.close();&lt;br /&gt;              clientSocket.close();&lt;br /&gt;              log.debug(&quot;Successfully notified first instance.&quot;);&lt;br /&gt;              return false;&lt;br /&gt;          } catch (UnknownHostException e1) {&lt;br /&gt;              log.error(e.getMessage(), e);&lt;br /&gt;              return returnValueOnError;&lt;br /&gt;          } catch (IOException e1) {&lt;br /&gt;              log.error(&quot;Error connecting to local port for single instance notification&quot;);&lt;br /&gt;              log.error(e1.getMessage(), e1);&lt;br /&gt;              return returnValueOnError;&lt;br /&gt;          }&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;      return true;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public static void setApplicationInstanceListener(ApplicationInstanceListener listener) {&lt;br /&gt;      subListener = listener;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  private static void fireNewInstance() {&lt;br /&gt;    if (subListener != null) {&lt;br /&gt;      subListener.newInstanceCreated();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public interface ApplicationInstanceListener {&lt;br /&gt;  public void newInstanceCreated();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class MyApplication {&lt;br /&gt;  public static void main(String[] args) {&lt;br /&gt;      if (!ApplicationInstanceManager.registerInstance()) {&lt;br /&gt;                  // instance already running.&lt;br /&gt;                  System.out.println(&quot;Another instance of this application is already running.  Exiting.&quot;);&lt;br /&gt;                  System.exit(0);&lt;br /&gt;     }&lt;br /&gt;      ApplicationInstanceManager.setApplicationInstanceListener(new ApplicationInstanceListener() {&lt;br /&gt;          public void newInstanceCreated() {&lt;br /&gt;              System.out.println(&quot;New instance detected...&quot;);&lt;br /&gt;              // this is where your handler code goes...&lt;br /&gt;          }&lt;br /&gt;      });&lt;br /&gt;  }&lt;br /&gt;}&lt;/div&gt;&lt;br /&gt;--&gt;</content><link rel='replies' type='application/atom+xml' href='http://prakasv.blogspot.com/feeds/8752542315252476742/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prakasv.blogspot.com/2011/09/java-single-application-instance.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1891246178551476682/posts/default/8752542315252476742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1891246178551476682/posts/default/8752542315252476742'/><link rel='alternate' type='text/html' href='http://prakasv.blogspot.com/2011/09/java-single-application-instance.html' title='Java Single Application Instance'/><author><name>Prakash</name><uri>http://www.blogger.com/profile/12000903947892917697</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1891246178551476682.post-7678813767619021895</id><published>2011-08-09T14:08:00.002+05:30</published><updated>2011-08-09T14:13:05.995+05:30</updated><title type='text'>Features of Java 7.0</title><content type='html'>As Java 7.0 is ready to be released (on July 7th,2011), I would like to  post a couple of blogs with the new features of Java 7.0. There are  additions to language as well as library. I will  focus on both language enhancements and library enhancements in the  forth coming blogs.  &lt;p&gt;  In this blog, I am focusing on new features added to Java 7.0 under the project - &lt;strong&gt;Project Coin&lt;/strong&gt;, which contains small enhancements related to Java language.   &lt;/p&gt;&lt;ul&gt;&lt;li&gt; &lt;a href=&quot;http://www.srikanthtechnologies.com/blog/java/java7features.aspx#stringswithswitch&quot;&gt;Support for Strings in Switch&lt;/a&gt; &lt;/li&gt;&lt;li&gt; &lt;a href=&quot;http://www.srikanthtechnologies.com/blog/java/java7features.aspx#typeinference&quot;&gt;Improved Type Inference for Generic Instance Creation&lt;/a&gt; &lt;/li&gt;&lt;li&gt; &lt;a href=&quot;http://www.srikanthtechnologies.com/blog/java/java7features.aspx#arm&quot;&gt;Automatic Resource Management &lt;/a&gt; &lt;/li&gt;&lt;li&gt; &lt;a href=&quot;http://www.srikanthtechnologies.com/blog/java/java7features.aspx#il&quot;&gt;Binary integral literals and underscores in numeric literals&lt;/a&gt; &lt;/li&gt;&lt;li&gt; &lt;a href=&quot;http://www.srikanthtechnologies.com/blog/java/java7features.aspx#mc&quot;&gt;Multi-catch and more precise rethrow&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt;   &lt;h2&gt;Support for Strings in Switch &lt;/h2&gt; Starting from Java 7,  switch statement supports strings. It means you  can have a string as the expression in switch and compare it with  strings given in case statements. &lt;p&gt; Here is an example for a switch with String.  &lt;/p&gt;&lt;pre class=&quot;code&quot;&gt;import java.util.Scanner;&lt;br /&gt;&lt;br /&gt;// switch supports strings&lt;br /&gt;public class StringSwitch {&lt;br /&gt;  public static void main(String[] args) {&lt;br /&gt;    &lt;br /&gt;        Scanner s= new Scanner(System.in);&lt;br /&gt;        System.out.print(&quot;Enter the name of programming language you use : &quot;);&lt;br /&gt;        String lang = s.nextLine();   // read a line from keyboard&lt;br /&gt;       &lt;strong&gt; switch(lang)&lt;/strong&gt; {&lt;br /&gt;            case &quot;java&quot; :&lt;br /&gt;                System.out.println(&quot;Java Programmer&quot;); break;&lt;br /&gt;            case &quot;c#&quot; :&lt;br /&gt;                System.out.println(&quot;.Net Programmer&quot;); break;&lt;br /&gt;            case &quot;c++&quot; :&lt;br /&gt;                System.out.println(&quot;C++ Programmer&quot;); break;&lt;br /&gt;            default:&lt;br /&gt;                System.out.println(&quot;Programmer&quot;); break;&lt;br /&gt;        }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;   &lt;h2&gt;Improved Type Inference for Generic Instance Creation&lt;/h2&gt; Until now when you create an object of a class with parameterized types,  we need to specify the type both in the declaration (left of =) and  also in the call to constructor (right of =). &lt;p&gt; For example here is an example in Java 6.0.  &lt;/p&gt;&lt;pre class=&quot;code&quot;&gt;  Map&lt;string, list=&quot;&quot;&gt;&lt;string&gt;&amp;gt; anagrams = new HashMap&lt;string, list=&quot;&quot;&gt;&lt;string&gt;&amp;gt;();&lt;br /&gt;&lt;br /&gt;&lt;/string&gt;&lt;/string,&gt;&lt;/string&gt;&lt;/string,&gt;&lt;/pre&gt;  The types to be used on the right of HashMap are evident from the declaration. So it is redundant but needed in Java 6.0. &lt;p&gt; Start from Java 7.0, you are allowed to omit type information at the  time of creating an object of class with generics if the information can  be inferred from declaration.  That means the following is enough in  Java 7.0 for the declaration above in Java 6.0  &lt;/p&gt;&lt;pre class=&quot;code&quot;&gt;  Map&lt;string, list=&quot;&quot;&gt;&lt;string&gt;&amp;gt; anagrams = new HashMap&amp;lt;&amp;gt;();&lt;br /&gt;&lt;br /&gt;&lt;/string&gt;&lt;/string,&gt;&lt;/pre&gt; The above statement simplifies the declaration by removing redundancy related to specifying types in generic declarations.   &lt;h2&gt;Automatic Resource Management&lt;/h2&gt; A resource is an object that is to be closed manually. An example is  an  OutputStream, a Connection or a Socket.   Automatic resource management statement is a form of the try statement that declares one or more resources. The scope of these resource declarations is limited to the try statement. When the try statement  completes, whether normally or abruptly, all of its resources are closed  automatically.  For example the following is the code we have in Java 6.0 to open and  close a stream.  &lt;pre class=&quot;code&quot;&gt;        FileOutputStream fos = new FileOutputStream(path);&lt;br /&gt;      try {&lt;br /&gt;          // code to process fos&lt;br /&gt;      }&lt;br /&gt;      catch(Exception ex) {&lt;br /&gt;          System.out.println(ex);&lt;br /&gt;      }&lt;br /&gt;      finally {&lt;br /&gt;         fos.close();&lt;br /&gt;      }&lt;br /&gt;&lt;/pre&gt;   Here is the modified version that uses Automatic Resource Management of Java 7.0.  &lt;pre class=&quot;code&quot;&gt;       try (FileOutputStream fos = new FileOutputStream(path))&lt;br /&gt;      {&lt;br /&gt;          // code to process fos&lt;br /&gt;      }&lt;br /&gt;      catch(Exception ex) {&lt;br /&gt;          System.out.println(ex);&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;   &lt;h2&gt;Binary integral literals and underscores in numeric literals &lt;/h2&gt; Binary integer literals are just like hexadecimal integer literals  except that binary digits are used instead of hexadecimal digits. Binary  literals are prefixed by &quot;0b&quot; rather than &quot;0x&quot;. Here is an example for binary literal.  &lt;p&gt; In numeric literals, underscores are allowed as separators between  digits. This applies to literals in binary, octal, hexadecimal, or  decimal and applies to floating-point literals also.  &lt;/p&gt;&lt;pre class=&quot;code&quot;&gt;        int n = 0b10000000;&lt;br /&gt;      System.out.println(n);  // prints 128&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;      int n2 =  121_31_23_232;   // integer literal with underscores&lt;br /&gt;      int n3 =  0xff_dd;   // hexa literal with underscores&lt;br /&gt;      System.out.println(n2);&lt;br /&gt;      System.out.println(n3);&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;      &lt;h2&gt;Multi-catch and more precise rethrow&lt;/h2&gt; Java 7.0 allows a single catch block to handle two or more exception by  listing exception types separated by | (or) symbol. This allows one  catch block to      handle multiple exceptions and take the same action for multiple exceptions.   &lt;pre class=&quot;code&quot;&gt;         try {&lt;br /&gt;          int v = Integer.parseInt(num);&lt;br /&gt;          int result = 100 / v;&lt;br /&gt;          System.out.println(result);&lt;br /&gt;      }&lt;br /&gt;      catch(NumberFormatException | ArithmeticException ex ) {  // multi-catch&lt;br /&gt;          System.out.println(&quot;Not a valid number or zero&quot;);&lt;br /&gt;      }&lt;br /&gt;&lt;/pre&gt;  &lt;p&gt;  &lt;/p&gt;&lt;h2&gt;More precise rethrow&lt;/h2&gt; If an exception parameter is not modified and if it is rethrown inside  the catch block, the compiler applies a more precise analysis to  determine the type of what can be thrown. &lt;p&gt; For example consider the following example in Java 6.0.  &lt;/p&gt;&lt;pre class=&quot;code&quot;&gt;class Ex1 extends Exception { }&lt;br /&gt;class Ex2 extends Exception { }&lt;br /&gt;&lt;br /&gt;public class RethrowException {&lt;br /&gt;&lt;br /&gt;  public void m1(int v)  throws Ex1 , Ex2 {&lt;br /&gt;      try {&lt;br /&gt;          if (v &amp;lt; 0) {&lt;br /&gt;              throw new Ex1();&lt;br /&gt;          }&lt;br /&gt;          else&lt;br /&gt;             if ( v &amp;gt; 100 ) {&lt;br /&gt;                 throw new Ex2();&lt;br /&gt;             }&lt;br /&gt;          // process&lt;br /&gt;      }&lt;br /&gt;      catch (Exception ex) {&lt;br /&gt;          throw ex; &lt;br /&gt;//   unreported exception java.lang.Exception; must be caught or declared to be thrown&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;  In the above code, throw ex; will result in error as ex is of type  Exception and method has only Ex1 and Ex2 in throws clause. Exception is  much more general than Ex1 and Ex2, so  Java doesn&#39;t allow us to throw ex, which is declared as Exception.  &lt;p&gt; But the same code without any change will compile in Java 7.0 as Java  applies more precise analysis to determine the type of exception being  thrown. Java 7 understands only two possible  exceptions (Ex1 and Ex2) can be thrown from try block so it allows ex to  be rethrown though ex is declared as Exception.  &lt;/p&gt;&lt;p&gt;  Here are some other links that are related to Java 7.0 features.&lt;br /&gt;&lt;/p&gt;&lt;p&gt; &lt;a href=&quot;http://prakasv.blogspot.com/2011/08/objects-class-in-java-70.html&quot;&gt;Objects class in Java 7.0&lt;/a&gt; &lt;/p&gt; &lt;a href=&quot;http://prakasv.blogspot.com/2011/08/path-class-and-files-class-in-nio-of.html&quot;&gt;Path class and Files class&lt;/a&gt;  &lt;input name=&quot;ctl00$ContentPlaceHolder1$blogid&quot; id=&quot;ctl00_ContentPlaceHolder1_blogid&quot; value=&quot;java7&quot; type=&quot;hidden&quot;&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://prakasv.blogspot.com/feeds/7678813767619021895/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prakasv.blogspot.com/2011/08/features-of-java-70.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1891246178551476682/posts/default/7678813767619021895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1891246178551476682/posts/default/7678813767619021895'/><link rel='alternate' type='text/html' href='http://prakasv.blogspot.com/2011/08/features-of-java-70.html' title='Features of Java 7.0'/><author><name>Prakash</name><uri>http://www.blogger.com/profile/12000903947892917697</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1891246178551476682.post-3873531712420791531</id><published>2011-08-09T14:07:00.000+05:30</published><updated>2011-08-09T14:08:53.245+05:30</updated><title type='text'>Objects Class in Java 7.0</title><content type='html'>Java 7 provides a new class - &lt;strong&gt;java.util.Objects.&lt;/strong&gt;  This class provides static methods that provide      &lt;strong&gt;null-safe or null-tolerant &lt;/strong&gt;operations on objects. &lt;p&gt; Consider the following program in Java 6.0. &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;pre class=&quot;code&quot;&gt;class  Person {&lt;br /&gt;   private String name, email;&lt;br /&gt;   public Person(String name, String email) {&lt;br /&gt;       this.name =  name;&lt;br /&gt;       this.email = email;&lt;br /&gt;   }&lt;br /&gt;   @Override&lt;br /&gt;   public boolean equals(Object obj) {&lt;br /&gt;       final Person other = (Person) obj;&lt;br /&gt;       return  this.name.equals(other.name) &amp;amp;&amp;amp; this.email.equals(other.email);&lt;br /&gt;   }&lt;br /&gt;   @Override&lt;br /&gt;   public int hashCode() {&lt;br /&gt;       return 1;&lt;br /&gt;   }&lt;br /&gt;  &lt;br /&gt;   public void print(){&lt;br /&gt;       System.out.println (name); &lt;br /&gt;       System.out.println (email);&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class ObjectsDemo {&lt;br /&gt;   public static void main(String[] args) {&lt;br /&gt;       Person p1 = new Person(&quot;Srikanth Pragada&quot;, null);&lt;br /&gt;       Person p2 = new Person(&quot;Srikanth Pragada&quot;, &quot;srikanthpragada@gmail.com&quot;);&lt;br /&gt;       p1.print();&lt;br /&gt;       System.out.println(p1.equals(p2));&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;  The above program results in the following program:  &lt;pre class=&quot;code&quot;&gt;Srikanth Pragada&lt;br /&gt;null&lt;br /&gt;Exception in thread &quot;main&quot; java.lang.NullPointerException&lt;br /&gt;	at Person.equals(ObjectsDemo.java:11)&lt;br /&gt;	at ObjectsDemo.main(ObjectsDemo.java:31)&lt;br /&gt;&lt;/pre&gt;      &lt;strong&gt;NullPointerException&lt;/strong&gt; is thrown in &lt;strong&gt;equals()&lt;/strong&gt;  method as we      are using email, which is set to null, for comparison. It means, if  any variable is set to null, unless we explicitly handle null, will result in NullPointerException.  &lt;p&gt; This problem of NullPointerException can be prevented by using null-safe operations using&lt;strong&gt; Java 7.0 Objects&lt;/strong&gt; class.  &lt;/p&gt;&lt;p&gt; The following are the static methods provided by &lt;strong&gt;Objects&lt;/strong&gt; class. &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;5pt&quot;&gt; &lt;tbody&gt;&lt;tr style=&quot;background-color: Red; color: White;&quot;&gt;  &lt;th&gt;Method&lt;/th&gt;  &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt;   &lt;td&gt;static &lt;t&gt; int	compare(T a, T b, Comparator c)&lt;/t&gt;&lt;/td&gt;   &lt;td&gt;Returns 0 if the arguments are identical and c.compare(a, b) otherwise&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td&gt;static boolean	deepEquals(Object a, Object b)&lt;/td&gt;   &lt;td&gt;Returns true if the arguments are deeply equal to each other and false otherwise&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td&gt;static boolean	equals(Object a, Object b)&lt;/td&gt;   &lt;td&gt;Returns true if the arguments are equal to each other and false otherwise&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td&gt;static int	hash(Object... values)&lt;/td&gt;   &lt;td&gt;Generates a hash code for a sequence of input values.&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td&gt;static int	hashCode(Object o)&lt;/td&gt;   &lt;td&gt;Returns the hash code of a non-null argument and 0 for a null argument&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td&gt;static &lt;t&gt; T	requireNonNull(T obj)&lt;/t&gt;&lt;/td&gt;   &lt;td&gt;Checks that the specified object reference is not null&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td&gt;static &lt;t&gt; T	requireNonNull(T obj, String message)&lt;/t&gt;&lt;/td&gt;   &lt;td&gt;Checks that the specified object reference is not null and throws a customized NullPointerException if it is&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td&gt;static String	toString(Object o)&lt;/td&gt;   &lt;td&gt;Returns the result of calling toString for a non-null argument and &quot;null&quot; for a null argument&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td&gt;static String	toString(Object o, String nullDefault)&lt;/td&gt;   &lt;td&gt;Returns the result of calling toString on the first argument if  the first argument is not null and returns the second argument otherwise&lt;/td&gt;  &lt;/tr&gt;  &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt; The following program demonstrates how to use some of these methods. &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;pre class=&quot;code&quot;&gt;import java.util.Objects;&lt;br /&gt;&lt;br /&gt;class  Person {&lt;br /&gt;  private String name, email;&lt;br /&gt;   public Person(String name, String email) {&lt;br /&gt;       this.name = &lt;strong&gt;Objects.requireNonNull&lt;/strong&gt;(name,&quot;Name must be not null&quot;);&lt;br /&gt;       this.email = email;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public boolean equals(Object obj) {&lt;br /&gt;       final Person other = (Person) obj;&lt;br /&gt;       return  this.name.equals(other.name) &amp;amp;&amp;amp; this.email.equals(other.email);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public int hashCode() {&lt;br /&gt;       return 1;&lt;br /&gt;   }&lt;br /&gt;  &lt;br /&gt;   public void print(){&lt;br /&gt;       System.out.println (name);   &lt;br /&gt;       System.out.println (&lt;strong&gt;Objects.toString(&lt;/strong&gt;email,&quot;Email is null&quot;));&lt;br /&gt;        // returns second parameter if email is null&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class ObjectsClass {&lt;br /&gt;  &lt;br /&gt;   public static void main(String[] args) {&lt;br /&gt;         Person p1 = new Person(&quot;abc&quot;,&quot;abc@gmail.com&quot;);&lt;br /&gt;         p1.print();&lt;br /&gt;&lt;br /&gt;         Person p2 = null;&lt;br /&gt;         System.out.println(&lt;strong&gt;Objects.equals&lt;/strong&gt;(p2,p1));&lt;br /&gt;         // null-save equals, if first parameter is null  it returns false&lt;br /&gt;        &lt;br /&gt;         p2 = new Person(&quot;abc&quot;,&quot;abc@gmail.com&quot;);&lt;br /&gt;        &lt;br /&gt;         System.out.println(&lt;strong&gt;Objects.equals&lt;/strong&gt;(p1, p2));  // null-save equals&lt;br /&gt;        &lt;br /&gt;         Person p3 = new Person(&quot;Srikanth Pragada&quot;,null);&lt;br /&gt;         p3.print();&lt;br /&gt;        &lt;br /&gt;         Person p4 = new Person(null,null);&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;  When you run the above program the following output will be generated.  &lt;pre class=&quot;code&quot;&gt;abc&lt;br /&gt;abc@gmail.com&lt;br /&gt;false&lt;br /&gt;true&lt;br /&gt;Srikanth Pragada&lt;br /&gt;Email is null&lt;br /&gt;Exception in thread &quot;main&quot; java.lang.NullPointerException: Name must be not null&lt;br /&gt;	at java.util.Objects.requireNonNull(Objects.java:226)&lt;br /&gt;	at Person.&lt;init&gt;(ObjectsClass.java:7)&lt;br /&gt;	at ObjectsClass.main(ObjectsClass.java:42)&lt;br /&gt;&lt;/init&gt;&lt;/pre&gt;  &lt;p&gt; &lt;input name=&quot;ctl00$ContentPlaceHolder1$blogid&quot; id=&quot;ctl00_ContentPlaceHolder1_blogid&quot; value=&quot;objects&quot; type=&quot;hidden&quot;&gt;        &lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://prakasv.blogspot.com/feeds/3873531712420791531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prakasv.blogspot.com/2011/08/objects-class-in-java-70.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1891246178551476682/posts/default/3873531712420791531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1891246178551476682/posts/default/3873531712420791531'/><link rel='alternate' type='text/html' href='http://prakasv.blogspot.com/2011/08/objects-class-in-java-70.html' title='Objects Class in Java 7.0'/><author><name>Prakash</name><uri>http://www.blogger.com/profile/12000903947892917697</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1891246178551476682.post-5988139906280748043</id><published>2011-08-09T13:38:00.001+05:30</published><updated>2011-08-09T14:07:23.803+05:30</updated><title type='text'>Path class and Files class in NIO of Java 7.0</title><content type='html'>Java 7 introduced new file IO called &quot;NIO.2 File System&quot;.  Its classes are provided in a new package - java.nio.files.  &lt;p&gt; In this blog we use a couple of new classes introduced in new IO of Java 7. Our primary focus is on Path and Files classes. &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;h2&gt;Path class&lt;/h2&gt; Path class in Java 7 is similar to File class in Java 6. &lt;p&gt; The Java I/O File API, as it was originally created, was not written to be extended. &lt;/p&gt;&lt;p&gt; Many of the methods do not throw exceptions even when an error is encountered leaving developers wondering what&#39;s happening.  &lt;/p&gt;&lt;p&gt; The following code in Java 6.0 will not throw any exception even if the file is not found in the filesystem.  &lt;/p&gt;&lt;pre class=&quot;code&quot;&gt; File f = new File(&quot;c:\\test.txt&quot;);&lt;br /&gt;f.delete();&lt;br /&gt;&lt;/pre&gt;  Shown below is the code in Java 7.0 using Path class but it throws exception when file is not found.  &lt;pre class=&quot;code&quot;&gt;Path fp = Paths.get(&quot;c:\\test.txt&quot;);   // get Path object&lt;br /&gt;Files.delete(fp);  // delete file represented by path object&lt;br /&gt;&lt;br /&gt;output&lt;br /&gt;======&lt;br /&gt;Exception in thread &quot;main&quot; java.nio.file.NoSuchFileException: c:\test.txt&lt;br /&gt;&lt;/pre&gt;   &lt;table border=&quot;1&quot; cellpadding=&quot;5pt&quot;&gt; &lt;tbody&gt;&lt;tr style=&quot;color: white; background-color: Navy;&quot;&gt;  &lt;th&gt;Method &lt;/th&gt;  &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;Path	getFileName()&lt;/td&gt; &lt;td&gt;Returns the name of the file or directory denoted by this path as a Path object.&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;FileSystem	getFileSystem()&lt;/td&gt; &lt;td&gt;Returns the file system that created this object.&lt;/td&gt; &lt;/tr&gt;   &lt;tr&gt; &lt;td&gt;Path	getName(int index)&lt;/td&gt; &lt;td&gt;Returns a name element of this path as a Path object.&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;int	getNameCount()&lt;/td&gt; &lt;td&gt;Returns the number of name elements in the path.&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;Path	getParent()&lt;/td&gt; &lt;td&gt;Returns the parent path, or null if this path does not have a parent&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;Iterator&lt;path&gt;iterator()&lt;/path&gt;&lt;/td&gt; &lt;td&gt;Returns an iterator over the name elements of this path.&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;WatchKey	register(WatchService watcher, WatchEvent.Kind... events)&lt;/td&gt; &lt;td&gt;Registers the file located by this path with a watch service.&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;Path	toAbsolutePath()&lt;/td&gt; &lt;td&gt;Returns a Path object representing the absolute path of this path&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;File toFile()&lt;/td&gt; &lt;td&gt;Returns a File object representing this path&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;URI	toUri()&lt;/td&gt; &lt;td&gt;Returns a URI to represent this path.&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt; The following code shows some other new methods of Path class.   &lt;/p&gt;&lt;pre class=&quot;code&quot;&gt;        Path p = Paths.get(&quot;c:\\jdk7.0\\bin\\javac.exe&quot;);&lt;br /&gt;      System.out.println( p.getNameCount());    // 3&lt;br /&gt;      System.out.println( p.getName(1));        // bin&lt;br /&gt;&lt;br /&gt;      System.out.println( p.getFileSystem().getClass());&lt;br /&gt; // display file system - sun.nio.fs.WindowsFileSystem&lt;br /&gt;&lt;br /&gt;      File f = p.toFile();  // convert to File object&lt;br /&gt;&lt;/pre&gt;  &lt;h2&gt;Files class&lt;/h2&gt; Files class provides static methods that operate on files and directories.   &lt;p&gt;  The following are the important methods of Files class.  &lt;/p&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;5pt&quot;&gt; &lt;tbody&gt;&lt;tr style=&quot;color: white; background-color: Navy;&quot;&gt;  &lt;th&gt;Method &lt;/th&gt;  &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;static Path	copy(Path source, Path target, CopyOption... options)&lt;/td&gt; &lt;td&gt;Copy a file to a target file&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;static void	delete(Path path)&lt;/td&gt; &lt;td&gt;Deletes a file.&lt;/td&gt; &lt;/tr&gt;   &lt;tr&gt; &lt;td&gt;static boolean	deleteIfExists(Path path)&lt;/td&gt; &lt;td&gt;Deletes a file if it exists.&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;static boolean	isDirectory(Path path, LinkOption... options)&lt;/td&gt; &lt;td&gt;Tests whether a file is a directory&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;static Path	move(Path source, Path target, CopyOption... options)&lt;/td&gt; &lt;td&gt;Move or rename a file to a target file&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;static DirectoryStream&lt;path&gt;	newDirectoryStream(Path dir)&lt;/path&gt;&lt;/td&gt; &lt;td&gt;Opens a directory, returning a DirectoryStream to iterate over all entries in the directory&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;static String	probeContentType(Path path)&lt;/td&gt; &lt;td&gt;Probes the content type of a file.&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;static List&lt;string&gt;	readAllLines(Path path, Charset cs)&lt;/string&gt;&lt;/td&gt; &lt;td&gt;Read all lines from a file&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;static long	size(Path path)&lt;/td&gt; &lt;td&gt;Returns the size of a file (in bytes).&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;static Path	walkFileTree(Path start, FileVisitor visitor)&lt;/td&gt; &lt;td&gt;Walks a file tree&lt;/td&gt; &lt;/tr&gt;  &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;  The following example shows how to use newDirectoryStream() to get list of files from the given path.  Though listFiles() method of File class provided this functionality, DirectoryStream is more scalable.  &lt;/p&gt;&lt;pre class=&quot;code&quot;&gt;        Path path = Paths.get(&quot;c:\\jdk7.0&quot;);&lt;br /&gt;   &lt;br /&gt;      //  take files from jdk7.0&lt;br /&gt;      try (DirectoryStream&lt;path&gt;  directory =  &lt;strong&gt;Files.newDirectoryStream(path)&lt;/strong&gt;)  &lt;br /&gt;      // Closes stream at the end (ARM)&lt;br /&gt;      {&lt;br /&gt;         for (Path file :  directory)&lt;br /&gt;            System.out.println(file.getFileName());&lt;br /&gt;      }&lt;br /&gt;&lt;/path&gt;&lt;/pre&gt;  The following code shows how to get the list of lines from a file using readAllLines() methods.  &lt;pre class=&quot;code&quot;&gt;         Path p = Paths.get(&quot;c:\\jdk7.0\\names.txt&quot;);&lt;br /&gt;      System.out.println(&quot;Size : &quot;  + Files.size(p));&lt;br /&gt;       &lt;br /&gt;      List&lt;string&gt; lines = &lt;strong&gt;Files.readAllLines&lt;/strong&gt;(p, Charset.defaultCharset());&lt;br /&gt;      for(String line : lines)&lt;br /&gt;           System.out.println(line);&lt;br /&gt;&lt;/string&gt;&lt;/pre&gt;  &lt;p&gt;  The following example shows how to display the list of files from the  given tree in the file system. It walks through the tree that starts  with c:\jdk7.0 and displays  all files and folder present within jdk7.0 folder.  &lt;/p&gt;&lt;p&gt;  Method  walkFileTree() takes path to start with and an object of a class  that extends SimpleFileVisitor class. For each file that is visited,  visitFile() method is called.  Before a directory is processed, preVisitDirectory() method is called.  After directory is processed, postVisitDirectory() method is called.   &lt;/p&gt;&lt;pre class=&quot;code&quot;&gt;import java.io.IOException;&lt;br /&gt;import java.nio.file.FileVisitResult;&lt;br /&gt;import java.nio.file.Files;&lt;br /&gt;import java.nio.file.Path;&lt;br /&gt;import java.nio.file.Paths;&lt;br /&gt;import java.nio.file.SimpleFileVisitor;&lt;br /&gt;import java.nio.file.attribute.BasicFileAttributes;&lt;br /&gt;import static java.nio.file.FileVisitResult.CONTINUE;&lt;br /&gt;&lt;br /&gt;public class WalkTree {&lt;br /&gt;  public static void main(String[] args) throws Exception&lt;br /&gt;  {&lt;br /&gt;      Path p = Paths.get(&quot;c:\\jdk7.0&quot;);&lt;br /&gt;      PrintFiles pf= new PrintFiles();&lt;br /&gt;      &lt;strong&gt;Files.walkFileTree(p,pf);&lt;/strong&gt;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class PrintFiles extends &lt;strong&gt;SimpleFileVisitor&lt;path&gt;&lt;/path&gt;&lt;/strong&gt; {&lt;br /&gt;  @Override&lt;br /&gt;  public FileVisitResult visitFile(Path file, BasicFileAttributes attr) {&lt;br /&gt;      System.out.println( &quot;File :&quot; + file.getFileName());&lt;br /&gt;      return CONTINUE;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  @Override&lt;br /&gt;  public FileVisitResult postVisitDirectory(Path dir, IOException ioe)&lt;br /&gt;       throws IOException {&lt;br /&gt;      System.out.printf(&quot;Processed Directory: %s\n&quot;, dir.getFileName());&lt;br /&gt;      return CONTINUE;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  @Override&lt;br /&gt;  public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes bfa)&lt;br /&gt;   throws IOException {&lt;br /&gt;      System.out.printf(&quot;About to process directory: %s\n&quot;, dir.getFileName() );&lt;br /&gt;      return CONTINUE;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;  &lt;p&gt; &lt;input name=&quot;ctl00$ContentPlaceHolder1$blogid&quot; id=&quot;ctl00_ContentPlaceHolder1_blogid&quot; value=&quot;j7path&quot; type=&quot;hidden&quot;&gt;       &lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://prakasv.blogspot.com/feeds/5988139906280748043/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prakasv.blogspot.com/2011/08/path-class-and-files-class-in-nio-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1891246178551476682/posts/default/5988139906280748043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1891246178551476682/posts/default/5988139906280748043'/><link rel='alternate' type='text/html' href='http://prakasv.blogspot.com/2011/08/path-class-and-files-class-in-nio-of.html' title='Path class and Files class in NIO of Java 7.0'/><author><name>Prakash</name><uri>http://www.blogger.com/profile/12000903947892917697</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1891246178551476682.post-7161249557681463611</id><published>2011-07-01T10:28:00.002+05:30</published><updated>2011-07-01T10:37:35.230+05:30</updated><title type='text'>Java7 Launch</title><content type='html'>&lt;a href=&quot;http://jug-c.wikispaces.com/space/showlogo/1307274361/logo.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 117px; height: 122px;&quot; src=&quot;http://jug-c.wikispaces.com/space/showlogo/1307274361/logo.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://sites.google.com/site/fasojug/home/logojava7.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 169px; height: 111px;&quot; src=&quot;https://sites.google.com/site/fasojug/home/logojava7.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;                  Speakers and Topics for &lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#f250&quot;&gt;Java7&lt;/a&gt;  &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;            &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Location:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Tenth Planet Technologies Pvt. Ltd,&lt;/div&gt;&lt;div&gt;P.T.Lee building,&lt;/div&gt;&lt;div&gt;6th floor, #807, Anna Salai,&lt;/div&gt;&lt;div&gt;opp. to LIC,&lt;/div&gt;&lt;div&gt; Chennai-600002&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Day&lt;/b&gt; : 9th July 2010&lt;br /&gt;&lt;b&gt;Time&lt;/b&gt;: 10AM&lt;br /&gt;&lt;b&gt;Topic&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;Speaker&lt;br /&gt;Duration&lt;br /&gt;Quiz and Tshirt (limited) distribution&lt;br /&gt;&lt;br /&gt;JSR 334: Small language enhancements (Project Coin)&lt;br /&gt;Marimuthu Rajagopal&lt;br /&gt;60 mins&lt;br /&gt;JSR 292: Support for dynamically-typed languages (InvokeDynamic)&lt;br /&gt;Balamurugan&lt;br /&gt;&lt;br /&gt;Concurrency and collections updates (jsr166y)&lt;br /&gt;Prasanna Kumar&lt;br /&gt;30mns&lt;br /&gt;JSR 203: More new I/O APIs for the Java platform (NIO.2)&lt;br /&gt;Ranjith Kumar&lt;br /&gt;60 min&lt;br /&gt;&lt;b&gt;Open Discussion&lt;/b&gt; - Unconference&lt;br /&gt;Come up with ideas&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Open for all Java enthusiastic and Free registration&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;Java7 Launch&lt;/b&gt; kit will be shared, you can copy on your laptop / memory stick or you can download it.&lt;br /&gt;T-Shirts are limited&lt;br /&gt;If you like to talk on any topic post in the group.&lt;br /&gt;Feel free to invite your friends.&lt;br /&gt;Hashtag for the event #java7 #jugchennai&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href=&quot;https://spreadsheets0.google.com/spreadsheet/viewform?hl=en_US&amp;amp;hl=en_US&amp;amp;formkey=dHlrbl9lbk9xLW53cnlYTnRLVXNpUlE6MQ#gid=0&quot;&gt;Register Now&lt;/a&gt; Free Registration&lt;/b&gt;&lt;br /&gt;We request you to be in the venue on time. Please register If you are really confirming. Your registration help us to plan and execute the event in proper way.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Other Links:&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Community Blog&lt;/b&gt;: &lt;a href=&quot;http://www.jugchennai.in/&quot;&gt;http://www.jugchennai.in&lt;/a&gt;&lt;br /&gt;&lt;b&gt;JUGC Project Site&lt;/b&gt;: &lt;a href=&quot;http://java.net/projects/chennaijavausergroup&quot;&gt;http://java.net/projects/chennaijavausergroup&lt;/a&gt;&lt;br /&gt;&lt;b&gt;Group Discussion&lt;/b&gt;: &lt;a href=&quot;http://groups.google.com/group/jug-c&quot;&gt;http://groups.google.com/group/jug-c&lt;/a&gt;&lt;br /&gt;&lt;b&gt;Twitter&lt;/b&gt; : &lt;a href=&quot;http://twitter.com/jug_c&quot;&gt;http://twitter.com/jug_c&lt;/a&gt;&lt;br /&gt;&lt;b&gt;Google Profile&lt;/b&gt;:**&lt;a href=&quot;http://www.google.com/profiles/chennai.jug&quot;&gt;http://www.google.com/profiles/chennai.jug&lt;/a&gt;**&lt;br /&gt;&lt;b&gt;Wiki&lt;/b&gt;: &lt;a href=&quot;http://jug-c.wikispaces.com/&quot;&gt;http://jug-c.wikispaces.com&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://prakasv.blogspot.com/feeds/7161249557681463611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prakasv.blogspot.com/2011/07/java7-launch.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1891246178551476682/posts/default/7161249557681463611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1891246178551476682/posts/default/7161249557681463611'/><link rel='alternate' type='text/html' href='http://prakasv.blogspot.com/2011/07/java7-launch.html' title='Java7 Launch'/><author><name>Prakash</name><uri>http://www.blogger.com/profile/12000903947892917697</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1891246178551476682.post-2781851318436151687</id><published>2011-03-31T12:05:00.003+05:30</published><updated>2011-03-31T12:14:30.926+05:30</updated><title type='text'>Use Folder Lock Software for protect your personal folder and valuable data</title><content type='html'>i ve been creating one software the protect our data with password locks.&lt;br /&gt;&lt;br /&gt;i ll ve been launched as soon as posible..</content><link rel='replies' type='application/atom+xml' href='http://prakasv.blogspot.com/feeds/2781851318436151687/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prakasv.blogspot.com/2011/03/folder-lock-with-personal-folder.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1891246178551476682/posts/default/2781851318436151687'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1891246178551476682/posts/default/2781851318436151687'/><link rel='alternate' type='text/html' href='http://prakasv.blogspot.com/2011/03/folder-lock-with-personal-folder.html' title='Use Folder Lock Software for protect your personal folder and valuable data'/><author><name>Prakash</name><uri>http://www.blogger.com/profile/12000903947892917697</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>