Package org.apache.commons.io.input

Examples of org.apache.commons.io.input.ReaderInputStream


  @Override
  public void readFrom(Reader in, Syntax syntax, String baseURI)
      throws IOException, ModelRuntimeException,
      SyntaxNotSupportedException {
    ReaderInputStream is = new ReaderInputStream(in, StandardCharsets.UTF_8);
    readFrom(is, syntax, baseURI);
  }
View Full Code Here


    }

    // the implementation for dump
    private void restore(String path, Reader reader, AbderaClient abderaClient)
            throws RegistryException {
        InputStream is = new ReaderInputStream(reader);
        ClientResponse resp = abderaClient.post(baseURI + APPConstants.ATOM +
                encodeURL(path +
                        RegistryConstants.URL_SEPARATOR +
                        APPConstants.PARAMETER_DUMP),
                is,
View Full Code Here

        }
        if (charset == null) {
            charset = MessageContext.DEFAULT_CHAR_SET_ENCODING;
        }
        messageContext.setProperty(Constants.Configuration.CHARACTER_SET_ENCODING, charset);       
        return processDocument(new ReaderInputStream(reader, charset), contentType,
                messageContext);
    }
View Full Code Here

      byte[] buffer = outputStream.toByteArray();
      String text = new String(buffer, "utf-8");
      text = text.replace("\r\n ", "").replace("\n ", "");

      StringReader reader = new StringReader(text);
      ReaderInputStream input = new ReaderInputStream(reader);
      // 加载清单文件
      Properties prop = new Properties();
      prop.load(input);
      return prop;
    } catch (Exception ex) {
View Full Code Here

    quickWebFrameworkProperties = new Properties();
    try {
      Reader quickWebFrameworkPropertiesReader = new InputStreamReader(
          new FileInputStream(quickWebFrameworkPropertiesFilePath),
          "utf-8");
      InputStream quickWebFrameworkPropertiesInputStream = new ReaderInputStream(
          quickWebFrameworkPropertiesReader);
      quickWebFrameworkProperties
          .load(quickWebFrameworkPropertiesInputStream);
      quickWebFrameworkPropertiesReader.close();
      quickWebFrameworkPropertiesInputStream.close();
    } catch (Exception ex) {
      throw new RuntimeException(ex);
    }

    // ====================
View Full Code Here

import org.apache.commons.io.input.ReaderInputStream;

public class PropertiesUtils {

  public static Properties load(Reader reader) {
    InputStream input = new ReaderInputStream(reader);
    Properties prop = new Properties();
    try {
      prop.load(input);
    } catch (Exception ex) {
      throw new RuntimeException(ex);
    } finally {
      try {
        input.close();
      } catch (IOException ex) {
        throw new RuntimeException(ex);
      }
    }
    return prop;
View Full Code Here

      byte[] buffer = outputStream.toByteArray();
      String text = new String(buffer, "utf-8");
      text = text.replace("\r\n ", "").replace("\n ", "");

      StringReader reader = new StringReader(text);
      InputStream input = new ReaderInputStream(reader);

      // 加载清单文件
      Properties prop = new Properties();
      prop.load(input);
      return prop;
View Full Code Here

      UrlRewriter rewriter,
      Resolver resolver,
      UrlRewriter.Direction direction,
      UrlRewriteFilterContentDescriptor config )
          throws IOException {
    return new ReaderInputStream(
        new FormUrlRewriteFilterReader(
            new InputStreamReader( stream, encoding ), rewriter, resolver, direction, config ) );
  }
View Full Code Here

      UrlRewriter rewriter,
      Resolver resolver,
      UrlRewriter.Direction direction,
      UrlRewriteFilterContentDescriptor config )
          throws IOException {
    return new ReaderInputStream(
        new JsonUrlRewriteFilterReader(
            new InputStreamReader( stream, encoding ), rewriter, resolver, direction, config ) );
  }
View Full Code Here

      Resolver resolver,
      UrlRewriter.Direction direction,
      UrlRewriteFilterContentDescriptor config )
          throws IOException {
    try {
      return new ReaderInputStream(
          new HtmlUrlRewriteFilterReader(
              new InputStreamReader( stream, encoding ), rewriter, resolver, direction, config ) );
    } catch( ParserConfigurationException e ) {
      throw new IOException( e );
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.io.input.ReaderInputStream

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.