Inheritance: java.lang.Appendable, java.io.Closeable, java.io.Flushable
		/// <summary>
		/// Stores the contents of the model into the given
		/// stream.
		/// </summary>
		public void write(Writer @out)
		{
		}
 public PrintWriter(Writer w)
 {
 }
        public PrintWriter(Writer w)
        {

        }
		/// <summary>
		/// Construct a StreamResult from a character stream.
		/// </summary>
		public StreamResult(Writer @writer)
		{
		}
		/// <summary>
		/// Set the writer that is to receive the result.
		/// </summary>
		public void setWriter(Writer @writer)
		{
		}
Example #6
0
 public virtual void copyWriter(Reader @in, Writer @out)
 {
   this.copyWriter(@in, @out, 4096);
 }
Example #7
0
 public virtual void copyWriter(Reader @in, Writer @out, int buffersize)
 {
   char[] chArray = new char[buffersize];
   for (int index = @in.read(chArray); index > -1; index = @in.read(chArray))
     @out.write(chArray, 0, index);
 }
        private bool rewrite(GadgetSpec spec, Uri source, MutableContent mc, String mimeType, java.io.Writer writer)
        {
            // Dont rewrite content if the spec is unavailable
            if (spec == null)
            {
                return(false);
            }

            // Store the feature in the spec so we dont keep parsing it
            ContentRewriterFeature rewriterFeature = new ContentRewriterFeature(spec, includeUrls, excludeUrls, expires, includeTags);

            if (!rewriterFeature.isRewriteEnabled())
            {
                return(false);
            }
            if (isHTML(mimeType))
            {
                Dictionary <String, IHtmlTagTransformer> transformerMap = new Dictionary <string, IHtmlTagTransformer>();

                if (ProxyUrl != null)
                {
                    ILinkRewriter      linkRewriter = CreateLinkRewriter(spec, rewriterFeature);
                    LinkingTagRewriter rewriter     = new LinkingTagRewriter(linkRewriter, source);
                    HashSet <String>   toProcess    = new HashSet <string>();
                    foreach (var item in rewriter.getSupportedTags())
                    {
                        toProcess.Add(item);
                    }

                    toProcess.IntersectWith(rewriterFeature.getIncludedTags());

                    foreach (string tag in toProcess)
                    {
                        transformerMap[tag] = rewriter;
                    }
                    if (rewriterFeature.getIncludedTags().Contains("style"))
                    {
                        transformerMap["style"] = new StyleTagRewriter(source, linkRewriter);
                    }
                }
                if (ConcatUrl != null &&
                    rewriterFeature.getIncludedTags().Contains("script"))
                {
                    transformerMap["script"] = new JavascriptTagMerger(spec, rewriterFeature, ConcatUrl, source);
                }
                HtmlRewriter.rewrite(new StringReader(mc.getContent()), source, transformerMap, writer);
                return(true);
            }
            if (isCSS(mimeType))
            {
                if (ProxyUrl != null)
                {
                    CssRewriter.rewrite(new StringReader(mc.getContent()), source, CreateLinkRewriter(spec, rewriterFeature), writer, false);
                    return(true);
                }
                return(false);
            }
            return(false);
        }
		/// <summary>
		/// Writes content from a document to the given stream
		/// in a format appropriate for this kind of content handler.
		/// </summary>
		abstract public void write(Writer @out, Document @doc, int @pos, int @len);
 public static void save(Node node, Writer writer) {
     save(node, new StreamResult(writer));
 }