Examples of Writer


Examples of de.willuhn.datasource.serialize.Writer

      /**
       * @see de.willuhn.jameica.system.BackgroundTask#run(de.willuhn.util.ProgressMonitor)
       */
      public void run(ProgressMonitor monitor) throws ApplicationException
      {
        Writer writer = null;
        try
        {
          Logger.info("creating xml backup to " + file.getAbsolutePath());

          writer = new XmlWriter(new BufferedOutputStream(new FileOutputStream(file)));

          monitor.setStatusText(i18n.tr("Speichere Turnus-Informationen"));
          backup(TurnusImpl.class,writer,monitor);
          monitor.addPercentComplete(5);

         
          monitor.setStatusText(i18n.tr("Speichere Umsatz-Kategorien"));
          backupTree(UmsatzTypImpl.class,writer,monitor);
          monitor.addPercentComplete(5);


          monitor.setStatusText(i18n.tr("Speichere Adressbuch"));
          backup(HibiscusAddressImpl.class,writer,monitor);
          monitor.addPercentComplete(5);

          monitor.setStatusText(i18n.tr("Speichere Konten und Systemnachrichten"));
          backup(KontoImpl.class,writer,monitor);
          backup(NachrichtImpl.class,writer,monitor);
          monitor.addPercentComplete(5);

          monitor.setStatusText(i18n.tr("Speichere Ums�tze"));
          backup(UmsatzImpl.class,writer,monitor);
          monitor.addPercentComplete(20);
         
          monitor.setStatusText(i18n.tr("Speichere Dauerauftr�ge"));
          backup(DauerauftragImpl.class,writer,monitor);
          monitor.addPercentComplete(5);

          monitor.setStatusText(i18n.tr("Speichere SEPA-Dauerauftr�ge"));
          backup(SepaDauerauftragImpl.class,writer,monitor);
          monitor.addPercentComplete(5);

          monitor.setStatusText(i18n.tr("Speichere Lastschriften"));
          backup(LastschriftImpl.class,writer,monitor);
          monitor.addPercentComplete(5);

          monitor.setStatusText(i18n.tr("Speichere �berweisungen"));
          backup(UeberweisungImpl.class,writer,monitor);
          monitor.addPercentComplete(5);

          monitor.setStatusText(i18n.tr("Speichere SEPA-�berweisungen"));
          backup(AuslandsUeberweisungImpl.class,writer,monitor);
          monitor.addPercentComplete(5);

          monitor.setStatusText(i18n.tr("Speichere SEPA-Lastschriften"));
          backup(SepaLastschriftImpl.class,writer,monitor);
          monitor.addPercentComplete(5);

          monitor.setStatusText(i18n.tr("Speichere Sammel-Lastschriften"));
          backup(SammelLastschriftImpl.class,writer,monitor);
          backup(SammelLastBuchungImpl.class,writer,monitor);
          monitor.addPercentComplete(5);

          monitor.setStatusText(i18n.tr("Speichere Sammel-�berweisungen"));
          backup(SammelUeberweisungImpl.class,writer,monitor);
          backup(SammelUeberweisungBuchungImpl.class,writer,monitor);
          monitor.addPercentComplete(5);

          monitor.setStatusText(i18n.tr("Speichere SEPA-Sammellastschriften"));
          backup(SepaSammelLastschriftImpl.class,writer,monitor);
          backup(SepaSammelLastBuchungImpl.class,writer,monitor);
          monitor.addPercentComplete(5);

          monitor.setStatusText(i18n.tr("Speichere SEPA-Sammel�berweisungen"));
          backup(SepaSammelUeberweisungImpl.class,writer,monitor);
          backup(SepaSammelUeberweisungBuchungImpl.class,writer,monitor);
          monitor.addPercentComplete(5);

          monitor.setStatusText(i18n.tr("Speichere Properties"));
          backup(DBPropertyImpl.class,writer,monitor);
          monitor.addPercentComplete(10);

          monitor.setStatusText(i18n.tr("Speichere Reminder"));
          backup(DBReminderImpl.class,writer,monitor);
          monitor.addPercentComplete(2);

          // Die Protokolle zum Schluss.
          monitor.setStatusText(i18n.tr("Speichere Protokolle"));
          backup(ProtokollImpl.class,writer,monitor);
          monitor.addPercentComplete(20);
         
          // Die Versionstabelle wird nicht mit kopiert
         
          monitor.setStatus(ProgressMonitor.STATUS_DONE);
          monitor.setStatusText("Backup erstellt");
          monitor.setPercentComplete(100);
        }
        catch (Exception e)
        {
          throw new ApplicationException(e.getMessage());
        }
        finally
        {
          if (writer != null)
          {
            try
            {
              writer.close();
              Logger.info("backup created");
            }
            catch (Exception e) {/*useless*/}
          }
        }
View Full Code Here

Examples of dom.Writer

    }
   
    public boolean performTest(String arg) {
        boolean passed = true;
        try {
            Writer writer = new Writer(false);
            DOMParser parser = new DOMParser();
            if (!arg.equals("delete2") && !arg.equals("insert2")) {
            if (fStdOut) System.out.println("\n*************** Test == "+arg+" ***************");
            for (int i = 0; i < tests.length; i++) {
                if (fStdOut) System.out.println("\n\nTest["+i+"]");
View Full Code Here

Examples of java.io.Writer

  private FileStoreInputStreamFactory buildResult() throws TeiidProcessingException {
    try {
      FileStore fs = context.getBufferManager().createFileStore("textagg"); //$NON-NLS-1$
      FileStoreInputStreamFactory fisf = new FileStoreInputStreamFactory(fs, textLine.getEncoding()==null?Streamable.ENCODING:textLine.getEncoding());
      Writer w = fisf.getWriter();
      if (textLine.isIncludeHeader()) {
        w.write(TextLine.evaluate(textLine.getExpressions(), new TextLine.ValueExtractor<DerivedColumn>() {
          public Object getValue(DerivedColumn t) {
            if (t.getAlias() == null && t.getExpression() instanceof ElementSymbol) {
              return ((ElementSymbol)t.getExpression()).getShortName();
            }
            return t.getAlias();
          }
        }, textLine.getDelimiter(), textLine.getQuote()));
      }
      w.flush();
      return fisf;
    } catch (IOException e) {
      throw new TeiidProcessingException(e);
    }
  }
View Full Code Here

Examples of java.io.Writer

      try {
        if (this.result == null) {
          this.result = buildResult();
        }
        String in = (String)input;
        Writer w = result.getWriter();
        w.write(in);
      w.flush();
    } catch (IOException e) {
      throw new TeiidProcessingException(e);
    }
    }
View Full Code Here

Examples of java.io.Writer

    if (f1.exists()) {
      Mapping mapping = new Mapping();
      try {
  mapping.loadMapping(mappingfile);
  Writer writer = new FileWriter(filename);
  Marshaller marshaller = new Marshaller(writer);
  marshaller.setMapping(mapping);
  marshaller.marshal(this);
  writer.close();
 
  log.info("written to XML");
      } catch (Exception e) {
  log.error(e.getMessage());
  e.printStackTrace();
View Full Code Here

Examples of java.io.Writer

        } else if(result instanceof SAXResult) {
            ContentHandler handler = ((SAXResult) result).getHandler();
            writeItemToSAX(handler);
        } else if(result instanceof StreamResult) {
            StreamResult streamResult = (StreamResult) result;
            final Writer writer = streamResult.getWriter();
            if(writer == null) {
                OutputStream os = streamResult.getOutputStream();
                writeItem(os, new Properties());
            } else {
                writeItem(writer, new Properties());
View Full Code Here

Examples of java.io.Writer

      metaData.setDescription(description);
      metaData.setCacheable(cacheable);
      metaData.setCategory(category);
      XStream xstream = new XStream(new DomDriver());
      xstream.alias(TMLMetadataInfo.XSTREAM_ALIAS, TMLMetadataInfo.class);
      Writer writer = null;
      try {
        if (!_metadataFolder.exists()) {
          _metadataFolder.create(true, true, new NullProgressMonitor())
          _metadataFile = _metadataFolder.getFile(_tmlFile.getName().substring(0, _tmlFile.getName().length() - _tmlFile.getFileExtension().length()) + "metadata.xml");
        }

        writer = new OutputStreamWriter(new FileOutputStream(_metadataFile.getLocation().toFile()), _fileEncoding);
        xstream.toXML(metaData, writer);
       
      } catch (CoreException e) {
        IOException ioe = new IOException("Unable to save metadata file '" + _metadataFile.getLocation() + "'.");
        ioe.setStackTrace(e.getStackTrace());
        throw ioe;
      } finally {
        if (writer != null) {
          try {
            writer.close();
          } catch (IOException e) {
          }
          try {
            if(_metadataFile!=null){
              _metadataFile.refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor());
View Full Code Here

Examples of java.io.Writer

     * )
     */
    public final void transferToClient(FtpSession session, final String str)
            throws IOException {
        OutputStream out = getDataOutputStream();
        Writer writer = null;
        try {
            writer = new OutputStreamWriter(out, "UTF-8");
            writer.write(str);

            // update session
            if (session instanceof DefaultFtpSession) {
                ((DefaultFtpSession) session).increaseWrittenDataBytes(str
                        .getBytes("UTF-8").length);
            }
        } finally {
            if (writer != null) {
                writer.flush();
            }
            IoUtils.close(writer);
        }

    }
View Full Code Here

Examples of java.io.Writer

     * whatever the encoding
     * @throws IOException on error
     */
    public static void exportToXML(HashMap names, OutputStream out, String encoding, boolean onlyASCII) throws IOException {
        String jenc = IanaEncodings.getJavaEncoding(encoding);
        Writer wrt = new BufferedWriter(new OutputStreamWriter(out, jenc));
        exportToXML(names, wrt, encoding, onlyASCII);
    }
View Full Code Here

Examples of java.io.Writer

      }
    }
  }

  public void flush() throws IOException {
    Writer writer = null;
    try {
      writer = new FileWriter(_file);
      _xstream.toXML(_beans, writer);
    } finally {
      if (writer != null) {
        try {
          writer.close();
        } catch (IOException e) {
        }
      }
    }
   
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.