0

My JavaFX program needs to compute a file name path for various user-written files such as the product-specific preferences. For example, "Do you want to open your previous file the next time the program starts" and so on. I have successfully experimented with https://github.com/dlemmermann/JPackageScriptFX and "jpackage" for Windows at least, so it looks like I will shortly need a way to code, in a cross-platform manner, the "correct" path in which to store such files.

Is there a standard API or coding technique that will give me a file path that the program can write using user permissions that is "correct" for these native platforms?

tpc1095
  • 109
  • 1
  • 12
  • Closely related: https://stackoverflow.com/questions/585534/what-is-the-best-way-to-find-the-users-home-directory-in-java/586345 – fabian Jan 28 '20 at 18:26

1 Answers1

1

I am not aware of a single piece of software which would do that but I think my answer to this questions Java - Cross-platform filepath may be helpfull for you. It also mentions how the same can be achieved on Android for example.

mipa
  • 10,369
  • 2
  • 16
  • 35
  • OK, coding needed is well defined and the Java ecosystem has so far failed to provide an out-of-the-box solution for cross-platform software that I ought to use. If I open-source my library I'll be sure to provide this. – tpc1095 Feb 05 '20 at 13:30