Examples of format()


Examples of com.cloudera.flume.handlers.avro.AvroNativeFileOutputFormat.format()

  @Test
  public void testAvroNativeJson() throws IOException {
    AvroNativeFileOutputFormat format = new AvroNativeFileOutputFormat();
    ByteArrayOutputStream sos = new ByteArrayOutputStream();
    format.format(sos, e);
    format.close();
    byte[] bytes = sos.toByteArray();

    ReflectData reflectData = ReflectData.get();
    Schema schema = reflectData.getSchema(EventImpl.class);
View Full Code Here

Examples of com.cloudera.flume.handlers.text.SyslogEntryFormat.format()

    snk.append(e);
    snk.close();

    ByteArrayOutputStream exWriter = new ByteArrayOutputStream();
    SyslogEntryFormat fmt = new SyslogEntryFormat();
    fmt.format(exWriter, e);
    exWriter.close();
    String expected = new String(exWriter.toByteArray());

    // check the output to make sure it is what we expected.
    File fo = new File(f.getPath() + "/sub-foo");
View Full Code Here

Examples of com.cloudera.flume.handlers.text.output.Log4jOutputFormat.format()

    snk.append(e);
    snk.close();

    ByteArrayOutputStream exWriter = new ByteArrayOutputStream();
    Log4jOutputFormat fmt = new Log4jOutputFormat();
    fmt.format(exWriter, e);
    exWriter.close();
    String expected = new String(exWriter.toByteArray());

    // check the output to make sure it is what we expected.
    File fo = new File(f.getPath() + "/sub-foo");
View Full Code Here

Examples of com.cloudera.flume.handlers.text.output.OutputFormat.format()

    LOG.info("filename before escaping: " + f.getAbsolutePath());
    OutputFormat out = FormatFactory.get().getOutputFormat("avrodata", args);
    mem.open();
    Event e = mem.next();
    while (e != null) {
      out.format(fos, e);
      e = mem.next();
    }

    mem.open();
    DatumReader<EventImpl> dtm = new ReflectDatumReader<EventImpl>(
View Full Code Here

Examples of com.denimgroup.threadfix.annotations.ScanImporter.format()

        Map<ScanImporter, Class<?>> typeMap = ScannerTypeLoader.getMap();

        for (Entry<ScanImporter, Class<?>> entry : typeMap.entrySet()) {
            ScanImporter annotation = entry.getKey();

            if (annotation.format() == ScanFormat.XML) {
                boolean addedEntry = false;

                if (annotation.startingXMLTags().length != 0) {
                    addToMap(annotation.scannerName(), annotation.startingXMLTags());
                    addedEntry = true;
View Full Code Here

Examples of com.director.core.json.JsonParser.format()

      public void format(DirectEvent[] events) {
         try {
            DirectConfiguration configuration = DirectContext.get().getConfiguration();
            JsonParser jsonParser = configuration.getParser();
            PrintWriter writer = this.response.getWriter();
            jsonParser.format(events, writer);
         } catch(IOException e) {
            throw new DirectException(e);
         }
      }
   }
View Full Code Here

Examples of com.dotcms.repackage.com.ibm.icu.text.SimpleDateFormat.format()

        } catch (DotDataException e) {
          Logger.error(this.getClass(), e.getMessage(), e);
          throw new JobExecutionException(e);
        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmm00");
        String now = sdf.format(new Date());
   
        /*
         * do publish first, where publish is in the past and expire is in the
         * future and live = false
         */
 
View Full Code Here

Examples of com.dotcms.repackage.org.apache.commons.lang.time.FastDateFormat.format()

       
        // also it should be in the index update with the new dates
        FastDateFormat datetimeFormat = ESMappingAPIImpl.datetimeFormat;
        String q="+structureName:"+testStructure.getVelocityVarName()+
                " +inode:"+c11.getInode()+
                " +"+testStructure.getVelocityVarName()+"."+fieldPubDate.getVelocityVarName()+":"+datetimeFormat.format(d3)+
                " +"+testStructure.getVelocityVarName()+"."+fieldExpDate.getVelocityVarName()+":"+datetimeFormat.format(d4);
        assertEquals(1,APILocator.getContentletAPI().indexCount(q, user, false));
    }

View Full Code Here

Examples of com.dubture.twig.core.format.TwigFormatter.format()

        JobSafeStructuredDocument newdocument = new JobSafeStructuredDocument(
                new TwigSourceParser());
        String start = "<?php";
        newdocument.set(start + tempsb.toString());
        TwigFormatter formatter = new TwigFormatter(0, newdocument.getLength());
        formatter.format(newdocument.getFirstStructuredDocumentRegion());

        List<String> list = new ArrayList<String>();
        try {
            int lineNumber = newdocument.getNumberOfLines();
            for (int i = 0; i < lineNumber; i++) {
View Full Code Here

Examples of com.dyuproject.protostuff.parser.Formatter.format()

     */
    public static String format(String str, String formatName)
    {
        final Formatter formatter = DEFAULT_FORMATTERS.get(formatName);
        if(formatter != null)
            return formatter.format(str);
       
        // regex replace
        int eq = formatName.indexOf("==");
        if(eq > 0)
        {
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.