Creating a new file, then writing to it
<p>I am trying to create a new CSV file then write to it, the code gets to as far as the <code>BufferedWriter</code> then I get a <code>java.io.FileNotFoundException: /mnt/sdcard/SMSMonitor/04-07-2011/Backup_20:43:00.csv (Invalid argument)</code> exception.  Does anyone know why this is happening?</p>

<pre><code>public void generateCSVFile(ArrayList&lt;String&gt; list)
{
    File CreateDirectory  = new File(Environment.getExternalStorageDirectory()
        + "/SMSMonitor/" + subFolderName);
    CreateDirectory.mkdirs();

    try 
    {
        File file = new File(CreateDirectory +"/"+ fileName);

        BufferedWriter writer = new BufferedWriter(new FileWriter(file));
        writer.write("ID, Date, Address, Body");
        writer.newLine();
        for (String s : list)
        {
            writer.write(s);
            writer.newLine();
        }
        writer.newLine();
        writer.flush();
        writer.close();
    }
    catch (IOException e) 
    {
        e.printStackTrace();
    }
}
</code></pre>
