public boolean checkPath(String path, boolean isExistingFile) {
        File test = new File(path);
        if (isExistingFile && !test.isDirectory()) {
            return test.exists();
        } else {
            if (!isExistingFile) {
                return test.exists();
            }
        }
        return false;
    }