Saving settings between sessions

I've tried to break this post up into sections for your reading ease.
The question is relatively simple, but I have a feeling the solution won't be so pleasant.
Question:
I have a Java Application that I wish to save various settings from between sessions, so that the next time I start it up, those settings are restored. What would be the best way to do this?
Solution Ideas:
If I were programming for windows, the solution would be simple: the registry. But this is a cross-platform application. The obvious alternative would be to store the settings in a file. I can do that, but to have 2 files, one being probably just 2 bytes in size, is not terribly appealing, especially if the user wishes to store the program on the desktop. The third and most appealing option that I thought up would be to store these settings within the Jar file itself, but I have yet to figure out how.
If anyone has any better suggestions, I would be more than happy to hear them.
Storing In Jar - What I know and don't know
As for storing the settings in the JAR, I've been trying various methods to get to the JAR, but have yet to even figure out how to get the JAR's File Location. I know I'm on the right track with the JarFile, JarInputStream, and JarOutputStream classes, but they offer no way to get the current Jar. I've tryed getting the source's location path with this ugly thing:
getClass().getProtectionDomain().getCodeSource().getLocation().getPath()
but that just returns the parent folder - not the Jar file
I've also seen getClass().getResourceAsStream(from) but that's only an InputStream, where there is no desired OutputStream counterpart.
Much Thanks in advance,
-IsmAvatar

That's perfect. Thanks a bunch.
Does it matter that Preferences and most of the
methods are Abstract, or is that just there in case
some class wishes to overwrite those methods or
something?No it doesn't matter. It's like that because there are many different implementations. The default behaviour on windows is to store the data in the registry.
Kaj

