Package org.xmlBlaster.util.property

Examples of org.xmlBlaster.util.property.Property$FileInfo


      if (property == null) {
         synchronized (Property.class) {
            if (property == null) {
               try {
                  if (loadPropFile)
                     property = new Property("xmlBlaster.properties", true, args, doReplace);
                  else
                     property = new Property(null, true, args, doReplace);
               }
               catch (XmlBlasterException e) {
                  errorText = ME + ": Error in xmlBlaster.properties: " + e.toString();
                  System.err.println(errorText);
                  try {
                     property = new Property(null, true, args, doReplace)// initialize without properties file!
                  }
                  catch (XmlBlasterException e2) {
                     errorText = ME + " ERROR: " + e2.toString();
                     System.err.println(errorText);
                     try {
                        property = new Property(null, true, new String[0], doReplace)// initialize without args
                     }
                     catch (XmlBlasterException e3) {
                        errorText = ME + " ERROR: " + e3.toString();
                        System.err.println(errorText);
                        e3.printStackTrace();
View Full Code Here


   /**
    * Access the environment properties, is never null.
    */
   public final Property getProperty() {
      return (this.property == null) ? new Property() : this.property;
   }
View Full Code Here

   /**
    * Set the properties from the serverside engine global in the given global if it exists.
    */
   public void addEngineProperties(Global glob) throws IllegalStateException{
      if ( engineGlobal != null) {
         Property p = glob.getProperty();
         String[] args = Property.propsToArgs(engineGlobal.getProperty().getProperties() );
         try {
            p.addArgs2Props( args != null ? args : new String[0] );
         } catch (XmlBlasterException e) {
            IllegalStateException x = new IllegalStateException("Could not engine properties into global: " + e);
         throw x;
         } // end of try-catch

View Full Code Here

   public void loadPropertyFile(Global glob, String propFile) throws IllegalStateException{
      if (propFile== null )
         return;
     
      try {
         Property p = glob.getProperty();
         URL url = Thread.currentThread().getContextClassLoader().getResource(propFile);
         InputStream is = null;
         if ( url != null) {
            try {
               is= url.openStream();
              
            }catch(java.io.IOException ex) {
               is = null;
            }
         } // end of if ()
        
         if ( is == null) {
            // Use xmlBlaster way of searching
            FileInfo i = p.findPath(propFile);
            if ( i != null) {
               is = i.getInputStream();
            } // end of if ()

         } // end of if ()
View Full Code Here

   public void addArguments(Global glob, Properties props) throws IllegalStateException{
      if ( props == null) {
         return;
      } // end of if ()
      try {               
         Property p = glob.getProperty();
         String[] args = Property.propsToArgs(props);
         p.addArgs2Props( args != null ? args : new String[0] );
      } catch (XmlBlasterException e) {
         IllegalStateException x = new IllegalStateException("Could not load properties into Property: " + e);
         throw x;
      } // end of try-catch
   }
View Full Code Here

         ClassLoader cl = Thread.currentThread().getContextClassLoader();
         InputStream is = cl.getResourceAsStream(fileName);
         if (is != null) {
            props.load(is);
            // Ad to global
            Property p = glob.getProperty();
            p.addArgs2Props( props );
         } else {

            log.warning("No "+fileName+" found in context classpath");
         }
      } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.xmlBlaster.util.property.Property$FileInfo

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.