Package com.ibm.commons.util.io

Examples of com.ibm.commons.util.io.ReaderInputStream


   * Decide whether a node should be included in the tree.
   * @param properties
   * @return True if this node is to be included, false if it should not be included in the tree.
   */
  protected boolean includeNode(String properties) {
        ReaderInputStream is = new ReaderInputStream(new StringReader(properties));
        Properties p = new Properties();
        try {
            p.load(is);
        } catch (IOException e) {
            e.printStackTrace();
View Full Code Here


      addProperties(p, props);
    }
  }
  protected void addProperties(Properties p, String value) throws IOException {
    if(StringUtil.isNotEmpty(value)) {
      ReaderInputStream is = new ReaderInputStream(new StringReader(value));
      try {
        p.load(is);
      } finally {
        StreamUtil.close(is);
      }
View Full Code Here

   */
  public static Property[] parseProperties(String sProperty) throws IOException {
    if(StringUtil.isNotEmpty(sProperty)) {
      Properties props = new Properties();
      StringReader r = new StringReader(sProperty);
      props.load(new ReaderInputStream(r));
      List<Property> properties = new ArrayList<Property>();
      for(Entry<Object, Object> e: props.entrySet()) {
        Property p = new Property((String)e.getKey(),(String)e.getValue());
        properties.add(p);
      }
View Full Code Here

      return null;
    }
  }
  private static byte[] decodeBase64(String s) {
    try {
      Base64.InputStream b64 = new Base64.InputStream(new ReaderInputStream(new StringReader(s)));
      ByteBuffer bb = ByteBuffer.allocate(1024*4); // max cookie size
      int byt;
      while( (byt = b64.read()) >= 0)  {
        bb.put((byte) (byt&0xFF));
      }
View Full Code Here

                    url = new URL(resourcesXmlVal);
                    // log the fact that we picked up an URL?
                    logMsgs.add("Found a valid URL to global resources descriptor. Accessing URL now..."); // $NLI-WebAppServerPlatform.FoundavalidURLtoglobalresourcesde-1$
                    return url.openStream();
                } catch( MalformedURLException ex) {
                    return new ReaderInputStream(new StringReader(resourcesXmlVal));
                } catch (IOException e) {
                    // log that URL access failed
                    logMsgs.add("IOException while accessing the URL to global resources descriptor."); // $NLE-WebAppServerPlatform.IOExceptionwhileaccessingtheURLto-1$
                }
               
View Full Code Here

 
  private void emit(HttpServletResponse resp, String text, String contentType) throws IOException {
    resp.setStatus(200);
    resp.setContentType(contentType);
    ByteStreamCache bs = new ByteStreamCache();
    InputStream is = new ReaderInputStream(new StringReader(text),"utf-8");
    bs.copyFrom(is);
    resp.setContentLength((int)bs.getLength());
    OutputStream os = resp.getOutputStream();
    bs.copyTo(os);
    os.flush();
View Full Code Here

          }
          if(StringUtil.isNotEmpty(sProperties)) {
          try {
            // Pass the properties from the file
            if(StringUtil.isNotEmpty(sProperties)) {
              this.properties.load(new ReaderInputStream(new StringReader(sProperties)));
            }
          } catch(Exception ex) {}
          }
        }
View Full Code Here

TOP

Related Classes of com.ibm.commons.util.io.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.