private static String escape(String str){
  if (str.indexOf(kindSeparator) < 0 && str.indexOf(compSeparator) < 0 && str.indexOf(escapeChar) < 0) {
    return str;
  }
 else {
    int len=str.length();
    int j=0;
    char[] newStr=new char[len + len];
    for (int i=0; i < len; i++) {
      if (isMeta(str.charAt(i))) {
        newStr[j++]=escapeChar;
      }
      newStr[j++]=str.charAt(i);
    }
    return new String(newStr,0,j);
  }
}

private static String escape ( String str ) { if ( str . indexOf ( kindSeparator ) < 0 && str . indexOf ( compSeparator ) < 0 && str . indexOf ( escapeChar ) < 0 ) { return str ; } else { int len = str . length ( ) ; int j = 0 ; char [ ] newStr = new char [ len + len ] ; for ( int i = 0 ; i < len ; i ++ ) { if ( isMeta ( str . charAt ( i ) ) ) { newStr [ j ++ ] = escapeChar ; } newStr [ j ++ ] = str . charAt ( i ) ; } return new String ( newStr , 0 , j ) ; } }
returns a string with ' . ' , ' \ ' , ' / ' escaped . used when stringifying the name into its ins stringified form .
