title: Access is denied when using FileOutputStream
body: <p>I'm having an issue getting this to work.  It takes in a string which consists of several pieces of information put together.
  However, when I try to write the String to a file in order to track changes in the program over time, I receive an access is denied error:</p>
  
  <pre><code> void writeToFile(String input) throws Exception{
              File file = new File("C:\\WeatherExports\\export.txt");
              if(!file.exists()){
                      file.createNewFile();
              }
              BufferedWriter inFile = new BufferedWriter(new FileWriter(file,true));
              try{
                      inFile.append(input);
                      inFile.newLine();
              } catch(Exception e){
                      e.printStackTrace();
              }
              inFile.close();
      }
  </code></pre>
  
  <p>STACKTRACE YEILDS:</p>
  
  <pre><code>java.io.FileNotFoundException: C:\WeatherExports\export.txt (Access is denied)
  </code></pre>
  
  <p>Full Stacktrace:</p>
  
  <pre><code>java.io.FileNotFoundException: C:\WeatherExports\export.txt (Access is denied)
  at java.io.FileOutputStream.openAppend(Native Method)
  at java.io.FileOutputStream.&lt;init&gt;(Unknown Source)
  at java.io.FileWriter.&lt;init&gt;(Unknown Source)
  at org.weatheralert.InfoManipMethods.writeToFile(InfoManipMethods.java:58)
  at org.weatheralert.Form.actionPerformed(Form.java:108)
  at javax.swing.JTextField.fireActionPerformed(Unknown Source)
  at javax.swing.JTextField.postActionEvent(Unknown Source)
  at javax.swing.JTextField$NotifyAction.actionPerformed(Unknown Source)
  at javax.swing.SwingUtilities.notifyAction(Unknown Source)
  at javax.swing.JComponent.processKeyBinding(Unknown Source)
  at javax.swing.JComponent.processKeyBindings(Unknown Source)
  at javax.swing.JComponent.processKeyEvent(Unknown Source)
  at java.awt.Component.processEvent(Unknown Source)
  at java.awt.Container.processEvent(Unknown Source)
  at java.awt.Component.dispatchEventImpl(Unknown Source)
  at java.awt.Container.dispatchEventImpl(Unknown Source)
  at java.awt.Component.dispatchEvent(Unknown Source)
  at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
  at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
  at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
  at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
  at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
  at java.awt.Component.dispatchEventImpl(Unknown Source)
  at java.awt.Container.dispatchEventImpl(Unknown Source)
  at java.awt.Window.dispatchEventImpl(Unknown Source)
  at java.awt.Component.dispatchEvent(Unknown Source)
  at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
  at java.awt.EventQueue.access$000(Unknown Source)
  at java.awt.EventQueue$1.run(Unknown Source)
  at java.awt.EventQueue$1.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
  at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
  at java.awt.EventQueue$2.run(Unknown Source)
  at java.awt.EventQueue$2.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
  at java.awt.EventQueue.dispatchEvent(Unknown Source)
  at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.awt.EventDispatchThread.run(Unknown Source)
  </code></pre>
  
  <p>Line 58:</p>
  
  <pre><code>BufferedWriter inFile = new BufferedWriter(new FileWriter(file,true));
  </code></pre>