> On Sep 20, 2022, at 6:04 PM, Michael Hall <mik3h...@gmail.com> wrote:
> 
> 
> 
>> On Sep 20, 2022, at 5:50 PM, Michael Hall <mik3h...@gmail.com 
>> <mailto:mik3h...@gmail.com>> wrote:
>> 
>> Given that this does break that, one possibility might be to include 
>> parameter changes in the Info.plist file. Some time back Apple java 
>> applications used to include a java dictionary in the plist that was more or 
>> less equivalent to the jpackage .cfg file. Maybe a override mechanism could 
>> be added to that which would be up to the developer to add in post 
>> processing. 
> 
> Never mind on this. That is no different really from the .cfg file and 
> doesn’t help with changing settings on the installed machine, user or system. 

Alexander,

If you don’t mind a little more opinion on this. When I started trying to 
figure out what to do with application external files on OS/X I began with the 
“Application Support” directories. But it occurred to me that most users rarely 
look at or often possibly aren’t even aware of the “Application Support” 
directory. So if I thought if I want the user to look at or actively manage a 
file I'd put it in their Documents directory. 

I also thought it might be nice going for different file types possibly on 
different platforms if you didn’t have to think about what would be the best 
place to put things. So I tried to come up with an API that would determine the 
locations for me and all I would indicate would be the data type. Like…

public enum DataTypes {
        /**
         * temporary
         */
        TEMP,
        /**
         * log file type
         */
        LOG,
        /**
         * cache file type
         */
        CACHE,
        /**
         * preferences file type
         */
        PREFERENCES,
        /**
         * permanent, critical, not user accessible
         */
        PERMANENT,
        /**
         * permanent, non-critical, user accessible
         */
        USER,
        /**
         * 
         * Documents folder
         */
        DOCUMENTS;
}

Example usages:
// default path
path = 
Application.getApplication().getFolder(DOCUMENTS).resolve("userprefs.xml”);
Although that pretty obviously resolves to the Documents directory.

Or 
Path logDir = Application.getApplication().getFolder(LOG);

Where the API determines the best location for log files and you don’t have to 
be concerned.
Not so clear exactly where that might be, but you don’t really have to worry 
about it.


Reply via email to