Similar Messages

  • Why does Firefox 8 lose its settings between sessions?

    Version 8 does not hold its settings from one Windows session to another. I have to keep turning the menu bar back on and resizing the window (the default of the left half of the screen -- absolutely WORST place it could be -- keeps coming back!). Fix this or you're going to start losing users by the thousands to Chrome, which never has had these problems. As well, I click Submit Feedback button and nothing happens, the bookmarks toolbar disappears, and the tabs go up top. HORRIBLE!!!

    See:
    *http://kb.mozillazine.org/Preferences_not_saved
    *https://support.mozilla.com/kb/Preferences+are+not+saved

  • Why is it so chaotic to Sync Settings between apps of Adobe CC 2014? (and to transfer settings from CC to CC 2014)

    Although, in general I'm a big fan of the Adobe Products and the CC Idea, I think that some parts of it were not ready for launch.
    The part that mostly disturbs me is the settings syncing / Update. (Or "Seamless Update")
    Concerning the updates:
    I had own workspace in all the CC Adobe Apps, the only CC 2014 App that imported the previous settings in the new app at the first start was Photoshop.
    Indesign made it through the Edit => Migrate previous local settings
    Illustrator by copying the settings files manually
    in Dreamweaver and Flash I had to recreate the workspace manually (which finally took less time then trying  to sync settings.)
    So long for the Seamless update that wasn't so seamless.
    Concerning the settings syncing
    Why could'nt adobe have the settings syncing working the same way in all it's CC 2014 applications? ( File Menu on PC / The Name of the App Menu on Mac => Sync Settings, upload or download settigns; done!)
    Instead (on mac) :
    In Photoshop: Photoshop => my account name => upload and download settings ( and no way to import settings from previous version )
    In Illustrator: Illustrator => my account name => Sync Settings ( and I cannot import settings from the previous version, only from the same version )
    in Indesign: Indesign => my account name => Sync Settings ( and the only CC 2014 App where the "Migrate previous local settings" function is working )
    in Dreamweaver => my account name => Sync Settings and a button on the far right of the upper toolbar (and no way to import previous version's local settings)
    in Flash => my account name => Sync Settings and a button on the far right of the upper toolbar (and no way to import previous version's local settings)
    in Premiere Pro => my account name => Sync Settings with the possibility to clear settings and to use settings from a different account
    Appart from that update and syncing chaos, the syncing between two computers simply doesn't seem to work ( at least for me).
    I have a computer at work and a laptop at home and I'd like to have the same workspace in my apps at home as at work for occasional home working.
    I created and configured my custom workspaces on the mac at work and then synced settings (respectively uploaded them in Photoshop). I had cleared all the saved settings from the Creative Cloud online account first.
    I arrived at home, tried to sync settings but no workspace was implemented. (and before you ask, yes i had checked that the workspaces should be synced and that, on the laptop at home, the cloud settings should be applied.)
    After few tryings I gave up and ended up recreating my setings on both machine. Frankly I don't know why the sync settings are for, since they just don't seem to work.
    I really think you should rethink this feature: make it simpler, working THE SAME WAY in all Adobe apps, and, well, just working!
    I'd just like to log into creative cloud an any computer, sync settings, and be able to use my custom created workspace.
    I posted this in the Cloud Forum since, in my opinion, the settings syncing is a cloud matter and not a matter of each app individually.

    https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform for bugs or feature requests
    Error: "Unable to sync files"

  • Losing Logic instrument presets between sessions

    PLEASE HELP! I can't find the answer to this anywhere. Why do the instruments I use in my logic 8 sessions reset themselves when i return to the same session? I am Saving my sessions and doing all I can to retain it but when i come back to the session the instruments have changed from what i saved them as when i last left the session into what seems like random instruments. Its killing me!

    cool i thought it may have been that, but surely logic by version 8 have consolidated your work space so you don't have to save every setting on every instrument? and do these settings get saved in the session folder or in some random part of the program file? i'm new to logic from cubase and reason and these things just don't make sense yet, it's regarded as one of the best though so i'll persevere. thanks a lot for the help erik!

  • Battery not saving settings in Logic

    Anyone else having trouble saving settings in Battery?
    Here's an example of the problem:
    1. Open Session1 in Logic (X or 9), open an instance of Battery, open a kit (e.g. 909 Detailed Kit), save, close.
    2. Open Session2 in Logic (X or 9), open an instance of Battery, open a kit (e.g. Reggaetoni Kit), save, close.
    3. Open Session1 again, Battery reverts to Reggaetoni kit (from the last open session, instead of the current session).
    Am I missing something obvious? Could this be a Battery bug? I have searched the interwebs for some info on this, and I seem to be the only one with this issue. 
    Thoughts?
    Thanks!
    js

    Maybe you missed previous posts.
    Omnisphere is not compatible with Logic's Preset Settings feature. (Both in L8 and L9). The last Omnisohere update fixed a few bugs but not all. For one thing, when you save a patch, Omnisphere will automatically turn on Stack mode, which could completely change the sound if it had Live mode on.
    There was a response from some Spectrasonics guy here on the forum who promised a fix, but given the track record of Spectrasonics lately, I wouldn't get my hopes up to high:
    * Atmosphere/Trilogy Wrapper disaster (aka unusable)
    * Omnisphere compatibility issues with Logic
    * Strange Delay of Trillion (death of the shipping person two weeks before the release date causes a 4 month delay???)
    Too bad that they still produce the best sounding plugins on the market so it is hard to avoid them.

  • TOC does not retain bookmarking between sessions

    Hello,
    One of my complete courses developed in Captivate for SumTotal LMS is not retaining bookmarking between sessions.
    When you re-enter the course, some of the bookmarking is lost.
    Does anyone know of a fix for this issue?
    Thank you ahead of time.
    Chuck

    Hello Lilybiri,
    Yes, Self Paced Learning is selected in TOC settings.
    The individual that was testing the functionality was viewing the content linear.
    He left the course after viewing about 10 slides out of 85.
    When he returned to the course, the first 10 slides did not have a checkmark.
    It did return him to the spot that he left off, and started placing checkmarks from their.
    No issues with the knowledge checks  or final quiz not working.
    Only issue is that the checkmarks were no longer present for previously viewed section.
    He stated that this is an issue.
    I do not see it as such as long as performance is not compromised.

  • History not retrained between sessions, tho set to do so !?

    Browsing several sites 3 x wk'ly to read commentary,but this history is not retained between sessions tho set to do so as far as I can see after perusing Firefox repeatedly over several wks....not browsing privately , etc....recent trovi malware infestation seems negligible,???, tho I still see it in IE. Any suggestions , Thanks....L F

    In case you are using "Clear history when Firefox closes":
    *do not clear the Browsing History
    *Tools > Options > Privacy > Firefox will: "Use custom settings for history": [X] "Clear history when Firefox closes" > Settings
    *https://support.mozilla.org/kb/remove-browsing-search-and-download-history
    Note that clearing "Site Preferences" clears all exceptions for cookies, images, pop-up windows, software installation, passwords, and other website specific data.
    There is software like Advanced SystemCare with its Surfing Protection feature that can protect files in the Firefox profile folder against changes.
    If you have such software then check the settings or uninstall this software.
    Your System Details list shows that you have a user.js file in the profile folder to initialize prefs each time Firefox starts.
    The user.js file is only present if you or other software has created this file and normally it wouldn't be there.
    You can check its content with a plain text editor (right-click: Open with) if you didn't create this file yourself.
    The user.js file is read each time Firefox is started and initializes preferences to the value specified in this file, so preferences set via user.js can only be changed temporarily for the current session.
    You can use this button to go to the currently used Firefox profile folder:
    *Help > Troubleshooting Information > Profile Directory: Show Folder (Linux: Open Directory; Mac: Show in Finder)
    Delete a possible user.js file and numbered prefs-##.js files and rename (or delete) the prefs.js file to reset all prefs to the default value including prefs set via user.js and prefs that are no longer supported in the current Firefox release.
    *http://kb.mozillazine.org/Preferences_not_saved

  • What is the difference between Session timeout and Short Session timeout Under Excel Service Application -- session management?

    Under Excel Service Application --> session management; what is the difference between Session timeout and Short Session timeout?

    Any call made from the API will automatically be set to the “Session Timeout” period, no matter
    what. Calls made from EWA (Excel Web Access) will get the “Short Session Timeout” period assigned to it initially.
    Short Session Timeout and Session Timeout in Excel Services
    Short Session Timeout and Session Timeout in Excel Services - Part 2
    Sessions and session time-outs in Excel Services
    above links are from old version but still applies to all.
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • The Creative Cloud application becomes inoperable continually on both my Windows 7 and 8.1 operating systems. I'm tired of re installing the application after deleting the OOBE file to get updates and syn settings between computers for Photoshop. Is this

    The Creative Cloud application becomes inoperable continually on both my Windows 7 and 8.1 operating systems. I'm tired of re installing the application after deleting the OOBE file to get updates and syn settings between computers for Photoshop. Is this an endemic problem with others? I'm using Google Chrome as my browser. Is this an issue with the problem?

    Similar problem just happened to me with the Creative Cloud Update 1.7.1.418—slightly different so I thought I'd share. I have multiple Adobe Creative Cloud programs installed on my computer, all working just fine. I updated the Cloud App to the latest version and then it shows me that I have only one program installed! All my previously installed programs (Photoshop and the like) still work but show as "install" instead of "Up to date". Initially I thought I'd have to re-install the Cloud app or recreate the OPM data base but then I noticed that some of the Cloud app preferences (Apps > Settings > App Language) were different to what I had set previously. I use English (International) language, the update had reverted the app back to English (North American). I flicked back to my previous language and bam, all my apps now show as being installed correctly.

  • Can Lightroom import/use Camera Raw saved settings from Photoshop CS2?

    Before getting LR, I used CS2. I would load my CR2 files from my cam into CS2 and Camera Raw would pop up for raw editing. I would edit the photos, but sometimes save the settings to a XMP file. Those files would then be available for any raw photo, i just had to select that setting.
    Is there any way to import those saved settings files into LR? There's just text in them, what about importing the text somewhere? I dunno... I really want to use these settings files in LR!!
    Also, If I change things to a photo in LR, does it have a similar save-the-edit feature like camera raw?
    Thanks!!
    -Ziv

    If you import images with those side car files, you'll get those settings automatically. If you've already imported the images without the side cars somehow, you can put the side cars back and do read metadata from files.

  • DVD Studio Pro overriding Energy Saving Settings - Screen always on

    Hello
    I am a bit upset about DVD Studio Pro overriding the energy saving settings. It means if you do a serious render you will find yourself with the monitor on for hours and days. On the Imacs you can't even fully dim down the screen to switch it of manually.
    I know about the possibility to do a background render. But it doesn't make sense to me that DVD Studio keeps the screen on. I don't see why I have to go crooked ways to have something very normal.
    There is no need for DVD studio behaving like this, it only raises energy consumption unnecessarily.
    I hope Apple will fix this or explain in reasonable ways why it does like this.
    And is there maybe a way to hack DVD Studio in a way it doesn't behave like this, apart from doing the background render?
    Thanks
    Message was edited by: padre999

    A common way to solve it is to download and install the proapplications support file:
    http://www.apple.com/support/downloads/proapplicationsupport31macosx104.html
    It's not a guaranteed winner, but it has worked for countless folks.

  • Difference between Session Facade and Business Delegate design patterns

    Can someone tell me the differences between Session Facade and Business Delegate design patterns

    1. Session Facade decouples client code from Entity beans introducing session bean as a middle layer while Business Delegate decouples client code from EJB layer ( Session beans).
    2. SF reduces network overhead while BD reduces maintenance overhead.
    3. In SF any change in Session bean would make client code change.
    While in DB client is totally separate from Session bean because BD layer insulate client from Session beans(EJB layer).
    3. In only SF scenario, Client coder has to know about EJB programming but BD pattern no EJB specialization needed.
    4.SF emphasizes on separation of Verb, Noun scenario while BD emphasizes on separation of client(presentable) and EJB layer.
    Anybody pls suggest more differences ?

  • Connection Settings between Content Server and DMS server

    Dears,
    I installed DMS server and Content Server,Now I need to do connection settings between these server.
    Both are installed on seprate servers.
    So please suggest what are the steps to set connection between these servers.
    Shivam

    Hi all,
    I installed the Content Server with DB instance.  ECC on AIX and the Content Server on Windows are on different domains and wanted to integrate. After the installation what I did is as follows...
    I am trying to create the Content Repository using the Tx- OAC0, given the the following details as
    Content Repository name--- DMS_xxxx
    Document Area - DMS
    Storage Type -- HTTP Content Server
    Version -0046
    HTTP Server --- fully qualified host name of the Content Server
    Port Number --- 1090
    HTTP Script --- ContentServer\ContentServer.dll
    Physical Basic Path--- (initially) -
    /usr/sap/<ECCSID>/SYS/global/
                                        (modified) --- E:\ContentServer\ -
    not available, thought it will create, even created later
    Physical archive path --- SAME as  Physical Basic Path
    When I check the connection, I am getting an error "Content repository DMS_xxxx does not exists.
    When I check Tx- CSADMIN-- it gives an error saying the "HTTP error : 4010 (authorized) ' Permission denied: adminContRep&configSet"
    I am not sure what user should i use for this and what should be  the information of ContentStorageHost, ContentStorageName and Storage need to be provided.
    Please help me in this....
    Regards
    Krishna

  • CDE Front Panel change between sessions

    I'm trying to change the front panel workspace buttons so they change between sessions. However, when I log out and back in again they are reset back to "One", "Two", "Three" and "Four".
    After I changed the label on one of the buttons, I brought up the Style manager and selected "Set As Home". I went to the $HOME/.dt/sessions/home directory and found the dt.resources file did contain the new label for the button. However, when I log out and back in again the buttons are not set to the new value. What am I doing wrong, please?

    Hi Filip,
    About the 6 second delay. Did you changed anything in the "function generator.vi"?
    And when you change the amplitude of your signal, is it first displayed on the front panel,
    or does your output change first.
    I am asking you this because i have trouble opening the example. All our pc's have Labview 8.5 installed
    and 6.1 is just abit to long ago to be compeletly compatible. So i need to make an image of a pc then uninstall
    Labview 8.5 and install an older version. I can open the vi with 8.5 but many subvi's are missing and i can't run
    it so i can't see if i have a problem.
    So let me know if you changed anything? From what i have seen there isn't anything wrong with the vi.
    I think the problem is the following. When we select continuous generation we make the hardware fill a buffer with samples.
    so the buffer can be read every time at the same moment and the signal appears continuous. But let's say we change the signal,
    then it will only disapear after all the pervious buffer items are read out. So i think if you make the buffer smaller the delay should be smaller.
    Perhaps you can take a look at that too.
    Kind Regards,
    Joris Donders
    National Instruments
    Applications Engineering
    www.ni.com/support

  • MSI GT70 not saving settings

    Hello, I have a new GT70 2oc-008us and when I purchased the laptop I also bought a Samsung 840 120gb ssd and I installed and migrated the OS myself. Everything else works fine like games but I have this weird issue with non of the MSI installed programs saving their setting after a shutdown. For example, the killer network manager is not saving the setting in which it shows the dialog on close or auto updating which is kinda annoying and the sound blaster cinema is not saving settings like when I plug in my headphones it goes to 5.1 surround instead of headphones or when I play around with the equalizer or the surround sound option to optimize movie or gaming experience. This is quite annoying because I play a lot of games and watch a lot of movies and I do not like constantly changing my settings. So if you know of a solution to my problem could you please help me out?
    Thank you

    For the toolbar problem delete the com.apple.Safari plist from Home/Library/preferences. To have a link open in a new tab you must command-click on the link and have the appropriate box checked in Safari>Preferences>Tabs.

Maybe you are looking for

  • How to make a permanent change to AW margins

    I had to do a erase and re-install for leopard. I had changed the margins so that they were a permanent change but the re-install brought be back to the original default settings. I can not find any notes how I did it, and there is nothing under marg

  • Video gets SOFT after using export/ media/match sequence settings

    Never had this on any other version of PP.  PC based 64bit Win 7 EX: I get a job delivered to me that was shot on mini dv (now on a HD) & the clips are all seperated as they were shot. I put them on the TL & want to make 1 long clip out of them. I ex

  • What is the latest version of Campus management

    hi All, I want to know is there any new version release after Campus 4.72. If it is so. what is the new functionalities in New Version. Please sugguest Regards, amit

  • Financial Shared Services

    Hi all, What are  financial shared Services ? How they are related with SEM. please explain in detial why any company  make use of financial shared services. full points awarded regards, veer

  • Can we deploy a instance to AWS China data center?

    Can we deploy a instance to AWS China data center?  So far looks like AWS china data center is not in drop down list box.