本文整理汇总了Java中org.jboss.forge.addon.resource.Resource.getFullyQualifiedName方法的典型用法代码示例。如果您正苦于以下问题:Java Resource.getFullyQualifiedName方法的具体用法?Java Resource.getFullyQualifiedName怎么用?Java Resource.getFullyQualifiedName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.forge.addon.resource.Resource
的用法示例。
在下文中一共展示了Resource.getFullyQualifiedName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.jboss.forge.addon.resource.Resource; //导入方法依赖的package包/类
@Override
public void visit(VisitContext visitContext, Resource<?> resource) {
// skip directories
if (resource instanceof FileResource) {
if (((FileResource) resource).isDirectory()) {
return;
}
}
String name = resource.getFullyQualifiedName();
name = AbstractCamelProjectCommand.asRelativeFile(name, null, null, facet);
LOG.info("Resource name " + name);
if (name.endsWith(".xml")) {
boolean include = true;
if (filter != null) {
Boolean out = filter.apply(name);
LOG.info("Filter " + name + " -> " + out);
include = out == null || out;
}
if (include) {
boolean camel = containsCamelRoutes(resource);
if (camel) {
// we only want the relative dir name from the resource directory, eg WEB-INF/foo.xml
String baseDir = facet.getWebRootDirectory().getFullyQualifiedName();
String fqn = resource.getFullyQualifiedName();
if (fqn.startsWith(baseDir)) {
fqn = fqn.substring(baseDir.length() + 1);
}
int idx = Math.max(fqn.lastIndexOf("/"), fqn.lastIndexOf("\\"));
if (idx > 0) {
directories.add(fqn.substring(0, idx));
}
files.add(fqn);
}
}
}
}
示例2: visit
import org.jboss.forge.addon.resource.Resource; //导入方法依赖的package包/类
@Override
public void visit(VisitContext visitContext, Resource<?> resource) {
// skip directories
if (resource instanceof FileResource) {
if (((FileResource) resource).isDirectory()) {
return;
}
}
String name = resource.getFullyQualifiedName();
name = AbstractCamelProjectCommand.asRelativeFile(name, null, facet, null);
LOG.info("Resource name " + name);
if (name.endsWith(".xml")) {
boolean include = true;
if (filter != null) {
Boolean out = filter.apply(name);
include = out == null || out;
}
if (include) {
boolean camel = containsCamelRoutes(resource);
if (camel) {
// we only want the relative dir name from the resource directory, eg META-INF/spring/foo.xml
String baseDir = facet.getResourceDirectory().getFullyQualifiedName();
String fqn = resource.getFullyQualifiedName();
if (fqn.startsWith(baseDir)) {
fqn = fqn.substring(baseDir.length() + 1);
}
files.add(fqn);
}
}
}
}
示例3: visit
import org.jboss.forge.addon.resource.Resource; //导入方法依赖的package包/类
@Override
public void visit(VisitContext visitContext, Resource<?> resource) {
// skip directories
if (resource instanceof FileResource) {
if (((FileResource) resource).isDirectory()) {
return;
}
}
String name = resource.getFullyQualifiedName();
name = AbstractCamelProjectCommand.asRelativeFile(name, null, null, facet);
LOG.info("Resource name " + name);
if (name.endsWith(".xml")) {
boolean include = true;
if (filter != null) {
Boolean out = filter.apply(name);
LOG.info("Filter " + name + " -> " + out);
include = out == null || out;
}
if (include) {
boolean camel = containsCamelRoutes(resource);
if (camel) {
// find all the endpoints (currently only <endpoint> and within <route>)
try {
InputStream is = resource.getResourceInputStream();
String fqn = resource.getFullyQualifiedName();
String baseDir = facet.getWebRootDirectory().getFullyQualifiedName();
XmlRouteParser.parseXmlRouteEndpoints(is, baseDir, fqn, endpoints);
} catch (Throwable e) {
// ignore
}
}
}
}
}
示例4: visit
import org.jboss.forge.addon.resource.Resource; //导入方法依赖的package包/类
@Override
public void visit(VisitContext visitContext, Resource<?> resource) {
// skip directories
if (resource instanceof FileResource) {
if (((FileResource) resource).isDirectory()) {
return;
}
}
String name = resource.getFullyQualifiedName();
name = AbstractCamelProjectCommand.asRelativeFile(name, null, facet, null);
LOG.info("Resource name " + name);
if (name.endsWith(".xml")) {
boolean include = true;
if (filter != null) {
Boolean out = filter.apply(name);
LOG.info("Filter " + name + " -> " + out);
include = out == null || out;
}
if (include) {
boolean camel = containsCamelRoutes(resource);
if (camel) {
// find all the endpoints (currently only <endpoint> and within <route>)
try {
InputStream is = resource.getResourceInputStream();
String fqn = resource.getFullyQualifiedName();
String baseDir = facet.getResourceDirectory().getFullyQualifiedName();
XmlRouteParser.parseXmlRouteEndpoints(is, baseDir, fqn, endpoints);
} catch (Throwable e) {
// ignore
}
}
}
}
}
示例5: visit
import org.jboss.forge.addon.resource.Resource; //导入方法依赖的package包/类
@Override
public void visit(VisitContext visitContext, Resource<?> resource) {
// skip directories
if (resource instanceof FileResource) {
if (((FileResource) resource).isDirectory()) {
return;
}
}
String name = resource.getFullyQualifiedName();
name = AbstractCamelProjectCommand.asRelativeFile(name, null, facet, null);
LOG.info("Resource name " + name);
if (name.equals("application.properties") || name.equals("application.yaml") || name.equals("application.yml")) {
boolean include = true;
if (filter != null) {
Boolean out = filter.apply(name);
include = out == null || out;
}
if (include) {
// we only want the relative dir name from the resource directory, eg META-INF/spring/foo.xml
String baseDir = facet.getResourceDirectory().getFullyQualifiedName();
String fqn = resource.getFullyQualifiedName();
if (fqn.startsWith(baseDir)) {
fqn = fqn.substring(baseDir.length() + 1);
}
files.add(fqn);
}
}
}