0

I've built a Java application that takes in a directory full of files as input, performs different evaluations with them, and shows the user the results. The program also allows the user to save the current input (the files they just passed in) as historical data which the program can evaluate again with any new data the user passes in during subsequent runs of the program.

The program should know where this historical data is, so if the user selects an option like "include historical data", it can look straight into historical data folder and pull files from it that were saved there previously.

  1. Where should the program save this data to that it will be able to use later on? Is it a good idea to just keep a folder for this historical data in the project folder, say beside the source folder? Or should the data stored externally, outside the project?
  2. If I exported the entire program as an executable JAR which the user can run the entire project from, would it still be able to save files inside a folder like this?

Thanks, apologies for the stupid questions

ievinm
  • 53
  • 7
  • 1
    What kind of file would you be using? Your program can access it as long as you provide the correct path. – Logan Mar 05 '17 at 23:37
  • 1
    I believe this is going to depend on the OS and on local conventions. On Linux, I think one common way is to create a hidden folder (beginning with a period) in the user's home directory. But a user should be able to override the folder path with an environment variable or Java property. – ajb Mar 05 '17 at 23:41
  • 2
    Is there an installation process for this program? – Michael Markidis Mar 05 '17 at 23:43
  • @Logan Kulinski the files are just simple text files. So I could just have the program check inside the same folder each time it's run? The path inside the project would not change, i.e. it could always be stored in a data file, beside src for example. I am just wondering if this is a good idea in case I package the project as an executable or something like that. – ievinm Mar 06 '17 at 00:23
  • @MichaelMarkidis no not currently. The project is a JavaFx application with an interface from where a user can select input location, choose to save files, view output etc. Do you think it should do a proper install where it creates this folder? I like the idea of making the program an executable with everything packaged inside it, but then I am wondering where to save this data the application uses to. Would it be acceptable for the exe to just create a folder beside it for the data that it can look in and use? – ievinm Mar 06 '17 at 00:29
  • @ievinm Sure, you can make an installer. If this will be running on Windows, then you can install to the C:\Program Files or C:\Program FIles(x86) directory. Within the installation home (i.e. C:\Program Files\MyJavaProgram), you can store the historical data. – Michael Markidis Mar 06 '17 at 00:34
  • Do not attempt to store files in a program’s installation directory. All systems have an appropriate location for storing such things, which is always somewhere under the user’s home directory. See http://stackoverflow.com/questions/35388882/find-place-for-dedicated-application-folder . – VGR Mar 06 '17 at 05:08

0 Answers0