Package javax.jnlp

Examples of javax.jnlp.PersistenceService


  private static boolean loadWebStartProperties() {
    boolean loadOK = true;
    boolean firstTime = false;
    s_prop = new Properties();
   
    PersistenceService ps;

      try {
          ps = (PersistenceService)ServiceManager.lookup("javax.jnlp.PersistenceService");
      } catch (UnavailableServiceException e) {       
          ps = null;
          log.log(Level.SEVERE, e.toString());
          return false;
      }

      FileContents fc = null;
      try {
      fc = ps.get(getCodeBase());
    } catch (MalformedURLException e) {
      log.log(Level.SEVERE, e.toString());
      return false;
    } catch (FileNotFoundException e) {
      try {
        ps.create(getCodeBase(), 16 * 1024);
        ps.setTag(getCodeBase(), PersistenceService.DIRTY);
        fc = ps.get(getCodeBase());
      } catch (Exception e1) {
       
      }
    } catch (IOException e) {
      log.log(Level.SEVERE, e.toString());
View Full Code Here


    return firstTime;
   
  }

  private static void saveWebStartProperties() {
    PersistenceService ps;

      try {
          ps = (PersistenceService)ServiceManager.lookup("javax.jnlp.PersistenceService");
      } catch (UnavailableServiceException e) {
          ps = null;
          log.log(Level.SEVERE, e.toString());
          return;
      }
     
      try
    {
        OutputStream os = ps.get(getCodeBase()).getOutputStream(true);
      s_prop.store(os, "Adempiere");
      os.flush();
      os.close();
    }
    catch (Throwable t)
View Full Code Here

     */
    public void saveMuffins()
    {
        ui.debug("Saving muffins"); //$NON-NLS-1$

        PersistenceService ps = null;
        BasicService bs = null;

        try
        {
            ps = (PersistenceService) ServiceManager.lookup("javax.jnlp.PersistenceService")//$NON-NLS-1$
View Full Code Here

  /**
   * @see org.newdawn.slick.muffin.Muffin#saveFile(java.util.HashMap, java.lang.String)
   */
  public void saveFile(HashMap scoreMap, String fileName) throws IOException {

    PersistenceService ps;
    BasicService bs;
    URL configURL;

    try {
      ps = (PersistenceService) ServiceManager
          .lookup("javax.jnlp.PersistenceService");
      bs = (BasicService) ServiceManager
          .lookup("javax.jnlp.BasicService");
      URL baseURL = bs.getCodeBase();
      // System.out.println("CodeBase was " + baseURL);
      configURL = new URL(baseURL, fileName);
    } catch (Exception e) {
      Log.error(e);
      throw new IOException("Failed to save state: ");
    }

    try {
      ps.delete(configURL);
    } catch (Exception e) {
      Log.info("No exisiting Muffin Found - First Save");
    }
   
    try {
      ps.create(configURL, 1024); // 1024 bytes for our data

      FileContents fc = ps.get(configURL);
      DataOutputStream oos = new DataOutputStream(fc
          .getOutputStream(false));

      // scroll through hashMap and write key and value to file
      Set keys = scoreMap.keySet(); // get the keys
View Full Code Here

   */
  public HashMap loadFile(String fileName) throws IOException {
    HashMap hashMap = new HashMap();

    try {
      PersistenceService ps = (PersistenceService) ServiceManager
          .lookup("javax.jnlp.PersistenceService");
      BasicService bs = (BasicService) ServiceManager
          .lookup("javax.jnlp.BasicService");
      URL baseURL = bs.getCodeBase();
      URL configURL = new URL(baseURL, fileName);
      FileContents fc = ps.get(configURL);
      DataInputStream ois = new DataInputStream(fc.getInputStream());

      // read in data from muffin
      String key;

View Full Code Here

TOP

Related Classes of javax.jnlp.PersistenceService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.