本文整理汇总了Java中org.fuin.utils4j.Utils4J.checkValidDir方法的典型用法代码示例。如果您正苦于以下问题:Java Utils4J.checkValidDir方法的具体用法?Java Utils4J.checkValidDir怎么用?Java Utils4J.checkValidDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.fuin.utils4j.Utils4J
的用法示例。
在下文中一共展示了Utils4J.checkValidDir方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: assertMethodsNotUsed
import org.fuin.utils4j.Utils4J; //导入方法依赖的package包/类
/**
* Asserts that a set of methods is not used.
*
* @param classesDir
* Directory with the ".class" files to check - Cannot be
* <code>null</code> and must be a valid directory.
* @param filter
* File filter or NULL (process all '*.class' files).
* @param methodsToFind
* List of methods to find - Cannot be NULL.
*/
public static final void assertMethodsNotUsed(final File classesDir,
final FileFilter filter, final List<MCAMethod> methodsToFind) {
Utils4J.checkNotNull("classesDir", classesDir);
Utils4J.checkValidDir(classesDir);
Utils4J.checkNotNull("methodsToFind", methodsToFind);
final MethodCallAnalyzer analyzer = new MethodCallAnalyzer(
methodsToFind);
analyzer.findCallingMethodsInDir(classesDir, filter);
final List<MCAMethodCall> methodCalls = analyzer.getMethodCalls();
if (methodCalls.size() > 0) {
final StringBuffer sb = new StringBuffer(
"Illegal method call(s) found:");
for (final MCAMethodCall methodCall : methodCalls) {
sb.append("\n");
sb.append(methodCall);
}
Assert.fail(sb.toString());
}
}
示例2: assertRules
import org.fuin.utils4j.Utils4J; //导入方法依赖的package包/类
/**
* Asserts that a set of dependency rules is kept.
*
* @param dependencies
* Definition of allowed or forbidden dependencies - Cannot be
* <code>null</code>.
* @param classesDir
* Directory with the ".class" files to check - Cannot be
* <code>null</code> and must be a valid directory.
*/
public static final void assertRules(final Dependencies dependencies,
final File classesDir) {
Utils4J.checkNotNull("dependencies", dependencies);
Utils4J.checkNotNull("classesDir", classesDir);
Utils4J.checkValidDir(classesDir);
try {
final DependencyAnalyzer analyzer = new DependencyAnalyzer(
dependencies);
assertIntern(classesDir, analyzer);
} catch (final InvalidDependenciesDefinitionException ex) {
throw new RuntimeException(ex);
}
}