Examples of ResourceLocator


Examples of org.jconfig.utils.ResourceLocator

    /**
     * This method should store all categories and properties.
     */
    public void store(Configuration configuration) throws ConfigurationManagerException {
        try {
      store( new ResourceLocator(filename).getFile(),configuration);
    } catch (IOException e) {
      ErrorReporter.getErrorHandler().reportError("File "+filename+" could not be found",e);
      throw new ConfigurationManagerException("File "+filename+" could not be found");
    }
    }
View Full Code Here

Examples of org.jconfig.utils.ResourceLocator

    /**
     * @see org.jconfig.handler.ConfigurationHandler#getFile()
     */
    public File getFile() {
        try {
      return new ResourceLocator(filename).getFile();
    } catch (IOException e) {
      ErrorReporter.getErrorHandler().reportError("File not found",e);
      return null;
    }
    }
View Full Code Here

Examples of org.jconfig.utils.ResourceLocator

        try {
            InputStream inputStream = null;
            if(file.exists()) {
                inputStream = new FileInputStream(file);
            } else {
                ResourceLocator locator = new ResourceLocator(file.getName());
                inputStream = locator.getInputStream();
            }
            if ( inputStream == null ) {
              ErrorReporter.getErrorHandler().reportError("Cannot find the properties file");
                throw new ConfigurationManagerException("Cannot find the properties file");
            }
View Full Code Here

Examples of org.jconfig.utils.ResourceLocator

     * @throws ConfigurationManagerException thrown if the "_config.script" isn't found
     */
    public Configuration load(String configurationName) throws ConfigurationManagerException {
        fileName = configurationName+"_config.script";
    try {
      ResourceLocator locator = new ResourceLocator(fileName);
      InputStream is = locator.findResource(fileName);
      return load(configurationName,is);
    }
    catch (IOException e) {
      ErrorReporter.getErrorHandler().reportError("Error while trying to read file",e);
            throw new ConfigurationManagerException("Error while trying to read file");
View Full Code Here

Examples of org.jconfig.utils.ResourceLocator

        return null;
    }

  public File getFile() {
    try {
      return new ResourceLocator(fileName).getFile();
    } catch (IOException e) {
      ErrorReporter.getErrorHandler().reportError("File not found",e);
      return null;
    }
  }
View Full Code Here

Examples of org.jconfig.utils.ResourceLocator

        }
    }
   
    private void loadJDBCProperties() throws ConfigurationManagerException {
        try {
            ResourceLocator locator = new ResourceLocator("jconfig.properties");
            InputStream is = locator.getInputStream();
            // it is possible that the jconfig.properties does not exist, we get null
            if ( is != null ) {
                Properties jcfProperties = new Properties();
                jcfProperties.load( is );
                driver = jcfProperties.getProperty("org.jconfig.jdbc.driver");
View Full Code Here

Examples of org.jconfig.utils.ResourceLocator

    }
   
    protected Connection JDBCLogin() throws ConfigurationManagerException {       
        try {
            Class.forName("org.hsqldb.jdbcDriver");
            String dbName = new ResourceLocator("configDB").getFile().getAbsolutePath();
            return DriverManager.getConnection("jdbc:hsqldb:"+ dbName,"sa","");
        }
        catch (Exception e) {
            ErrorReporter.getErrorHandler().reportError("Cannot load the jdbc driver", e);
            throw new ConfigurationManagerException("Cannot load the jdbc driver:"+e.getMessage());
View Full Code Here

Examples of org.jconfig.utils.ResourceLocator

    }
   
    private void prepareDB() {
        try {

            File src = new ResourceLocator("configDB.script.org").getFile();
            File dst = new ResourceLocator("configDB.script").getFile();
            InputStream in = new FileInputStream(src);
            OutputStream out = new FileOutputStream(dst);

            // Transfer bytes from in to out
            byte[] buf = new byte[1024];
View Full Code Here

Examples of org.wymiwyg.rwcf.impl.ResourceLocator

            throw new RuntimeException(ex);
          }
        }
      }
    });*/
    handlerContext = new HandlerContextImpl(new ResourceLocator() {

      public URL getBaseDir() {
        String rwcfBaseString = System.getProperty("org.wymiwyg.rwcf.home");
        if (rwcfBaseString != null) {
          try {
View Full Code Here

Examples of org.xith3d.resources.ResourceLocator

     *
     * @return the filled ResourceBag
     */
    public static ResourceBag loadResources() throws Exception {
       
        ResourceLocator resLoc = ResourceLocator.create("data/");
        ResourceLocator.setSingletonInstance(resLoc);
       
        resLoc.createAndAddTSL();
       
        org.xith3d.resources.ResourceLoader loader =
            new org.xith3d.resources.ResourceLoader(resLoc);
       
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.