@Test(expected = InvalException.class) public void testBadUtf8() throws ChimeraNFSException { NameFilter.convertName(BAD_UTF8); }
public static String convertName(byte[] bytes) throws ChimeraNFSException { String name = convertPath(bytes); if (name.length() > NFSv4Defaults.NFS4_MAXFILENAME) { throw new NameTooLongException("name too long"); } if (name.equals(".") || name.equals("..")) { throw new BadNameException("bad name '.' or '..'"); } if (name.indexOf('/') != -1) { throw new BadNameException("name with slash '/'"); } return name; }
NameFilter { public static String convertName(byte[] bytes) throws ChimeraNFSException { String name = convertPath(bytes); if (name.length() > NFSv4Defaults.NFS4_MAXFILENAME) { throw new NameTooLongException("name too long"); } if (name.equals(".") || name.equals("..")) { throw new BadNameException("bad name '.' or '..'"); } if (name.indexOf('/') != -1) { throw new BadNameException("name with slash '/'"); } return name; } }
NameFilter { public static String convertName(byte[] bytes) throws ChimeraNFSException { String name = convertPath(bytes); if (name.length() > NFSv4Defaults.NFS4_MAXFILENAME) { throw new NameTooLongException("name too long"); } if (name.equals(".") || name.equals("..")) { throw new BadNameException("bad name '.' or '..'"); } if (name.indexOf('/') != -1) { throw new BadNameException("name with slash '/'"); } return name; } private  NameFilter(); }
NameFilter { public static String convertName(byte[] bytes) throws ChimeraNFSException { String name = convertPath(bytes); if (name.length() > NFSv4Defaults.NFS4_MAXFILENAME) { throw new NameTooLongException("name too long"); } if (name.equals(".") || name.equals("..")) { throw new BadNameException("bad name '.' or '..'"); } if (name.indexOf('/') != -1) { throw new BadNameException("name with slash '/'"); } return name; } private  NameFilter(); static String convertName(byte[] bytes); static String convertPath(byte[] bytes); }
NameFilter { public static String convertName(byte[] bytes) throws ChimeraNFSException { String name = convertPath(bytes); if (name.length() > NFSv4Defaults.NFS4_MAXFILENAME) { throw new NameTooLongException("name too long"); } if (name.equals(".") || name.equals("..")) { throw new BadNameException("bad name '.' or '..'"); } if (name.indexOf('/') != -1) { throw new BadNameException("name with slash '/'"); } return name; } private  NameFilter(); static String convertName(byte[] bytes); static String convertPath(byte[] bytes);  }