RegConverter conv = new RegConverter(reg.getAbsolutePath(), file_format); System.out.println("Start converting files..."); conv.convert(); System.out.println("Converting finished!");  System.exit(0); }
RegConverter conv = new RegConverter(reg.getPath(), file_format); System.out.println("Start converting files..."); if(conv.convert()) { System.out.println("Converting finished!"); System.out.println("The old files have been stored in " + reg.getPath() + "old!"); System.exit(0);  } else {  System.out.println("Converting failed! Check the output for more information."); System.exit(1); } }
    public static void main(String[] args)    {        // get registry folder        System.out.println("YaCE 2 - Registry converter");        File reg = null;        while(true)        {            System.out.println();            System.out.println("Please enter the folder where the registry files are stored:");            // get the line into reg_folder            String reg_folder = getLine();            System.out.println();            // check if the reg_folder exists and is a directory            // and if permissions to read an write are set            // otherwise repeat this step            reg = new File(reg_folder);            // check if reg_folder exists            if(!reg.exists())            {                System.out.println("This folder does not exist!");                continue;            }            // check if reg_folder is a directory            if(!reg.isDirectory())            {                System.out.println(reg_folder + " is not a directory!");                continue;            }            // check if read and write permissions are set            if(!reg.canRead() || !reg.canWrite())            {                System.out.println("Permission denied: You have to set read and write permissions to this directory!");                continue;            }            break;        }        System.out.println();        // ask if automatically detect the file format        System.out.println("The registry converter can automatically detect the file format.");        System.out.println("Should the registry converter automatically detect the file format? (y/n)");        // get the line into detect        String detect = getLine();        int file_format;        System.out.println();        // check if input is "y" or "n"        if(detect.equals("y"))        {            System.out.println("Registry converter will now automatically detect the file format.");            // auto detect            file_format = autoDetect(reg);            System.out.println(file_format);            // check if a file was not readable            switch(file_format)            {                case -1:                    System.out.println("At least one file could not be read!");                    System.out.println("Please check your permissions and start this program again.");                    System.exit(1);                    break;                case 0:                    System.out.println("The file format could not be detected definitely.");                    System.out.println("Please enter the file format manually.");                    file_format = getFileFormat();                    break;                case 1:                    System.out.println("The YaCE 1 file format was detected! Is this right? (y/n)");                    if(!getLine().equals("y"))                    {                        file_format = getFileFormat();                    }                    break;                case 2:                    System.out.println("The YaCE 2 file format was detected! Is this right? (y/n)");                    if(!getLine().equals("y"))                    {                    file_format = getFileFormat();                    }                    break;                case 3:                    System.out.println("The YaCE 2 Remake file format was detected! Is this right? (y/n)");                    if(!getLine().equals("y"))                    {                        file_format = getFileFormat();                    }                    break;                default: // never happens                    break;            }        }        else        {            file_format = getFileFormat();        }        System.out.println(file_format);        // initialize the converter        RegConverter conv = new RegConverter(reg.getAbsolutePath(), file_format);        System.out.println("Start converting files...");        conv.convert();        System.out.println("Converting finished!");        System.exit(0);    }