AppSettingsGet.java :  » Mobile » bluetoothremote » com » costeaalex » blueserver » settings » Java Open Source

Java Open Source » Mobile » bluetoothremote 
bluetoothremote » com » costeaalex » blueserver » settings » AppSettingsGet.java
/*
 * Get application settings from file 
*/

package com.costeaalex.blueserver.settings;

import java.io.File;
import java.io.FileInputStream;
import java.io.ObjectInputStream;

public class AppSettingsGet
  {
  
  private File f=new File("Settings.dat");
  private FileInputStream fR;
  private ObjectInputStream oIS;
  private Settings settingsObj;
  
  public AppSettingsGet()
    {
    
    }
  
  public Settings getSettings()
    {
    if(f.exists())
      {
      try
        {
        fR=new FileInputStream(f.getAbsolutePath());
        oIS=new ObjectInputStream(fR);
        settingsObj=(Settings) oIS.readObject();
        return settingsObj;
        } 
      catch (Exception e)
        {
        e.printStackTrace();
        }
      }
    
    return null;
    }
  
  }
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.