Examples of StreamHandler


Examples of com.github.stephenc.javaisotools.sabre.StreamHandler

        ElToritoConfig.PLATFORM_ID_X86, "isoTest", 4,
        ElToritoConfig.LOAD_SEGMENT_7C0);
    }

    // Create ISO
    StreamHandler streamHandler = new ISOImageFileHandler(outfile);
    CreateISO iso = new CreateISO(streamHandler, root);
    iso.process(iso9660Config, rrConfig, jolietConfig, elToritoConfig);
    System.out.println("Done. File is: " + outfile);
  }
View Full Code Here

Examples of com.ponysdk.core.event.StreamHandler

            public void onSubmitComplete() {
                PNotificationManager.showTrayNotification("File uploaded, submit file '" + fileUpload.getFileName() + "'");
            }
        });

        fileUpload.addStreamHandler(new StreamHandler() {

            @Override
            public void onStream(final HttpServletRequest request, final HttpServletResponse response) {
                try {
                    response.setStatus(HttpServletResponse.SC_CREATED);
View Full Code Here

Examples of de.tu_darmstadt.informatik.rbg.mhartle.sabre.StreamHandler

        if (dest == null || !dest.getName().endsWith(".iso")) {throw new IllegalArgumentException("dest must not be null and end in '.iso'");}

        final ISO9660RootDirectory root = new ISO9660RootDirectory();
        try {
            root.addContentsRecursively(src);
            final StreamHandler streamHandler = new ISOImageFileHandler(dest);
            CreateISO iso = new CreateISO(streamHandler, root);
            iso.process(new ISO9660Config(), new RockRidgeConfig(), new JolietConfig(), null);
        } catch (Exception e) {
            throw new RuntimeException("failed to create image", e);
        }
View Full Code Here

Examples of java.util.logging.StreamHandler

    @Test
    public void changeVariables_isSourceConnectorEnabledCalled() {
        final List<Level> levels = new ArrayList<Level>();
        Logger.getLogger(DragAndDropService.class.getName()).addHandler(
                new StreamHandler() {
                    @Override
                    public synchronized void publish(LogRecord record) {
                        levels.add(record.getLevel());
                    }
                });
View Full Code Here

Examples of java.util.logging.StreamHandler

    @Test
    public void changeVariables_isTargetConnectorEnabledCalled() {
        final List<Level> levels = new ArrayList<Level>();
        Logger.getLogger(DragAndDropService.class.getName()).addHandler(
                new StreamHandler() {
                    @Override
                    public void publish(LogRecord record) {
                        levels.add(record.getLevel());
                    }
                });
View Full Code Here

Examples of java.util.logging.StreamHandler

   *          whether or not this is in debug mode
   */
  public synchronized void debug(boolean debug) {
    this.debug = debug;
    if (debug && debugHandler == null) {
      debugHandler = new StreamHandler(System.out, new SimpleFormatter());
      debugHandler.setLevel(Level.ALL);
    }
  }
View Full Code Here

Examples of java.util.logging.StreamHandler

    }

    @BeforeClass
    public static void redirectLoggerOutput() throws IOException {
        logOutput = new ByteArrayOutputStream();
        logHandler = new StreamHandler(logOutput, new SimpleFormatter());
        logHandler.setLevel(Level.ALL);
        LOGGER.addHandler(logHandler);
    }
View Full Code Here

Examples of java.util.logging.StreamHandler

  implements Testlet
{
  public void test(TestHarness h)
  {
    XMLFormatter formatter = new XMLFormatter();
    StreamHandler handler = new StreamHandler();

    // Check #1.
    h.check(formatter.getTail(handler),
            "</log>" + System.getProperty("line.separator"));
View Full Code Here

Examples of java.util.logging.StreamHandler

  implements Testlet
{
  public void test(TestHarness h)
  {
    Formatter formatter;
    StreamHandler handler;

    formatter = new XMLFormatter();
    handler = new StreamHandler();

    // Check point "no encoding set".
    h.checkPoint("no encoding set");
    h.check(formatter.getHead(handler),
            getExpectedHead(System.getProperty("file.encoding")));


    // Check point "UTF-8".
    h.checkPoint("UTF-8");
    try
      {
        handler.setEncoding("UTF-8");
      }
    catch (Exception ex)
      {
        h.check(false);
        h.debug(ex);
View Full Code Here

Examples of java.util.logging.StreamHandler

    public static org.syrup.Data manageError(Logger logger, Throwable error,
        String msg)
    {
        ByteArrayOutputStream buffer = new ByteArrayOutputStream();

        Handler logHandler = new StreamHandler(buffer, new XMLFormatter());
        logHandler.setLevel(Level.ALL);
        logger.addHandler(logHandler);

        try
        {
            logger.log(Level.SEVERE, msg, error);
            logHandler.flush();
            logHandler.close();
            return new DataImpl(buffer.toByteArray());
        }
        finally
        {
            // Make sure it is always removed so that it won't leak.
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.