I am trying to copy a file in my Class path to another temp location.
Here is the code for it:
InputStream inputStream = this.getClass().getClassLoader()
.getResourceAsStream(readmeFile);
Path path = Paths.get(tempFilesOutputPath + File.separator + readmeFile);
try {
Files.copy(inputStream, path, StandardCopyOption.REPLACE_EXISTING);
inputStream.close();
} catch (IOException e) {
throw e;
}
readMeFile has 2 pages, the copied file in the tempFilesOutputPath folder also has two pages but without any content.
Please let me know if I am making some mistake or it has to be done in a different way.
Cheers, Madhu