code: public static void belongsTo(File directory, File parameter, String name) throws IllegalArgumentException {
  		String dirPath = directory.getAbsolutePath();
  		String filePath = parameter.getAbsolutePath();
  		if (!filePath.startsWith(dirPath)) {
  			throw new IllegalArgumentException(String.format("%s |%s| is outside directory |%s|.", name, filePath, dirPath));
  		}
  	}
docs: Check if file parameter belongs to requested directory. This predicate test if given <code>directory</code> is ancestor
  of <code>parameter</code> file.
  
  @param directory directory supposed to be ancestor of file parameter,
  @param parameter invocation file parameter,
  @param name parameter name.
  @throws IllegalArgumentException if <code>parameter</code> file is outside <code>directory</code>.