Package java.io

Examples of java.io.Console.printf()


         crawler = new ProjectPageCrawler();
         crawler.showOff();

         Console console = System.console();
         if (null != console) {
            console.printf("Press any key to end...");
            console.readLine();
            }
         else {
            Thread.sleep(5000L);
            }
View Full Code Here


         crawler = new ProjectPageCrawler();
         crawler.showOff();

         Console console = System.console();
         if (null != console) {
            console.printf("Press any key to end...");
            console.readLine();
            }
         else {
            Thread.sleep(5000L);
            }
View Full Code Here

         crawler = new ProjectPageCrawler();
         crawler.showOff();

         Console console = System.console();
         if (null != console) {
            console.printf("Press any key to end...");
            console.readLine();
            }
         else {
            Thread.sleep(5000L);
            }
View Full Code Here

         crawler = new ProjectPageCrawler();
         crawler.showOff();

         Console console = System.console();
         if (null != console) {
            console.printf("Press any key to end...");
            console.readLine();
            }
         else {
            Thread.sleep(5000L);
            }
View Full Code Here

            IConverter converter = asConverter(args);
            try {
                Logger logger = LoggerFactory.getLogger(StandaloneClient.class);
                sayHello(converter, logger, console);
                DocumentType[] documentTypes = configureConversion(console, converter.getSupportedConversions());
                console.printf("Enter '<source> [-> <target>]' for converting a file. Enter '\\q' for exiting this application.%n");
                String argument;
                do {
                    console.printf("> ");
                    argument = console.readLine();
                    if (argument != null) {
View Full Code Here

                sayHello(converter, logger, console);
                DocumentType[] documentTypes = configureConversion(console, converter.getSupportedConversions());
                console.printf("Enter '<source> [-> <target>]' for converting a file. Enter '\\q' for exiting this application.%n");
                String argument;
                do {
                    console.printf("> ");
                    argument = console.readLine();
                    if (argument != null) {
                        if (argument.equals("\\q")) {
                            break;
                        } else if (argument.equals("\\f")) {
View Full Code Here

                        }
                        int targetIndex = argument.indexOf("->");
                        String source = targetIndex == -1 ? argument : argument.substring(0, targetIndex);
                        File sourceFile = normalize(source);
                        if (!sourceFile.isFile()) {
                            console.printf("Input file does not exist: %s%n", sourceFile);
                            continue;
                        }
                        String target = targetIndex == -1 ? source + "." + extensionFor(documentTypes[1]) : argument.substring(targetIndex + 1);
                        File targetFile = normalize(target);
                        converter.convert(sourceFile).as(documentTypes[0])
View Full Code Here

                        String target = targetIndex == -1 ? source + "." + extensionFor(documentTypes[1]) : argument.substring(targetIndex + 1);
                        File targetFile = normalize(target);
                        converter.convert(sourceFile).as(documentTypes[0])
                                .to(targetFile, new LoggingFileConsumer(sourceFile, logger)).as(documentTypes[1])
                                .schedule();
                        console.printf("Scheduled conversion: %s -> %s%n", sourceFile, targetFile);
                        logger.info("Converting {} to {}", sourceFile, targetFile);
                    } else {
                        logger.error("Error when reading from console.");
                    }
                } while (argument != null);
View Full Code Here

                } while (argument != null);
                sayGoodbye(converter, logger);
            } finally {
                converter.shutDown();
            }
            console.printf("The connection was successfully closed. Goodbye!%n");
        } catch (Exception e) {
            LoggerFactory.getLogger(StandaloneClient.class).error("The document conversion client terminated with an unexpected error", e);
            System.err.println(String.format("Error: %s", e.getMessage()));
            System.err.println("Use option -? to display a list of legal commands.");
            System.exit(-1);
View Full Code Here

        String user = null;
        String defuser = programOpts.getUser();
        if (defuser == null)
            defuser = SystemPropertyConstants.DEFAULT_ADMIN_USER;
        if (cons != null) {
            cons.printf("%s", strings.get("AdminUserPrompt", defuser));
            String val = cons.readLine();
            if (val != null && val.length() > 0)
                user = val;
            else
                user = defuser;
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.