@Test(expected = Exception.class) public void getYamlDataObjectExceptionTest() { AclUtils.getYamlDataObject("plain_acl.yml", Map.class); }
public static <T> T getYamlDataObject(String path, Class<T> clazz) { Yaml ymal = new Yaml(); FileInputStream fis = null; try { fis = new FileInputStream(new File(path)); return ymal.loadAs(fis, clazz); } catch (Exception e) { throw new AclException(String.format("The file for Plain mode was not found , paths %s", path), e); } finally { if (fis != null) { try { fis.close(); } catch (IOException e) { throw new AclException("close transport fileInputStream Exception", e); } } } }
AclUtils { public static <T> T getYamlDataObject(String path, Class<T> clazz) { Yaml ymal = new Yaml(); FileInputStream fis = null; try { fis = new FileInputStream(new File(path)); return ymal.loadAs(fis, clazz); } catch (Exception e) { throw new AclException(String.format("The file for Plain mode was not found , paths %s", path), e); } finally { if (fis != null) { try { fis.close(); } catch (IOException e) { throw new AclException("close transport fileInputStream Exception", e); } } } } }
AclUtils { public static <T> T getYamlDataObject(String path, Class<T> clazz) { Yaml ymal = new Yaml(); FileInputStream fis = null; try { fis = new FileInputStream(new File(path)); return ymal.loadAs(fis, clazz); } catch (Exception e) { throw new AclException(String.format("The file for Plain mode was not found , paths %s", path), e); } finally { if (fis != null) { try { fis.close(); } catch (IOException e) { throw new AclException("close transport fileInputStream Exception", e); } } } }  }
AclUtils { public static <T> T getYamlDataObject(String path, Class<T> clazz) { Yaml ymal = new Yaml(); FileInputStream fis = null; try { fis = new FileInputStream(new File(path)); return ymal.loadAs(fis, clazz); } catch (Exception e) { throw new AclException(String.format("The file for Plain mode was not found , paths %s", path), e); } finally { if (fis != null) { try { fis.close(); } catch (IOException e) { throw new AclException("close transport fileInputStream Exception", e); } } } }  static byte[] combineRequestContent(RemotingCommand request, SortedMap<String, String> fieldsMap); static byte[] combineBytes(byte[] b1, byte[] b2); static String calSignature(byte[] data, String secretKey); static void verify(String netaddress, int index); static String[] getAddreeStrArray(String netaddress, String four); static boolean isScope(String num, int index); static boolean isScope(String[] num, int index); static boolean isScope(String num); static boolean isScope(int num); static boolean isAsterisk(String asterisk); static boolean isColon(String colon); static boolean isMinus(String minus); static T getYamlDataObject(String path, Class<T> clazz); }
AclUtils { public static <T> T getYamlDataObject(String path, Class<T> clazz) { Yaml ymal = new Yaml(); FileInputStream fis = null; try { fis = new FileInputStream(new File(path)); return ymal.loadAs(fis, clazz); } catch (Exception e) { throw new AclException(String.format("The file for Plain mode was not found , paths %s", path), e); } finally { if (fis != null) { try { fis.close(); } catch (IOException e) { throw new AclException("close transport fileInputStream Exception", e); } } } }  static byte[] combineRequestContent(RemotingCommand request, SortedMap<String, String> fieldsMap); static byte[] combineBytes(byte[] b1, byte[] b2); static String calSignature(byte[] data, String secretKey); static void verify(String netaddress, int index); static String[] getAddreeStrArray(String netaddress, String four); static boolean isScope(String num, int index); static boolean isScope(String[] num, int index); static boolean isScope(String num); static boolean isScope(int num); static boolean isAsterisk(String asterisk); static boolean isColon(String colon); static boolean isMinus(String minus); static T getYamlDataObject(String path, Class<T> clazz);  }