Package org.codehaus.swizzle.stream

Examples of org.codehaus.swizzle.stream.DelimitedTokenReplacementInputStream$StreamReadingStrategy


            URL url = new URL(baseUrl, "secure/ViewVoters!default.jspa?id=" + issue.getId());

            InputStream in = new BufferedInputStream(url.openStream());
            in = new IncludeFilterInputStream(in, "<a id=\"voter_link", "/a>");
            in = new DelimitedTokenReplacementInputStream(in, "name=", "<", new StringTokenHandler() {
                public String handleToken(String token) throws IOException {
                    String[] s = token.split("\">");
                    try {
                        User user;
                        if (jira == null) {
View Full Code Here


    private String replace(String inputText, String begin, String newBegin, String end, String newEnd) throws IOException {
        BeginEndTokenHandler tokenHandler = new BeginEndTokenHandler(newBegin, newEnd);

        ByteArrayInputStream in = new ByteArrayInputStream(inputText.getBytes());

        InputStream replacementStream = new DelimitedTokenReplacementInputStream(in, begin, end, tokenHandler, true);
        String newServerXml = readAll(replacementStream);
        close(replacementStream);
        return newServerXml;
    }
View Full Code Here

    private String replace(String inputText, String begin, String newBegin, String end, String newEnd) throws IOException {
        BeginEndTokenHandler tokenHandler = new BeginEndTokenHandler(newBegin, newEnd);

        ByteArrayInputStream in = new ByteArrayInputStream(inputText.getBytes());

        InputStream replacementStream = new DelimitedTokenReplacementInputStream(in, begin, end, tokenHandler, true);
        String newServerXml = readAll(replacementStream);
        close(replacementStream);
        return newServerXml;
    }
View Full Code Here

    public static String replace(String inputText, String begin, String newBegin, String end, String newEnd) throws IOException {
        BeginEndTokenHandler tokenHandler = new BeginEndTokenHandler(newBegin, newEnd);

        ByteArrayInputStream in = new ByteArrayInputStream(inputText.getBytes());

        InputStream replacementStream = new DelimitedTokenReplacementInputStream(in, begin, end, tokenHandler, true);
        // SwizzleStream block read methods are broken so read byte at a time
        StringBuilder sb = new StringBuilder();
        int i = replacementStream.read();
        while (i != -1) {
            sb.append((char) i);
            i = replacementStream.read();
        }
        String newServerXml = sb.toString();
        IO.close(replacementStream);
        return newServerXml;
    }
View Full Code Here

TOP

Related Classes of org.codehaus.swizzle.stream.DelimitedTokenReplacementInputStream$StreamReadingStrategy

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.