String filemode = input.substring( 0, 1 ); if( "x".equals(filemode) ) filemode = "w";
String modifier = ""; String filemode = input.substring(0, 1);
  private String getFileMode( String input )  {    String filemode = input.substring( 0, 1 );    if( "x".equals(filemode) )      filemode = "w";    int i = input.lastIndexOf( 'r' );    int j = input.lastIndexOf( 'w' );    if( j > i )      i = j;    j = input.lastIndexOf( 'a' );    if( j > i )      i = j;    if( i > 0 )      filemode = input.substring( i, i+1 );    return filemode;  }