Package java.util.prefs

Examples of java.util.prefs.BackingStoreException


      queryValueMethod.setAccessible(true);

      int[] result = (int[]) openKeyMethod.invoke(null, hive, stringToByteArray(keyName), KEY_READ);
      if (result[ERROR_CODE] != ERROR_SUCCESS) {
        if (result[ERROR_CODE] == ERROR_FILE_NOT_FOUND) {
          throw new BackingStoreException("Not Found error opening key " + keyName);
        } else {
          throw new BackingStoreException("Error " + result[ERROR_CODE] + " opening key " + keyName);
        }
      }

      int hKey = result[NATIVE_HANDLE];

      byte[] b = (byte[]) queryValueMethod.invoke(null, hKey, stringToByteArray(valueName));
      closeKeyMethod.invoke(null, hKey);

      if (b == null) {
        return null;
      } else {
        return byteArrayToString(b);
      }
    } catch (InvocationTargetException e) {
      throw new BackingStoreException(e.getCause());
    } catch (NoSuchMethodException e) {
      throw new BackingStoreException(e);
    } catch (IllegalAccessException e) {
      throw new BackingStoreException(e);
    }
  }
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().getValue() );
            }
        }
        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

  private void checkException() throws BackingStoreException {
    switch (result) {
    case NORMAL:
      return;
    case backingException:
      throw new BackingStoreException("test");
    case runtimeException:
      throw new MockRuntimeException("test");
    }
  }
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

    if (pathForNode.exists())
    {
      final File target = new File(pathForNode, "prefs.properties");//NON-NLS
      if (target.delete() == false)
      {
        throw new BackingStoreException("Unable to delete node-backend");
      }
      if (pathForNode.delete() == false)
      {
        throw new BackingStoreException("Unable to delete node-backend");
      }
    }
  }
View Full Code Here

      return encoded.toString();
    }
    catch (NumberFormatException nfe)
    {
      nfe.printStackTrace();
      throw new BackingStoreException("Failed to decode name: " + path);
    }
  }
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.