NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Non-default Preferences (how to push new conf file)

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users
View previous topic :: View next topic  
Author Message
Peter Hansson
Posted via mailing list.





PostPosted: Sat Jan 07, 2017 10:49 am    Post subject: Non-default Preferences (how to push new conf file) Reply with quote

Inside my NB Platform appl, I'm working with an external library which for various reasons require me to use a non-default implementation of Preferences. I do this by setting System Property 'java.util.prefs.PreferencesFactory' in my module installer class.


Unfortunately this doesn't work. The reason is long and winded but basically comes down to the fact that the Platform uses Preferences too, and although the Platform's implementation, NbPreferences, avoids to install itself as the default (allowing you to use your own Preferences implementation for the stuff not related to Platform) it nevertheless *references* the Preferences class during startup and this is enough for the JDK defaults to get set in stone from that point onwards. Setting that system property later on doesn't help. (look in the source for Preferences and you see why).


For this reason I need to set the aforementioned System Property very early, i.e. already on startup, which would mean doing it in the application's conf file. But this is an application already deployed to many, many workstations. As far as I know I cannot just push out a new conf file using the Autoupdate mechanism.


What to do?  What are my options?


Thanks


Peter
Back to top
ortega



Joined: 06 Jul 2015
Posts: 35

PostPosted: Fri Jan 13, 2017 1:28 pm    Post subject: Reply with quote

Hi Peter.

You try make you personal .conf file and put in nbproject folder.
The you .conf file must have the same name of your project.

It may be possible to replace the original file programmatically in old installations with AutoUpdate.

I hope it helps.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo