title: Fortify Path Manipulation error
body: <p>Fority Scan reported "Path Manipulation" security issues in following snippet</p>
  
  <pre><code>String filePath = getFilePath(fileLocation, fileName);
  final File file = new File(filePath);
  LOGGER.info("Saving report at : " + filePath);
  BufferedWriter fileWriter = new BufferedWriter(new FileWriter(file));
  fileWriter.write(fileContent);
  </code></pre>
  
  <p>so i am checking for blacklisted characters in fileLocation and throwing exception, still the Fortify is throwing the exception. </p>
  
  <pre><code>try {
      String filePath = getFilePath(fileLocation, fileName);
      if (isSecurePath(filePath)) {
        final File file = new File(filePath);
        LOGGER.info("Saving report at : " + filePath);
        BufferedWriter  fileWriter = new BufferedWriter(new FileWriter(file));
        fileWriter.write(fileContent);
      } else {
        throw new Exception("Security Issue. File Path has blacklisted characters");
      }
  
  } catch (final Exception e) {
      LOGGER.error("Unable to prepare mail attachment : ", e);
      message = "Mail cannot be send, Unable to prepare mail attachment";
  }
  
  
  private boolean isSecurePath(String filePath) {
      String[] blackListChars = {".."};
      return (StringUtils.indexOfAny(filePath, blackListChars)&lt; 0);
  }
  </code></pre>
  
  <p>should i ignore the scan report or what would be the correct fix for this?</p>