Application Support directory to classpath
Michael Hall
mik3hall at gmail.com
Fri Mar 11 01:51:18 UTC 2016
I am trying to add some support for my application updating external files. Appstore is not necessarily a major concern, but I wouldn’t want to eliminate it as a possibility for no good reason by doing something unnecessarily violating some app store constraint. In some quick browsing I saw no real better choice to place the data than using the Application Support directory. If there is a better way of handling that now please let me know.
The problem is that the Application Support directory is a user one. /Users/<user_name_here>/Library/Application Support/<app_name>
The application has configuration property files that refer to these files by name. I can get around having to provide full path in these property files by only providing filename and having it in class path. The configuration code looks like it will then check for the file first in the ‘current working directory’ (user.dir?). Then checking for it in class path.
Fine, unless I want the application to be able to update the file. Class path entries are all internal to the application bundle which in the Application directory I don’t think is supposed to be updatable. The idea I just had was ok make some thing like Application Support/<app_name>/classes an entry in class path via an URLClassLoader. I am considering something similar for plugin code anyhow,jars,property files, everything going into Application Support. Does this seem like it would violate App Store/sandboxing or anything like that?
Michael Hall
More information about the macosx-port-dev
mailing list