private void normalizeLocalFileName(StringBuilder localFileName){
  while (true) {
    int dotDotIndex=localFileName.indexOf("/../");
    if (dotDotIndex < 0) {
      break;
    }
    int parentIndex=localFileName.lastIndexOf("/",dotDotIndex - 1);
    if (parentIndex < 0) {
      break;
    }
    localFileName.delete(parentIndex,dotDotIndex + 3);
  }
  if (localFileName.length() >= 3 && localFileName.lastIndexOf("/..") == localFileName.length() - 3) {
    if (localFileName.length() <= 3) {
      localFileName.setLength(0);
    }
 else {
      int parentIndex=localFileName.lastIndexOf("/",localFileName.length() - 4);
      if (parentIndex < 0) {
        localFileName.setLength(0);
      }
 else {
        localFileName.setLength(parentIndex);
      }
    }
  }
  while (true) {
    int dotIndex=localFileName.indexOf("/./");
    if (dotIndex < 0) {
      break;
    }
    localFileName.delete(dotIndex,dotIndex + 2);
  }
  if (localFileName.length() >= 2 && localFileName.lastIndexOf("/.") == localFileName.length() - 2) {
    localFileName.setLength(localFileName.length() - 2);
  }
  if (localFileName.length() > 0 && localFileName.charAt(0) == '/') {
    localFileName.deleteCharAt(0);
  }
  if (localFileName.length() > 0 && localFileName.charAt(localFileName.length() - 1) == '/') {
    localFileName.setLength(localFileName.length() - 1);
  }
}

private void normalizeLocalFileName ( StringBuilder localFileName ) { while ( true ) { int dotDotIndex = localFileName . indexOf ( "/../" ) ; if ( dotDotIndex < 0 ) { break ; } int parentIndex = localFileName . lastIndexOf ( "/" , dotDotIndex - 1 ) ; if ( parentIndex < 0 ) { break ; } localFileName . delete ( parentIndex , dotDotIndex + 3 ) ; } if ( localFileName . length ( ) >= 3 && localFileName . lastIndexOf ( "/.." ) == localFileName . length ( ) - 3 ) { if ( localFileName . length ( ) <= 3 ) { localFileName . setLength ( 0 ) ; } else { int parentIndex = localFileName . lastIndexOf ( "/" , localFileName . length ( ) - 4 ) ; if ( parentIndex < 0 ) { localFileName . setLength ( 0 ) ; } else { localFileName . setLength ( parentIndex ) ; } } } while ( true ) { int dotIndex = localFileName . indexOf ( "/./" ) ; if ( dotIndex < 0 ) { break ; } localFileName . delete ( dotIndex , dotIndex + 2 ) ; } if ( localFileName . length ( ) >= 2 && localFileName . lastIndexOf ( "/." ) == localFileName . length ( ) - 2 ) { localFileName . setLength ( localFileName . length ( ) - 2 ) ; } if ( localFileName . length ( ) > 0 && localFileName . charAt ( 0 ) == '/' ) { localFileName . deleteCharAt ( 0 ) ; } if ( localFileName . length ( ) > 0 && localFileName . charAt ( localFileName . length ( ) - 1 ) == '/' ) { localFileName . setLength ( localFileName . length ( ) - 1 ) ; } }
normalize the given local file name : - resolve " . . " and " . " special notation - remove leading and trailing " / "
