void (File file) { String path = file.getPath(); int i = path.indexOf(".."); if (i != -1) { String filepath = path.substring(0,i-1); File filepart = new File(filepath); if (filepart.exists() && !filepart.isDirectory()) { LOG.error("Incorrect file path: '" + path + '\''); } } }