Package org.vfny.geoserver.global

Examples of org.vfny.geoserver.global.ConfigurationException


  private File getUserFile() throws ConfigurationException, IOException{
    File securityDir = GeoserverDataDirectory.findCreateConfigDir("security");
    File userFile = new File(securityDir, "users.properties");
    if (!userFile.exists()  && !userFile.createNewFile()){
      // System.out.println("Couldn't create file: " + userFile.getAbsolutePath());
      throw new ConfigurationException("Couldn't create users.properties");
    } else {
      return userFile;
    }
  }
View Full Code Here


           
            log4jConfigFile = resourceLoader.find( "logs", "DEFAULT_LOGGING.properties" );
        }
   
        if (log4jConfigFile == null || !log4jConfigFile.exists()) {
            throw new ConfigurationException("Unable to load logging configuration '" + configFileName + "'.  In addition, an attempt " +
                    "was made to create the 'logs' directory in your data dir, and to use the DEFAULT_LOGGING configuration, but" +
                    "this failed as well.  Is your data dir writeable?");
        }
       
                // reconfiguring log4j logger levels by resetting and loading a new set of configuration properties
View Full Code Here

    public void writeln(String s) throws ConfigurationException {
        try {
            writer.write(indentBuffer.subSequence(0, indent) + s + "\n");
            writer.flush();
        } catch (IOException e) {
            throw new ConfigurationException("Writeln" + writer, e);
        }
    }
View Full Code Here

           
            log4jConfigFile = resourceLoader.find( "logs", "DEFAULT_LOGGING.properties" );
        }
   
        if (log4jConfigFile == null || !log4jConfigFile.exists()) {
            throw new ConfigurationException("Unable to load logging configuration '" + configFileName + "'.  In addition, an attempt " +
                    "was made to create the 'logs' directory in your data dir, and to use the DEFAULT_LOGGING configuration, but" +
                    "this failed as well.  Is your data dir writeable?");
        }
       
                // reconfiguring log4j logger levels by resetting and loading a new set of configuration properties
View Full Code Here

    public void writeln(String s) throws ConfigurationException {
        try {
            writer.write(indentBuffer.subSequence(0, indent) + s + "\n");
            writer.flush();
        } catch (IOException e) {
            throw new ConfigurationException("Writeln" + writer, e);
        }
    }
View Full Code Here

  private File getUserFile() throws ConfigurationException, IOException{
    File securityDir = GeoserverDataDirectory.findCreateConfigDir("security");
    File userFile = new File(securityDir, "users.properties");
    if (!userFile.exists()  && !userFile.createNewFile()){
      // System.out.println("Couldn't create file: " + userFile.getAbsolutePath());
      throw new ConfigurationException("Couldn't create users.properties");
    } else {
      return userFile;
    }
  }
View Full Code Here

           
            resource = resourceLoader.get( Paths.path("logs", "DEFAULT_LOGGING.properties") );
        }
   
        if (resource == null || resource.getType() != Type.RESOURCE) {
            throw new ConfigurationException("Unable to load logging configuration '" + configFileName + "'.  In addition, an attempt " +
                    "was made to create the 'logs' directory in your data dir, and to use the DEFAULT_LOGGING configuration, but" +
                    "this failed as well.  Is your data dir writeable?");
        }
       
        // reconfiguring log4j logger levels by resetting and loading a new set of configuration properties
View Full Code Here

    private File getUserFile() throws ConfigurationException, IOException {
        GeoServerResourceLoader loader = geoServer.getCatalog().getResourceLoader();
        Resource user = loader.get("security/users.properties");
        File userFile = user.file(); // find or create
        if( userFile == null ){
            throw new ConfigurationException("Couldn't create users.properties");
        }
        return userFile;
    }
View Full Code Here

    public void writeln(String s) throws ConfigurationException {
        try {
            writer.write(indentBuffer.subSequence(0, indent) + s + "\n");
            writer.flush();
        } catch (IOException e) {
            throw new ConfigurationException("Writeln" + writer, e);
        }
    }
View Full Code Here

        if (!f.exists()) {
            LOGGER.finer("Creating File: " + f.toString());

            if (isDir) {
                if (!f.mkdir()) {
                    throw new ConfigurationException(
                        "Path specified does not have a valid file.\n" + f
                        + "\n\n");
                }
            } else {
                try {
                  LOGGER.severe("Attempting to create file:" + f.getAbsolutePath());
                    if (!f.createNewFile()) {
                        throw new ConfigurationException(
                            "Path specified does not have a valid file.\n" + f
                            + "\n\n");
                    }
                } catch (IOException e) {
                    throw new ConfigurationException(e);
                }
            }
        }

        if (isDir && !f.isDirectory()) {
            throw new ConfigurationException(
                "Path specified does not have a valid file.\n" + f + "\n\n");
        }

        if (!isDir && !f.isFile()) {
            throw new ConfigurationException(
                "Path specified does not have a valid file.\n" + f + "\n\n");
        }

        LOGGER.finer("File is valid: " + f);
View Full Code Here

TOP

Related Classes of org.vfny.geoserver.global.ConfigurationException

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.