code: public void writeFile(String aFileName, String aData) throws IOException
     {
        Object lock = retrieveLock(aFileName);      
        synchronized (lock) 
        {
           IO.writeFile(aFileName, aData,IO.CHARSET);
        }
  
     }
docs: Write string file data
  
  @param aFileName the file name
  @param aData the data to write
  @throws IOException when an IO error occurs