Closed MeerKatDev closed 4 years ago
@MeerKatDev have you checked the documentation on working with files? See here: https://twitter.github.io/finatra/user-guide/files/index.html. By default we read files from the classpath and it is not cleae what "copy some text file into the classpath during runtime" means, so it would be great if you could provide steps to reproduce.
FWIW, we have many tests that create files at the beginning of the test that are then deleted in the tear down, so it would be great if you could detail exactly what you're doing so we could better understand what is not working.
I know that page quite well, as it's everything there is on the internet on the topic. That phrase means exactly what it says.
Finatra will not see this file and give "path not found"
Also, the static-files link of that page is broken.
@MeerKatDev thanks for providing more information. The classpath is read by the Java process when it is started, for what you are trying to do, you should instead refer to this location via the -local.doc.root
flag (as shown in the tests).
Thanks for pointing out the broken link -- the v1 documentation that it is pointing to was removed some time ago but it does not look like this section was edited.
you are actively discouraging the use of local.doc.root, does that mean that it is discouraged to serve files created during runtime?
@MeerKatDev
Depends on your use case. If serving files created at runtime is required, the only option is -local.doc.root. Discouraged because depending on how the routes are setup, you could be exposing your filesystem to the internet.
I think the question has been answered. Please feel free to re-open if not. Thanks!
Expected behavior
As per title - I would like to create a file during execution and serve it as an HTTP response
Actual behavior
It seems like it doesn't see that file, and serves only files that were present at compile time.
Steps to reproduce the behavior
If I copy some text file into the classpath during runtime, Finatra will not see it. The file needs to be there already at compile time.