code: public File getTempFileFromArchive(File rootDirectory) throws IOException {
          InputStream is = getInputStream();
          File tmpFile;
          if(rootDirectory != null){
              //Maintain original file names, as it's going in a directory...
              tmpFile = new File(rootDirectory, FilenameUtils.getName(path));
          } else {
              tmpFile = Files.createTempFile(FilenameUtils.getName(path), "tmp").toFile();
          }
  
          tmpFile.deleteOnExit();
  
          BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(tmpFile));
  
          IOUtils.copy(is, bos);
          bos.flush();
          bos.close();
          return tmpFile;
      }
docs: Get a temp file from the classpath, and (optionally) place it in the specified directory<br>
  Note that:<br>
  - If the directory is not specified, the file is copied to the default temporary directory, using
  {@link Files#createTempFile(String, String, FileAttribute[])}. Consequently, the extracted file will have a
  different filename to the extracted one.<br>
  - If the directory *is* specified, the file is copied directly - and the original filename is maintained
  
  @param rootDirectory May be null. If non-null, copy to the specified directory
  @return the temp file
  @throws IOException If an error occurs when files are being copied
  @see #getTempFileFromArchive(File)