Package org.codehaus.plexus.registry

Examples of org.codehaus.plexus.registry.RegistryException


        if ( !writeFile( "user configuration", userConfigFilename, contents ) )
        {
            fileLocation = altConfigFilename;
            if ( !writeFile( "alternative configuration", altConfigFilename, contents ) )
            {
                throw new RegistryException(
                    "Unable to create configuration file in either user [" + userConfigFilename + "] or alternative ["
                        + altConfigFilename
                        + "] locations on disk, usually happens when not allowed to write to those locations." );
            }
        }
View Full Code Here


        String contents = "<configuration />";
        if ( !writeFile( "user configuration", userConfigFilename, contents ) )
        {
            if ( !writeFile( "alternative configuration", altConfigFilename, contents ) )
            {
                throw new RegistryException( "Unable to create configuration file in either user ["
                    + userConfigFilename + "] or alternative [" + altConfigFilename
                    + "] locations on disk, usually happens when not allowed to write to those locations." );
            }
        }

        try
        {
            ( (Initializable) registry ).initialize();

            for ( RegistryListener regListener : registryListeners )
            {
                addRegistryChangeListener( regListener );
            }
        }
        catch ( InitializationException e )
        {
            throw new RegistryException( "Unable to reinitialize configuration: " + e.getMessage(), e );
        }

        triggerEvent( ConfigurationEvent.SAVED );

        return registry.getSection( KEY + ".user" );
View Full Code Here

        String contents = "<configuration />";
        if ( !writeFile( "user configuration", userConfigFilename, contents ) )
        {
            if ( !writeFile( "alternative configuration", altConfigFilename, contents ) )
            {
                throw new RegistryException( "Unable to create configuration file in either user ["
                    + userConfigFilename + "] or alternative [" + altConfigFilename
                    + "] locations on disk, usually happens when not allowed to write to those locations." );
            }
        }

        try
        {
            ( (Initializable) registry ).initialize();

            for ( RegistryListener regListener : registryListeners )
            {
                addRegistryChangeListener( regListener );
            }
        }
        catch ( InitializationException e )
        {
            throw new RegistryException( "Unable to reinitialize configuration: " + e.getMessage(), e );
        }

        triggerEvent( ConfigurationEvent.SAVED );

        return registry.getSection( KEY + ".user" );
View Full Code Here

        String contents = "<configuration />";
        if ( !writeFile( "user configuration", userConfigFilename, contents ) )
        {
            if ( !writeFile( "alternative configuration", altConfigFilename, contents ) )
            {
                throw new RegistryException( "Unable to create configuration file in either user ["
                    + userConfigFilename + "] or alternative [" + altConfigFilename
                    + "] locations on disk, usually happens when not allowed to write to those locations." );
            }
        }

        try
        {
            ( (Initializable) registry ).initialize();

            for ( RegistryListener regListener : registryListeners )
            {
                addRegistryChangeListener( regListener );
            }
        }
        catch ( InitializationException e )
        {
            throw new RegistryException( "Unable to reinitialize configuration: " + e.getMessage(), e );
        }

        triggerEvent( ConfigurationEvent.SAVED );

        return registry.getSection( KEY + ".user" );
View Full Code Here

        String contents = "<configuration />";
        if ( !writeFile( "user configuration", userConfigFilename, contents ) )
        {
            if ( !writeFile( "alternative configuration", altConfigFilename, contents ) )
            {
                throw new RegistryException( "Unable to create configuration file in either user ["
                    + userConfigFilename + "] or alternative [" + altConfigFilename
                    + "] locations on disk, usually happens when not allowed to write to those locations." );
            }
        }

        try
        {
            ( (Initializable) registry ).initialize();

            for ( RegistryListener regListener : registryListeners )
            {
                addRegistryChangeListener( regListener );
            }
        }
        catch ( InitializationException e )
        {
            throw new RegistryException( "Unable to reinitialize configuration: " + e.getMessage(), e );
        }

        triggerEvent( ConfigurationEvent.SAVED );

        return registry.getSection( KEY + ".user" );
View Full Code Here

        {
            FileUtils.writeStringToFile( file, "<configuration/>", "UTF-8" );
        }
        catch ( IOException e )
        {
            throw new RegistryException( "Unable to create configuration file: " + e.getMessage(), e );
        }

        try
        {
            ( (Initializable) registry ).initialize();

            for ( Iterator i = listeners.iterator(); i.hasNext(); )
            {
                RegistryListener l = (RegistryListener) i.next();

                addRegistryChangeListener( l );
            }
        }
        catch ( InitializationException e )
        {
            throw new RegistryException( "Unable to reinitialize configuration: " + e.getMessage(), e );
        }

        return registry.getSection( KEY + ".user" );
    }
View Full Code Here

        {
            FileUtils.writeStringToFile( file, "<configuration/>", "UTF-8" );
        }
        catch ( IOException e )
        {
            throw new RegistryException( "Unable to create configuration file: " + e.getMessage(), e );
        }

        try
        {
            ( (Initializable) registry ).initialize();

            for ( Iterator i = listeners.iterator(); i.hasNext(); )
            {
                RegistryListener l = (RegistryListener) i.next();

                addRegistryChangeListener( l );
            }
        }
        catch ( InitializationException e )
        {
            throw new RegistryException( "Unable to reinitialize configuration: " + e.getMessage(), e );
        }

        return registry.getSection( KEY + ".user" );
    }
View Full Code Here

        String contents = "<configuration />";
        if ( !writeFile( "user configuration", userConfigFilename, contents ) )
        {
            if ( !writeFile( "alternative configuration", altConfigFilename, contents ) )
            {
                throw new RegistryException( "Unable to create configuration file in either user ["
                    + userConfigFilename + "] or alternative [" + altConfigFilename
                    + "] locations on disk, usually happens when not allowed to write to those locations." );
            }
        }

        try
        {
            ( (Initializable) registry ).initialize();

            for ( RegistryListener regListener : registryListeners )
            {
                addRegistryChangeListener( regListener );
            }
        }
        catch ( InitializationException e )
        {
            throw new RegistryException( "Unable to reinitialize configuration: " + e.getMessage(), e );
        }

        triggerEvent( ConfigurationEvent.SAVED );

        return registry.getSection( KEY + ".user" );
View Full Code Here

        if ( !writeFile( "user configuration", userConfigFilename, contents ) )
        {
            fileLocation = altConfigFilename;
            if ( !writeFile( "alternative configuration", altConfigFilename, contents ) )
            {
                throw new RegistryException(
                    "Unable to create configuration file in either user [" + userConfigFilename + "] or alternative ["
                        + altConfigFilename
                        + "] locations on disk, usually happens when not allowed to write to those locations." );
            }
        }
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.registry.RegistryException

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.