Examples of DocumentLoader


Examples of org.apache.batik.bridge.DocumentLoader

            if (blURL == null)
                throw new BridgeException
                    (bridgeContext, e, ErrorConstants.ERR_URI_IMAGE_BROKEN,
                     new Object[] { url, message });

            DocumentLoader loader  = bridgeContext.getDocumentLoader();
            SVGDocument    doc = null;

            try {
                doc  = (SVGDocument)loader.loadDocument(blURL.toString());
                if (doc == null) return doc;

                DOMImplementation impl;
                impl = SVGDOMImplementation.getDOMImplementation();
                doc  = (SVGDocument)DOMUtilities.deepCloneDocument(doc, impl);
View Full Code Here

Examples of org.apache.flex.forks.batik.bridge.DocumentLoader

    public Main(File []files, Dimension size) {
        setBackground(Color.black);
        this.files = files;
        renderer = new StaticRenderer();
        userAgent = new UserAgentAdapter();
        loader    = new DocumentLoader(userAgent);
        ctx       = new BridgeContext(userAgent, loader);

        if (size == null) {
            size = Toolkit.getDefaultToolkit().getScreenSize();
        }
View Full Code Here

Examples of org.apache.flex.forks.batik.bridge.DocumentLoader

        stopThenRun(new Runnable() {
                public void run() {
                    String url = newURI.toString();
                    fragmentIdentifier = newURI.getRef();

                    loader = new DocumentLoader(userAgent);
                    nextDocumentLoader = new SVGDocumentLoader(url, loader);
                    nextDocumentLoader.setPriority(Thread.MIN_PRIORITY);

                    Iterator it = svgDocumentLoaderListeners.iterator();
                    while (it.hasNext()) {
View Full Code Here

Examples of org.benow.java.rest.DocumentLoader

    super();
    if (apiKey == null)
      throw new NullPointerException("Error, an apiKey must be given.  Specify directly in constructor, set the API_KEY field or provide an apiKey system property (-DapiKey=1234)");

    try {
      loader = new DocumentLoader(new URL("http://discogs.com"));
      loader.setCharset(Charset.forName("UTF-8"));
      loader.setLoadInterval(1000);
      loader.setUserAgent("discogs-java/0.01 +http://benow.ca/projects/discogs-java");

      setCacheEnabled(cacheEnabled);
View Full Code Here

Examples of org.infoset.xml.DocumentLoader

   }
  
   public void load(URI location)
      throws IOException,XMLException
   {
      DocumentLoader loader = new SAXDocumentLoader();
      Document doc = loader.load(location);
      Element top = doc.getDocumentElement();
      if (!top.getName().equals(SERVER)) {
         throw new XMLException("Expecting "+SERVER+" but found "+top.getName());
      }
     
View Full Code Here

Examples of org.infoset.xml.DocumentLoader

   }

   public void load(URL url)
      throws IOException,XMLException
   {
      DocumentLoader loader = new SAXDocumentLoader();
      try {
         loader.generate(url.toURI(), new ItemDestination() {
            String separator = "/";
            TermNode current = null;
            public void send(Item item)
               throws XMLException
            {
View Full Code Here

Examples of org.infoset.xml.DocumentLoader

      String charset = postType.getParameters().getValues("charset");
      if (charset==null) {
         charset = "UTF-8";
      }
      Document doc = null;
      DocumentLoader loader = new SAXDocumentLoader();
      try {
         Reader r = new InputStreamReader(entity.getStream(),charset);
         doc = loader.load(r);
         r.close();
      } catch (IOException ex) {
         getResponse().setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
         return new StringRepresentation("I/O error while parsing document: "+ex.getMessage());
      } catch (XMLException ex) {
View Full Code Here

Examples of org.infoset.xml.DocumentLoader

                  }
                  link(constructor,dest,"related",resourceBase+feed.getPath());
                  dest.send(constructor.createElementEnd(AtomResource.ENTRY_NAME));
               }
            }
            DocumentLoader loader = new SAXDocumentLoader();
            Iterator<TermInstance<Entry>> entries = app.getDB().getEntriesByTerm(key.dbTerm,key.value);
            while (entries.hasNext()) {
               TermInstance<Entry> termValue = entries.next();
               Entry entry = termValue.getTarget();
               boolean ok = true;
               for (URI otherTerm : termSet.keySet()) {
                  TermQuery other = termSet.get(otherTerm);
                  ok = entry.hasTerm(other.dbTerm, other.value);
                  if (!ok) {
                     break;
                  }
               }
               if (ok) {
                  Feed feed = entry.getFeed();
                  String feedPath = feed.getPath();
                  String feedBaseURI = resourceBase.toString()+feedPath;
                  dest.send(constructor.createCharacters("\n"));

                  // get the entry representation
                  Representation rep = app.getStorage().getEntry(feedBaseURI,feedPath,feed.getUUID(),entry.getUUID());

                  // avoid thread creation because reading an output representation requires a thread
                  StringWriter sw = new StringWriter();
                  rep.write(sw);
                  rep.release();
                  loader.generate(new StringReader(sw.toString()), new RemoveDocumentFilter(dest));
               }
              
            }
         }
      } catch (Exception ex) {
View Full Code Here

Examples of org.infoset.xml.DocumentLoader

   }
     
   public void load(URI location)
      throws IOException,XMLException
   {
      DocumentLoader loader = new SAXDocumentLoader();
      Document doc = loader.load(location);
      Element top = doc.getDocumentElement();
      if (!top.getName().equals(AdminXML.NM_SERVER)) {
         throw new XMLException("Expecting "+AdminXML.NM_SERVER+" but found "+top.getName());
      }
      String value = top.getAttributeValue("autoconf-check");
View Full Code Here

Examples of org.infoset.xml.DocumentLoader

         if (!inFile.canRead()) {
            getResponse().setStatus(Status.CLIENT_ERROR_EXPECTATION_FAILED);
            return new StringRepresentation("Cannot read input file "+inFile.getAbsolutePath());
         }
         getContext().getLogger().info("Restoring database from "+inFile.getAbsolutePath());
         DocumentLoader loader = new SAXDocumentLoader();
         loader.generate(inFile.toURI(),new RestoreDestination(getContext().getLogger(),db));
         getContext().getLogger().info("Restore finished.");
         getResponse().setStatus(Status.SUCCESS_NO_CONTENT);
         return null;
      } catch (IOException ex) {
         getContext().getLogger().log(Level.SEVERE,"Cannot get write data to output.",ex);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.