docs: private synchronized void canonicalizePath () {
          char[] in = this.url.getPath().toCharArray();
          char[] out = new char[in.length];
          int length = in.length, prefixLen = 0, state = 0;
  
          /*
           * The canonicalization routine
           */
          for ( int i = 0; i < length; i++ ) {
              switch ( state ) {
              case 0:
                  if ( in[ i ] != '/' ) {
                      // Checked exception (e.g. MalformedURLException) would be better
                      // but this would be a nightmare API wise
                      throw new RuntimeCIFSException("Invalid smb: URL: " + this.url);
                  }
                  out[ prefixLen++ ] = in[ i ];
                  state = 1;
                  break;
              case 1:
                  if ( in[ i ] == '/' ) {
                      break;
                  }
                  else if ( in[ i ] == '.' && ( ( i + 1 ) >= length || in[ i + 1 ] == '/' ) ) {
                      i++;
                      break;
                  }
                  else if ( ( i + 1 ) < length && in[ i ] == '.' && in[ i + 1 ] == '.' && ( ( i + 2 ) >= length || in[ i + 2 ] == '/' ) ) {
                      i += 2;
                      if ( prefixLen == 1 )
                          break;
                      do {
                          prefixLen--;
                      }
                      while ( prefixLen > 1 && out[ prefixLen - 1 ] != '/' );
                      break;
                  }
                  state = 2;
              case 2:
                  if ( in[ i ] == '/' ) {
                      state = 1;
                  }
                  out[ prefixLen++ ] = in[ i ];
                  break;
              }
          }
  
          this.canon = new String(out, 0, prefixLen);
          if ( prefixLen > 1 ) {
              prefixLen--;
              int firstSep = this.canon.indexOf('/', 1);
              if ( firstSep < 0 ) {
                  this.share = this.canon.substring(1);
                  this.unc = "\\";
              }
              else if ( firstSep == prefixLen ) {
                  this.share = this.canon.substring(1, firstSep);
                  this.unc = "\\";
              }
              else {
                  this.share = this.canon.substring(1, firstSep);
                  this.unc = this.canon.substring(firstSep, prefixLen + 1).replace('/', '\\');
              }
          }
          else {
              this.canon = "/";
              this.share = null;
              this.unc = "\\";
          }
      }