private boolean isHardcodedFilenameString(String string){
  if (string == null) {
    return false;
  }
  if (string.indexOf((int)'/') == -1 && string.indexOf((int)'\\') == -1) {
    return false;
  }
  final char startChar=string.charAt(0);
  if (Character.isLetter(startChar) && string.charAt(1) == ':') {
    return true;
  }
  if (isXMLString(string)) {
    return false;
  }
  if (isDateFormatString(string)) {
    return false;
  }
  if (isURLString(string)) {
    return false;
  }
  if (isMediaTypeString(string)) {
    return false;
  }
  return !isTimeZoneIdString(string);
}

private boolean isHardcodedFilenameString ( String string ) { if ( string == null ) { return false ; } if ( string . indexOf ( ( int ) '/' ) == - 1 && string . indexOf ( ( int ) '\\' ) == - 1 ) { return false ; } final char startChar = string . charAt ( 0 ) ; if ( Character . isLetter ( startChar ) && string . charAt ( 1 ) == ':' ) { return true ; } if ( isXMLString ( string ) ) { return false ; } if ( isDateFormatString ( string ) ) { return false ; } if ( isURLString ( string ) ) { return false ; } if ( isMediaTypeString ( string ) ) { return false ; } return ! isTimeZoneIdString ( string ) ; }
check whether a string is likely to be a filename containing one or more hard - coded file separator characters . the method does some simple analysis of the string to determine whether it ' s likely to be some other type of data - a url , a date format , or an xml fragment - before deciding that the string is a filename .
