title: Can't rename file using java
body: <p>I am currently trying to append some text onto the end of a file name using java but nothing seems to be happening. I have never used java to manipulate files before but going by posts online I've come up with this...</p>
  
  <pre><code>for (File f : fullFileList)
              {
                  System.out.println(f.getName());
                  if (moveToFailed(f))
                  {
                      /*
                       * Moved to failed successfully
                       */
                      File newf= new File(f.getAbsolutePath() + ".processed");
                      f.renameTo(newf);
  
                  }
              }
  </code></pre>
  
  <p>Can anyone help with this? 
  Thanks!</p>
  
  <p>(The file is being moved successfully so it is entering that loop)</p>
  
  <p>Update:</p>
  
  <pre><code>boolean moveToFailed(File f) // Moves file to failed directory
  {
      try
      {
          FileUtils.moveToDirectory(f, failedDirectory, true);
          return true;
      } catch (IOException e)
      {
          System.out.println("Couldn't move " + f.getName()
                  + " to failed directory!\n" + e.getMessage());
          return false;
      }
  </code></pre>