org.jgroups.util.Util.components()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(218)

本文整理了Java中org.jgroups.util.Util.components()方法的一些代码示例,展示了Util.components()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.components()方法的具体详情如下:
包路径:org.jgroups.util.Util
类名称:Util
方法名:components

Util.components介绍

暂无

代码示例

代码示例来源:origin: wildfly/wildfly

  1. protected static String filename(String full_path) {
  2. String[] comps=Util.components(full_path, File.separator);
  3. return comps != null? comps[comps.length -1] : null;
  4. }

代码示例来源:origin: wildfly/wildfly

  1. protected static String trim(String str) {
  2. if(str == null) return null;
  3. str=str.trim();
  4. if(str.equals(File.separator))
  5. return str;
  6. String[] comps=Util.components(str, File.separator);
  7. return comps != null && comps.length > 0? comps[comps.length-1] : null;
  8. }

代码示例来源:origin: wildfly/wildfly

  1. /**
  2. * Verifies whether child is a child (dir or file) of parent
  3. * @param parent
  4. * @param child
  5. * @return True if child is a child, false otherwise
  6. */
  7. protected static boolean isChildOf(String parent, String child) {
  8. if(parent == null || child == null)
  9. return false;
  10. if(!child.startsWith(parent))
  11. return false;
  12. if(child.length() <= parent.length())
  13. return false;
  14. int from=parent.equals(File.separator)? parent.length() : parent.length() +1;
  15. // if(from-1 > child.length())
  16. // return false;
  17. String[] comps=Util.components(child.substring(from), File.separator);
  18. return comps != null && comps.length <= 1;
  19. }

代码示例来源:origin: wildfly/wildfly

  1. String[] comps=Util.components(grid_path, File.separator);
  2. String filename=comps[comps.length - 1];
  3. target_path=target_path + (target_path.endsWith(File.separator)? filename : File.separator + filename);

代码示例来源:origin: wildfly/wildfly

  1. String[] components=Util.components(path, File.separator);
  2. if(components == null)
  3. return false;

代码示例来源:origin: wildfly/wildfly

  1. String[] comps=Util.components(local_path, File.separator);
  2. String filename=comps[comps.length - 1];
  3. target_path=target_path + (target_path.equals(File.separator)? filename : File.separator + filename);

代码示例来源:origin: org.jboss.eap/wildfly-client-all

  1. protected static String filename(String full_path) {
  2. String[] comps=Util.components(full_path, File.separator);
  3. return comps != null? comps[comps.length -1] : null;
  4. }

代码示例来源:origin: org.jboss.eap/wildfly-client-all

  1. protected static String trim(String str) {
  2. if(str == null) return null;
  3. str=str.trim();
  4. if(str.equals(File.separator))
  5. return str;
  6. String[] comps=Util.components(str, File.separator);
  7. return comps != null && comps.length > 0? comps[comps.length-1] : null;
  8. }

代码示例来源:origin: org.jboss.eap/wildfly-client-all

  1. /**
  2. * Verifies whether child is a child (dir or file) of parent
  3. * @param parent
  4. * @param child
  5. * @return True if child is a child, false otherwise
  6. */
  7. protected static boolean isChildOf(String parent, String child) {
  8. if(parent == null || child == null)
  9. return false;
  10. if(!child.startsWith(parent))
  11. return false;
  12. if(child.length() <= parent.length())
  13. return false;
  14. int from=parent.equals(File.separator)? parent.length() : parent.length() +1;
  15. // if(from-1 > child.length())
  16. // return false;
  17. String[] comps=Util.components(child.substring(from), File.separator);
  18. return comps != null && comps.length <= 1;
  19. }

代码示例来源:origin: org.jboss.eap/wildfly-client-all

  1. String[] comps=Util.components(grid_path, File.separator);
  2. String filename=comps[comps.length - 1];
  3. target_path=target_path + (target_path.endsWith(File.separator)? filename : File.separator + filename);

代码示例来源:origin: org.jboss.eap/wildfly-client-all

  1. String[] components=Util.components(path, File.separator);
  2. if(components == null)
  3. return false;

代码示例来源:origin: org.jboss.eap/wildfly-client-all

  1. String[] comps=Util.components(local_path, File.separator);
  2. String filename=comps[comps.length - 1];
  3. target_path=target_path + (target_path.equals(File.separator)? filename : File.separator + filename);

相关文章

Util类方法