Package org.apache.tools.ant.taskdefs

Examples of org.apache.tools.ant.taskdefs.Property


            throw new BuildException("impossible to configure ivy with given "+(_file != null ? "file: "+_file : "url :"+_url)+" :"+ex, ex);
        }
    }

    private void loadDefaultProperties() {
        Property prop = new Property() {
            public void execute() throws BuildException {
                URL url = IvySettings.getDefaultPropertiesURL();
                // this is copy of loadURL code from ant Property task  (not available in 1.5.1)
                Properties props = new Properties();
                Message.verbose("Loading " + url);
                try {
                    InputStream is = url.openStream();
                    try {
                        props.load(is);
                    } finally {
                        if (is != null) {
                            is.close();
                        }
                    }
                    addProperties(props);
                } catch (IOException ex) {
                    throw new BuildException(ex, getLocation());
                }
            }
        };
        prop.setProject(getProject());
        prop.execute();
    }
View Full Code Here


      call.setTarget(target);
     
      for (Iterator iter = attributes.keySet().iterator(); iter.hasNext();) {
        String key = (String) iter.next();
        String value = (String) attributes.get(key);
        Property p = call.createParam();
        p.setName(_prefix == null?key:_prefix+key);
        p.setValue(value == null?"":value);
      }

      Message.verbose("triggering ant call: target="+target+" for "+event);
            MessageImpl impl = IvyContext.getContext().getMessageImpl();
            try {
View Full Code Here

            }
        }
    }

    private void loadDeliveryList() {
        Property property = (Property) getProject().createTask("property");
        property.setOwningTarget(getOwningTarget());
        property.init();
        property.setFile(_deliveryList);
        property.perform();
    }
View Full Code Here

                ct.setOwningTarget(getOwningTarget());
                ct.init();
                ct.setTarget(_deliverTarget);
                ct.setInheritAll(true);
                ct.setInheritRefs(true);
                Property param = ct.createParam();
                param.setName("dependency.name");
                param.setValue(depMrid.getName());
                param = ct.createParam();
                param.setName("dependency.published.status");
                param.setValue(status);
                param = ct.createParam();
                param.setName("dependency.published.version");
                param.setValue(version);
                param = ct.createParam();
                param.setName("dependency.version");
                param.setValue(depMrid.getRevision());
                param = ct.createParam();
                param.setName("dependency.status");
                param.setValue(depStatus==null?"null":depStatus);

                MessageImpl impl = IvyContext.getContext().getMessageImpl();
                try {
                  IvyContext.getContext().setMessageImpl(null);
                  ct.perform();
View Full Code Here

    private void    setProperty( String name, String value )
        throws BuildException
    {
        log( "Setting property " + name + " to " + value, Project.MSG_INFO );
       
        Property    property = new Property();

        property.setName( name );
        property.setValue( value );

        property.setProject( getProject() );
        property.execute();
    }
View Full Code Here

    private void    setProperty( String name, String value )
        throws BuildException
    {
        log( "Setting property " + name + " to " + value, Project.MSG_INFO );
       
        Property    property = new Property();

        property.setName( name );
        property.setValue( value );

        property.setProject( getProject() );
        property.execute();
    }
View Full Code Here

     * </p>
     */
    private void    setProperty( String name, String value )
        throws BuildException
    {
        Property    property = new Property();

        property.setName( name );
        property.setValue( value );

        property.setProject( getProject() );
        property.execute();
    }
View Full Code Here

          else
            project.setUserProperty(resultproperty, value);
        }
        else
        {
          Property p = (Property)project.createTask("property");
          p.setName(resultproperty);
          p.setValue(value);
          p.execute();
        }
      }
    }
View Full Code Here

    HttpMethodBase method = createMethodIfNecessary();
    configureMethod(method);
    try {
      int statusCode = httpClient.executeMethod(method);
      if (statusCodeProperty != null) {
        Property p = (Property)getProject().createTask("property");
        p.setName(statusCodeProperty);
        p.setValue(String.valueOf(statusCode));
        p.perform();
      }
     
      Iterator it = responseHeaders.iterator();
      while (it.hasNext()) {
        ResponseHeader header = (ResponseHeader)it.next();
        Property p = (Property)getProject().createTask("property");
        p.setName(header.getProperty());
        Header h = method.getResponseHeader(header.getName());
        if (h != null && h.getValue() != null) {
          p.setValue(h.getValue());
          p.perform();
        }
       
      }
      if (responseDataProperty != null) {
        Property p = (Property)getProject().createTask("property");
        p.setName(responseDataProperty);
        p.setValue(method.getResponseBodyAsString());
        p.perform();       
      }
      else if (responseDataFile != null) {
        FileOutputStream fos = null;
        InputStream is = null;
        try {
View Full Code Here

    }
   
   
    if (property != null) {
      if (matches != null && matches.length > 0) {
        Property p = (Property)getProject().createTask("property");
        p.setName(property);
        p.setValue(matches[0].getValue());
        p.perform();         
      }
    }
    else if (prefix != null) {
      if (matches != null && matches.length > 0) {
        for (int i=0;i<matches.length;i++) {
          String propName =
            prefix +
            matches[i].getName();
          Property p = (Property)getProject().createTask("property");
          p.setName(propName);
          p.setValue(matches[i].getValue());
          p.perform();
        }
      }
    }
    else {
      throw new BuildException("Nothing to set");
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.taskdefs.Property

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.