Package java.io

Examples of java.io.InputStreamReader


        }
    }

    public void testRuleFlowActionDialects() throws Exception {
        final PackageBuilder builder = new PackageBuilder();
        builder.addRuleFlow( new InputStreamReader( getClass().getResourceAsStream( "test_ActionDialects.rfm" ) ) );

        RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        ruleBase.addPackage( builder.getPackage() );
        ruleBase = SerializationHelper.serializeObject( ruleBase );
View Full Code Here


    }

    public void testLoadingRuleFlowInPackage7() throws Exception {
        // loading a ruleflow with errors
        final PackageBuilder builder = new PackageBuilder();
        builder.addRuleFlow( new InputStreamReader( getClass().getResourceAsStream( "error_ruleflow.rfm" ) ) );
        assertEquals( 1,
                      builder.getErrors().getErrors().length );
    }
View Full Code Here

        try {
            boolean success = true;
            final Thread[] t = new Thread[THREAD_COUNT];
           
            final PackageBuilder builder = new PackageBuilder();
            builder.addProcessFromXml(new InputStreamReader( getClass().getResourceAsStream( "test_ProcessMultithreadEvent.rf" ) ) );
            if (builder.getErrors().getErrors().length > 0) {
              for (DroolsError error: builder.getErrors().getErrors()) {
                System.err.println(error);
              }
              fail("Could not parse process");
View Full Code Here

        InputStream in = this.getClass().getResourceAsStream( "/org/jbpm/integrationtests/ruleflow.rfm" );
        assertNotNull( in );

        builder.addPackage( new PackageDescr( "com.sample" ) );

        builder.addRuleFlow( new InputStreamReader( in ) );
        Package pkg = builder.getPackage();
        assertNotNull( pkg );

        Map<String, Process> flows = pkg.getRuleFlows();
        assertNotNull( flows );
View Full Code Here

        InputStream in = this.getClass().getResourceAsStream( "/org/jbpm/integrationtests/ruleflow40.rfm" );
        assertNotNull( in );

        builder.addPackage( new PackageDescr( "com.sample" ) );

        builder.addRuleFlow( new InputStreamReader( in ) );
        Package pkg = builder.getPackage();
        assertNotNull( pkg );

        Map<String, Process> flows = pkg.getRuleFlows();
        assertNotNull( flows );
View Full Code Here

        if (obj instanceof String) {
            try {
                // first try to interpret string as URL
                URL url = new URL(obj.toString());
                return getHtmlDocument(new InputStreamReader(url.openStream()));
            } catch (MalformedURLException nourl) {
                // if not a URL, maybe it is the XML itself
                return getHtmlDocument(new StringReader(obj.toString()));
            }
        } else if (obj instanceof InputStream) {
            return getHtmlDocument(new InputStreamReader((InputStream) obj));
        } else if (obj instanceof Reader) {
            return getHtmlDocument((Reader) obj);
        } else {
            throw new RuntimeException("Unrecognized argument to parseHtml: " + obj);
        }
View Full Code Here

    public void testSimpleXml() throws Exception {
        SemanticModules modules = new SemanticModules();
        modules.addSemanticModule(new ProcessSemanticModule());
        XmlProcessReader reader = new XmlProcessReader(modules, getClass().getClassLoader());
        reader.read(new InputStreamReader(TestXml.class.getResourceAsStream("XmlTest.xml")));
        List<Process> processes = reader.getProcess();
        assertNotNull(processes);
        assertEquals(1, processes.size());
        RuleFlowProcess process = (RuleFlowProcess) processes.get(0);
        assertNotNull(process);
View Full Code Here

   */
  public void setSource(InputStream in) throws IOException {
    m_File = (new File(System.getProperty("user.dir"))).getAbsolutePath();
    m_URL = "http://";

    m_sourceReader = new BufferedReader(new InputStreamReader(in));
  }
View Full Code Here

    public static Skin getSkin(Resource res, Application app) throws IOException {
        String encoding = app.getProperty("skinCharset");
        Reader reader;
        if (encoding == null) {
            reader = new InputStreamReader(res.getInputStream());
        } else {
            reader = new InputStreamReader(res.getInputStream(), encoding);
        }

        int length = (int) res.getLength();
        char[] characterBuffer = new char[length];
        int read = 0;
View Full Code Here

            if (!replyCode.equals("450") && !replyCode.equals("550") && !replyCode.equals("226")) {
                // get a character input stream to read data from .
                LineNumberReader in = null;
                 try {
                    in = new LineNumberReader(
                            new InputStreamReader(getInputStream(), controlEncoding));
   
                    // read a line at a time
                    String line = null;
                    while ((line = readLine(in)) != null && !cancelTransfer) {
                        if (lines != null)
View Full Code Here

TOP

Related Classes of java.io.InputStreamReader

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.