I want to access some external htm files in my project by following code -
sb = “hpgames/crossword/1/index.htm”;
fileName = “index.htm”;
try {
File file = ResourceUtils.getFile(sb);
Path filePath = Paths.get(sb);
ByteArrayInputStream in = new ByteArrayInputStream(FileUtils.readFileToByteArray(file));
StreamResource resource = new StreamResource(fileName, () → in);
StreamRegistration registration = VaadinSession.getCurrent().getResourceRegistry().registerResource(resource);
frame1.setSrc(registration.getResourceUri().toString());
} catch (IOException e) {
throw new RuntimeException(e.getMessage(), e);
}
I am getting filenotfound exception if i copy files in /META-INF/resources/hpgames/crossword/1/ folder.
Where should i copy files on server (folder location)?
thanks
regards
Umesh