Package org.apache.tools.ant.filters

Examples of org.apache.tools.ant.filters.StringInputStream



   @Override
   public void update(Connection connection, String id, Message messagethrows SQLException, JMSException {
     final String messageAsXMLString = xmlHelper.toXML(message);
        final InputStream messageAsXML = new StringInputStream(messageAsXMLString);    
       
        final PreparedStatement pstmt = connection.prepareStatement("update messages set message = ? where messageid = ?");
        pstmt.setString(1, message.getJMSMessageID()) ;
        pstmt.setAsciiStream(2, messageAsXML, messageAsXMLString.length()) ;
        pstmt.execute() ;
View Full Code Here


   public void insert(Connection connection, String storeId, Message message) throws SQLException, JMSException
   {
      final String destinationName = message.getJMSDestination() == null ? "default" : JMSUtils.getDestinationName(message.getJMSDestination());
      final Domain domain = message.getJMSDestination() == null ? Domain.QUEUE : Domain.getDomain(message.getJMSDestination());
      final String messageAsXMLString = xmlHelper.toXML(message);
      final InputStream messageAsXML = new StringInputStream(messageAsXMLString);
      final String messageId = getNextMessageId(storeId);

      //
      // DBUtils does not seem to correctly deal with CLOBS, so we have to use
      // normal JDBC...
View Full Code Here

      {
         buffer.append(replaceClasspathVariables(line));
         buffer.append("\n");
      }

      return new StringInputStream(buffer.toString());
   }
View Full Code Here

      //  </info>
      //

      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      DocumentBuilder builder = factory.newDocumentBuilder();
      Document document = builder.parse(new StringInputStream(proc.getOutput()));

      // For XPath syntax, see: http://www.w3schools.com/xpath/xpath_syntax.asp
      XPath xpath = XPathFactory.newInstance().newXPath();

      // Select revision attribute
View Full Code Here

     */
    @Override
    public void writeTo(OutputStream out, long start, long count)
        throws IOException
    {
        InputStream in = new StringInputStream(extensionJs);
        try {
            in.skip(start);
            if (count<0)
                IO.copy(in, out);
            else
                IO.copy(in, out, (int)count);
        }
        finally {
            in.close();
        }
    }
View Full Code Here

    }

    @Test
    public void testImplicitInputStreamToStringConversion() throws Exception
    {
        InputStream inputStream = new StringInputStream("TEST");
        LocalMuleClient client = muleContext.getClient();
        MuleMessage response = client.send("vm://stringInput", inputStream, null);
        assertEquals("TSET", response.getPayload());
    }
View Full Code Here

    }

    @Test
    public void testImplicitInputStreamToByteArrayConversion() throws Exception
    {
        InputStream inputStream = new StringInputStream("TEST");
        LocalMuleClient client = muleContext.getClient();
        MuleMessage response = client.send("vm://byteArrayInput", inputStream, null);
        assertEquals("TSET", response.getPayload());
    }
View Full Code Here

     */
    @Override
    public void writeTo(OutputStream out, long start, long count)
        throws IOException
    {
        InputStream in = new StringInputStream(extensionJs);
        try {
            in.skip(start);
            if (count<0)
                IO.copy(in, out);
            else
                IO.copy(in, out, (int)count);
        }
        finally {
            in.close();
        }
    }
View Full Code Here

            if (text != null) {
                if (!text.endsWith("\n")) {
                    text = text + "\n";
                }

                final StringInputStream sis = new StringInputStream(text);
                final Properties props = new Properties();
                props.load(sis);
                final Enumeration e = props.keys();
                while (e.hasMoreElements()) {
                    final String key = (String) e.nextElement();
                    final String value = props.getProperty(key);
                    if (key != null && value != null
                            && value.trim().length() > 0) {
                        project.setNewProperty(key, value);
                    }
                }
                sis.close();
            }

        } catch (final IOException ioe) {
            final String message = "Unable to load file: " + ioe.toString();
            throw new BuildException(message, ioe, location);
View Full Code Here

        } catch(NoSuchMethodError _) {
            // {@link Properties#load(java.io.Reader)} is supported since Java 1.6
            // When used with Java1.5, fall back to
            // {@link Properties#load(java.io.InputStream)}, which does not support
            // Non-ascii strings.
            p.load(new StringInputStream(properties));
        }
        return p;
    }
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.filters.StringInputStream

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.