#vulnerable code 
                              @Override
  public void copyToLocalRoot(String remoteSourceRelativePath, String localDestinationRoot) throws IOException {
    Path source = new Path(getAbsoluteRemotePath(remoteSourceRelativePath));
    File destination = new File(localDestinationRoot + "/" + new Path(remoteSourceRelativePath).getName());
    LOG.info("Copying remote file " + source + " to local file " + destination);
    InputStream inputStream = getInputStream(remoteSourceRelativePath);
    FileOutputStream fileOutputStream = new FileOutputStream(destination);
    BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(fileOutputStream);
    // Use copyLarge (over 2GB)
    try {
      IOUtils.copyLarge(inputStream, bufferedOutputStream);
      bufferedOutputStream.flush();
      fileOutputStream.flush();
    } finally {
      inputStream.close();
      bufferedOutputStream.close();
      fileOutputStream.close();
    }
  } 
                            #location 18 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                              @Override
  public void copyToLocalRoot(String remoteSourceRelativePath, String localDestinationRoot) throws IOException {
    Path source = new Path(getAbsoluteRemotePath(remoteSourceRelativePath));
    File destination = new File(localDestinationRoot + "/" + new Path(remoteSourceRelativePath).getName());
    LOG.info("Copying remote file " + source + " to local file " + destination);
    InputStream inputStream = getInputStream(remoteSourceRelativePath);
    FileOutputStream fileOutputStream = new FileOutputStream(destination);
    try {
      IOStreamUtils.copy(inputStream, fileOutputStream);
      fileOutputStream.flush();
    } finally {
      inputStream.close();
      fileOutputStream.close();
    }
  }