class Utilities {

    public static File getFileFromCustomInput(Object input) {
        final File fileCheck = (File) input;
        final String path = fileCheck.getAbsolutePath();
        final int imageSpecifierIndex = path.lastIndexOf(":");
        final File file;
        if (OSTYPE.equals(OSType.WINDOWS)) {
            if (imageSpecifierIndex > 1 && imageSpecifierIndex > path.indexOf(":")) {
                file = new File(path.substring(0, imageSpecifierIndex));
            } else {
                file = fileCheck;
            }
        } else {
            if (imageSpecifierIndex > 0) {
                file = new File(path.substring(0, imageSpecifierIndex));
            } else {
                file = fileCheck;
            }
        }

        return file;
    }

    private  Utilities();

}