title: Error accessing file from "My Documents" for Windows Xp and Windows 7
body: <p>Sir, i am working in a java application.On that application i have to access files from "My Documents". The problem is coming with windows version when i am using windows 7, it can be accessed as "Documents" folder but for windows XP it is "My Documents". </p>
  
  <p>I am writing following code to access files from "Documents" folder in windows 7 .</p>
  
  <pre><code> public static void main(String[] arr)
   {
       try
       {
           String source = System.getProperty("user.home")+ File.separator + "Documents";
           File[] Files = new File(source).listFiles();
           System.out.println(Files.length);
       }
       catch(Exception ex)
       {
           ex.printStackTrace();
       }
   }
  </code></pre>
  
  <p>and for Windows Xp</p>
  
  <pre><code> public static void main(String[] arr)
   {
       try
       {
           String source = System.getProperty("user.home")+ File.separator + "My Documents";
           File[] Files = new File(source).listFiles();
           System.out.println(Files.length);
       }
       catch(Exception ex)
       {
           ex.printStackTrace();
       }
   }
  </code></pre>
  
  <p>Please could you suggest me a generic method, which can be applied for all the versions of Windows?</p>