Package org.infoset.xml.sax

Examples of org.infoset.xml.sax.SAXDocumentLoader.generate()


   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


            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

                           StringWriter sw = new StringWriter();
                           rep.write(sw);
                           rep.release();

                           // TODO: optimize by giving item destination to storage
                           loader.generate(new StringReader(sw.toString()), new RemoveDocumentFilter(dest));
                        } catch (Exception ex) {
                           throw new QueryException("Exception during feed entry generation.",ex);
                        }
                     }
View Full Code Here

                  // 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

         URL defaultDB = this.getClass().getResource("default-db.xml");
         if (defaultDB!=null) {
            try {
               DocumentLoader loader = new SAXDocumentLoader();
               RestoreDestination restore = new RestoreDestination(LOG,this);
               loader.generate(defaultDB.toURI(), restore);
            } catch (XMLException ex) {
               throw new IOException(ex.getMessage());
            } catch (URISyntaxException ex) {
               throw new IOException(ex.getMessage());
            }
View Full Code Here

              
               // 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) {
         throw new XMLException("Exception while getting ancestors.",ex);
View Full Code Here

            // avoid thread creation because reading an output representation requires a thread
            StringWriter sw = new StringWriter();
            rep.write(sw);
            rep.release();
            DocumentLoader loader = new SAXDocumentLoader();
            loader.generate(new StringReader(sw.toString()), new RemoveDocumentFilter(dest));

         }
      } catch (Exception ex) {
         throw new XMLException("Exception while getting ancestors.",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.