Package java.util.prefs

Examples of java.util.prefs.BackingStoreException


        for (Entry<String, Integer> entry : map.entrySet()) {
            Integer index = getIndex(persist, statistics.name, entry.getKey());
            byte[] valueArray =  integerToByteArray(entry.getValue());
            int possition = index * BYTES_IN_INT;
            if (possition >= MAX_BYTE_ARRAY_LENGTH){
                throw new BackingStoreException("VALUE ARRAY IS TWO LONG");
            }
            System.arraycopy(valueArray, 0, data, possition, BYTES_IN_INT);
        }
        try {
            putByteArray(key, data);
        } catch (IllegalArgumentException exc) {
            throw new BackingStoreException(exc);
        }
    }
View Full Code Here


        Integer index = cache.get(hashCode);
        if (index == null) {
            Statistic stat = Statistic.getExists(statName);
            index = Prefset.getByteArrayIndex(em, stat, name);
            if (cache.containsKey(hashCode)){
                throw new BackingStoreException("HashCode collision for " + name);
            }
            cache.put(hashCode, index);
            getIndexCache(statName).put(index, name);
        }
        return index;
View Full Code Here

            out = new FileOutputStream( file );
            root.exportSubtree( new BufferedOutputStream( out ) );
        }
        catch ( Exception e )
        {
            throw new BackingStoreException( e );
        }
        finally
        {
            if ( out != null )
            {
View Full Code Here

            out = new FileOutputStream( file );
            root.exportSubtree( new BufferedOutputStream( out ) );
        }
        catch ( Exception e )
        {
            throw new BackingStoreException( e );
        }
        finally
        {
            if ( out != null )
            {
View Full Code Here

    final String spUserdir = "user.dir";
   
    final String path = PreferencesUtils.getSystemValue(FilePreferencesFactory.ENV_PROP_PREFS_PATH, spUserdir);
       
    if (path == null) {
      throw new BackingStoreException(
        "No back store found for FilePreferencesApi. Please configure -D" +
        FilePreferencesFactory.ENV_PROP_PREFS_PATH  +
        " on JVM");
    }
   
    if (path.endsWith("\\true")) {
      System.out.println("-Duser.dir: " + System.getProperty("user.dir"));
      System.out.println("-D" + FilePreferencesFactory.ENV_PROP_PREFS_PATH + ": " + System.getProperty(FilePreferencesFactory.ENV_PROP_PREFS_PATH));
      System.out.println("path: " + path);
    }
    final File res = new File(path);
   
    if (!res.exists()) {
      throw new BackingStoreException(
          "The path " +
          res.getAbsolutePath() +
          " does not exists.");     
    }

    if (!res.isDirectory()) {
      throw new BackingStoreException(
          "The path " +
          path +
          " is not a directory.");     
    }
   
View Full Code Here

    createCursor();
  }
 
  private void createCursor() throws BackingStoreException {
    if(!dbc.isCapped()) {
      throw new BackingStoreException("Unable to create cursor: collection is not capped");
    }
    cursor = dbc.find(query).sort(new BasicDBObject("$natural", 1)).addOption(Bytes.QUERYOPTION_TAILABLE).addOption(Bytes.QUERYOPTION_AWAITDATA);
  }
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( entry.getDn().getRdn().getNormValue().getString() );
            }
        }
        catch ( Exception e )
        {
            throw new BackingStoreException( e );
        }

        return children.toArray( EMPTY_STRINGS );
    }
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.