Package java.util.prefs

Examples of java.util.prefs.BackingStoreException


        }
        if(prefFile == null) {
            prefFile = new File(dir, "prefs.properties");
        }
        if(!dir.exists() && !dir.mkdirs()) {
            throw new BackingStoreException("Failed to create node directory " + dir.getPath() + ".");
        }
        FileOutputStream fos = null;
        try {
            fos = new FileOutputStream(prefFile);
            prefs.store(fos, name());
        }
        catch(IOException ioe) {
            throw new BackingStoreException(ioe);
        }
        finally {
            Util.closeStream(fos);
        }
    }
View Full Code Here


    /* (non-Javadoc)
     * @see java.util.prefs.AbstractPreferences#removeNodeSpi()
     */
    protected void removeNodeSpi() throws BackingStoreException {
        if(!Util.delTree(dir)) {
            throw new BackingStoreException("Failed to remove preferencese node " + dir.getPath() + ".");
        }
    }
View Full Code Here

    @Override
    protected void flushSpi() throws BackingStoreException {
      try {
        writePreferences();
      } catch (IOException ex) {
        throw new BackingStoreException(ex);
      }
    }
View Full Code Here

        {
            directoryService.getAdminSession().modify( dn, changes );
        }
        catch ( Exception e )
        {
            throw new BackingStoreException( e );
        }

        changes.clear();
        keyToChange.clear();
    }
View Full Code Here

        {
            directoryService.getAdminSession().delete( dn );
        }
        catch ( Exception e )
        {
            throw new BackingStoreException( e );
        }

        changes.clear();
        keyToChange.clear();
    }
View Full Code Here

        {
            directoryService.getAdminSession().modify( dn, changes );
        }
        catch ( Exception e )
        {
            throw new BackingStoreException( e );
        }

        changes.clear();
        keyToChange.clear();
    }
View Full Code Here

                children.add( ( String ) entry.getDn().getRdn().getNormValue() );
            }
        }
        catch ( Exception e )
        {
            throw new BackingStoreException( e );
        }

        return children.toArray( EMPTY_STRINGS );
    }
View Full Code Here

                keys.add( sa.getUpId() );
            }
        }
        catch ( Exception e )
        {
            throw new BackingStoreException( e );
        }

        return keys.toArray( EMPTY_STRINGS );
    }
View Full Code Here

    if (pathForNode.exists() == false)
    {
      if (pathForNode.mkdirs() == false)
      {
        throw new BackingStoreException("Failed to write config " + pathForNode); //$NON-NLS-1$
      }
    }

    final File target = new File(pathForNode, "prefs.properties");//NON-NLS
    if (target.exists() == false || target.lastModified() < lastModificationTime)
    {
      try
      {
        final OutputStream out = new BufferedOutputStream(new FileOutputStream(target));
        try
        {
          properties.store(out, "");
        }
        finally
        {
          out.close();
        }
      }
      catch (final Exception e)
      {
        throw new BackingStoreException("Failed to write config " + target); //$NON-NLS-1$
      }
    }
  }
View Full Code Here

            }
          }
          catch (final Exception e)
          {
            UncaughtExceptionsModel.getInstance().addException(e);
            throw new BackingStoreException("Failed to write config " + target); //$NON-NLS-1$
          }
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of java.util.prefs.BackingStoreException

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.