当前位置: 首页>>代码示例>>Java>>正文


Java Resource.getFullyQualifiedName方法代码示例

本文整理汇总了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);
            }
        }
    }
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:41,代码来源:XmlWebResourcesCamelFilesVisitor.java

示例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);
            }
        }
    }
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:36,代码来源:XmlResourcesCamelFilesVisitor.java

示例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
                }
            }
        }
    }
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:38,代码来源:XmlWebResourcesCamelEndpointsVisitor.java

示例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
                }
            }
        }
    }
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:38,代码来源:XmlResourcesCamelEndpointsVisitor.java

示例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);
        }
    }
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:32,代码来源:SpringBootConfigurationResourcesFilesVisitor.java


注:本文中的org.jboss.forge.addon.resource.Resource.getFullyQualifiedName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。