private boolean isCopyOnItself(String src,String dest){
  return dest.equals(src) || dest.startsWith(src + File.separator);
}

private boolean isCopyOnItself ( String src , String dest ) { return dest . equals ( src ) || dest . startsWith ( src + File . separator ) ; }
check to see if the user attempted to copy an entry into its parent without changing its name , or attempted to copy a directory into a directory that it contains directly or indirectly .
