package com.github.tkurz.sesame.vocab;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import org.openrdf.rio.RDFFormat;
import org.openrdf.rio.Rio;

/**
 * ...
 * <p/>
 * Author: Thomas Kurz (tkurz@apache.org)
 */
public class Main {

    public static void main(String [] args) {
        try {
            String file = "ldp.ttl"; //"src/main/resources/ldp.ttl";
            RDFFormat type = RDFFormat.RDFXML;

            BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
            System.out.println("*** RDF Namespace Constants Constructor ***");

            if(args.length > 0 && args[0] != null) {
                file = args[0];
                System.out.println("filepath : "+file);
            } else {
                System.out.println("insert filepath [" + file + "] : ");
                String _file = reader.readLine();if(!_file.equals(""))file=_file;
            }

            if(args.length > 1 && args[1] != null) {
                type = Rio.getParserFormatForMIMEType(args[1], type);
                System.out.println("mimetype : "+type);
            } else {
                if(file.contains(".")) type = Rio.getParserFormatForFileName(file, type);
                System.out.println("insert file mimetype [" + type.getDefaultMIMEType() + "] : ");
                String _type=reader.readLine();if(!_type.equals(""))type=Rio.getParserFormatForFileName(_type, type);
            }

            //parse data and get url prefix
            VocabBuilder e = new VocabBuilder(file,type);
            System.out.println("insert url-prefix [" + e.prefix + "] : ");
            String _prefix=reader.readLine();if(!_prefix.equals(""))e.prefix=_prefix;

            System.out.println("insert class name [" + e.name + "] : ");
            String _name=reader.readLine();if(!_name.equals(""))e.name=_name;

            System.out.println("insert package name ["+e.packageName+"] : ");
            String _pname=reader.readLine();if(!_pname.equals(""))e.packageName=_pname;

            System.out.println("insert output folder ["+e.outputFolder+"] : ");
            String _outputFolder=reader.readLine();if(!_outputFolder.equals(""))e.outputFolder=_outputFolder;

            e.run();
            System.out.println("*** file created: '"+e.outputFolder+"/"+e.name+".java' ***");
        } catch(Exception e) {
            e.printStackTrace();
        }
    }

    private static RDFFormat getMimeType(String file_extension) {
    	return Rio.getParserFormatForFileName(file_extension, RDFFormat.RDFXML);
    }


}

@@ -64,16 +64,40 @@
 Reader;%0A
+import java.io.Console;%0A
 import j
@@ -465,83 +465,40 @@
     
-BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)
+Console reader = System.console(
 );%0A 

Use System.console() instead of System.in