• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ResourcesFacet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jboss.forge.addon.projects.facets.ResourcesFacet的典型用法代码示例。如果您正苦于以下问题:Java ResourcesFacet类的具体用法?Java ResourcesFacet怎么用?Java ResourcesFacet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ResourcesFacet类属于org.jboss.forge.addon.projects.facets包,在下文中一共展示了ResourcesFacet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: execute

import org.jboss.forge.addon.projects.facets.ResourcesFacet; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
    StopWatch watch = new StopWatch();

    log.debug("Starting to setup fabric8 project");

    Project project = getSelectedProject(context.getUIContext());
    if (project == null) {
        return Results.fail("No pom.xml available so cannot edit the project!");
    }

    // setup fabric8-maven-plugin
    setupFabricMavenPlugin(project);
    log.debug("fabric8-maven-plugin now setup");

    // make sure we have resources as we need it later
    facetFactory.install(project, ResourcesFacet.class);

    log.info("execute took " + watch.taken());
    return Results.success();
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:22,代码来源:Fabric8SetupStep.java


示例2: editEndpointOther

import org.jboss.forge.addon.projects.facets.ResourcesFacet; //导入依赖的package包/类
protected Result editEndpointOther(Project project, ResourcesFacet facet, FileResource file, String uri, String endpointUrl,
                                  String currentFile, String lineNumber) throws Exception {

    List<String> lines = LineNumberHelper.readLines(file.getResourceInputStream());

    // the list is 0-based, and line number is 1-based
    int idx = Integer.valueOf(lineNumber) - 1;
    String line = lines.get(idx);

    // replace uri with new value
    line = StringHelper.replaceAll(line, endpointUrl, uri);
    lines.set(idx, line);

    LOG.info("Updating " + endpointUrl + " to " + uri + " at line " + lineNumber + " in file " + currentFile);

    // and save the file back
    String content = LineNumberHelper.linesToString(lines);
    file.setContents(content);

    return Results.success("Update endpoint uri: " + uri + " in file " + currentFile);
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:22,代码来源:ConfigureEndpointPropertiesStep.java


示例3: createCurrentLineCompleter

import org.jboss.forge.addon.projects.facets.ResourcesFacet; //导入依赖的package包/类
protected CurrentLineCompleter createCurrentLineCompleter(int lineNumber, String file, UIContext context) throws Exception {
    Project project = getSelectedProject(context);

    JavaSourceFacet sourceFacet = null;
    ResourcesFacet resourcesFacet = null;
    WebResourcesFacet webResourcesFacet = null;
    if (project.hasFacet(JavaSourceFacet.class)) {
        sourceFacet = project.getFacet(JavaSourceFacet.class);
    }
    if (project.hasFacet(ResourcesFacet.class)) {
        resourcesFacet = project.getFacet(ResourcesFacet.class);
    }
    if (project.hasFacet(WebResourcesFacet.class)) {
        webResourcesFacet = project.getFacet(WebResourcesFacet.class);
    }

    String relativeFile = asRelativeFile(context, file);
    return new CurrentLineCompleter(lineNumber, relativeFile, sourceFacet, resourcesFacet, webResourcesFacet);
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:20,代码来源:AbstractCamelProjectCommand.java


示例4: getXmlResourceFile

import org.jboss.forge.addon.projects.facets.ResourcesFacet; //导入依赖的package包/类
protected FileResource getXmlResourceFile(Project project, String xmlResourceName) {
    if (xmlResourceName == null) {
        return null;
    }

    ResourcesFacet facet = null;
    WebResourcesFacet webResourcesFacet = null;
    if (project.hasFacet(ResourcesFacet.class)) {
        facet = project.getFacet(ResourcesFacet.class);
    }
    if (project.hasFacet(WebResourcesFacet.class)) {
        webResourcesFacet = project.getFacet(WebResourcesFacet.class);
    }

    FileResource file = facet != null ? facet.getResource(xmlResourceName) : null;
    if (file == null || !file.exists()) {
        file = webResourcesFacet != null ? webResourcesFacet.getWebResource(xmlResourceName) : null;
    }
    return file;
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:21,代码来源:AbstractCamelProjectCommand.java


示例5: asRelativeFile

import org.jboss.forge.addon.projects.facets.ResourcesFacet; //导入依赖的package包/类
protected String asRelativeFile(UIContext context, String currentFile) {
    Project project = getSelectedProject(context);

    JavaSourceFacet javaSourceFacet = null;
    ResourcesFacet resourcesFacet = null;
    WebResourcesFacet webResourcesFacet = null;
    if (project.hasFacet(JavaSourceFacet.class)) {
        javaSourceFacet = project.getFacet(JavaSourceFacet.class);
    }
    if (project.hasFacet(ResourcesFacet.class)) {
        resourcesFacet = project.getFacet(ResourcesFacet.class);
    }
    if (project.hasFacet(WebResourcesFacet.class)) {
        webResourcesFacet = project.getFacet(WebResourcesFacet.class);
    }
    return asRelativeFile(currentFile, javaSourceFacet, resourcesFacet, webResourcesFacet);
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:18,代码来源:AbstractCamelProjectCommand.java


示例6: loadCamelConnectionDto

import org.jboss.forge.addon.projects.facets.ResourcesFacet; //导入依赖的package包/类
protected ConnectionCatalogDto loadCamelConnectionDto(Project project) {
    if (project.hasFacet(ResourcesFacet.class)) {
        ResourcesFacet facet = project.getFacet(ResourcesFacet.class);
        FileResource file = facet.getResource("camel-connector.json");
        String json = file.getContents();

        try {
            ObjectMapper mapper = new ObjectMapper();
            return mapper.readValue(json, ConnectionCatalogDto.class);
        } catch (IOException e) {
            // error
        }
    }

    return null;
}
 
开发者ID:fabric8io,项目名称:django,代码行数:17,代码来源:AbstractIPaaSProjectCommand.java


示例7: loadConnectionProperties

import org.jboss.forge.addon.projects.facets.ResourcesFacet; //导入依赖的package包/类
@Override
public Properties loadConnectionProperties(Project project)
{
   Properties dbmaProperties = new Properties();

   ResourcesFacet resourcesFacet = project.getFacet(ResourcesFacet.class);
   DirectoryResource migrationDir = resourcesFacet.getResourceDirectory().getChildDirectory(
            Constants.DEFAULT_MIGRATION_DIRECTORY);
   try
   {
      dbmaProperties.load(migrationDir.getChild(Constants.PROPERTIES_FILE).getResourceInputStream());
   }
   catch (IOException e)
   {
      // TODO Auto-generated catch block
      e.printStackTrace();
   }
   return dbmaProperties;
}
 
开发者ID:forge,项目名称:db-migration-addon,代码行数:20,代码来源:ConnectionPropertiesManagerImpl.java


示例8: getApplicationProperties

import org.jboss.forge.addon.projects.facets.ResourcesFacet; //导入依赖的package包/类
public static FileResource<?> getApplicationProperties(Project project, boolean create) {
   FileResource<?> applicationFile = project.getFacet(ResourcesFacet.class).getResource("application.properties");
   if (create && !applicationFile.exists()) {
      applicationFile.createNewFile();
   }

   return applicationFile;
}
 
开发者ID:forge,项目名称:springboot-addon,代码行数:9,代码来源:SpringBootHelper.java


示例9: getRequiredFacets

import org.jboss.forge.addon.projects.facets.ResourcesFacet; //导入依赖的package包/类
@Override
public Iterable<Class<? extends ProjectFacet>> getRequiredFacets() {
    List<Class<? extends ProjectFacet>> result = new ArrayList<Class<? extends ProjectFacet>>(7);
    result.add(MetadataFacet.class);
    result.add(PackagingFacet.class);
    result.add(DependencyFacet.class);
    result.add(ResourcesFacet.class);
    result.add(WebResourcesFacet.class);
    result.add(JavaSourceFacet.class);
    result.add(JavaCompilerFacet.class);
    return result;
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:13,代码来源:FunktionProjectType.java


示例10: createXmlEndpointsCompleter

import org.jboss.forge.addon.projects.facets.ResourcesFacet; //导入依赖的package包/类
protected XmlEndpointsCompleter createXmlEndpointsCompleter(Project project, Function<String, Boolean> filter) {
    ResourcesFacet resourcesFacet = null;
    WebResourcesFacet webResourcesFacet = null;
    if (project.hasFacet(ResourcesFacet.class)) {
        resourcesFacet = project.getFacet(ResourcesFacet.class);
    }
    if (project.hasFacet(WebResourcesFacet.class)) {
        webResourcesFacet = project.getFacet(WebResourcesFacet.class);
    }

    return new XmlEndpointsCompleter(resourcesFacet, webResourcesFacet, filter);
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:13,代码来源:AbstractCamelProjectCommand.java


示例11: createXmlFileCompleter

import org.jboss.forge.addon.projects.facets.ResourcesFacet; //导入依赖的package包/类
protected XmlFileCompleter createXmlFileCompleter(Project project, Function<String, Boolean> filter) {
    ResourcesFacet resourcesFacet = null;
    WebResourcesFacet webResourcesFacet = null;
    if (project.hasFacet(ResourcesFacet.class)) {
        resourcesFacet = project.getFacet(ResourcesFacet.class);
    }
    if (project.hasFacet(WebResourcesFacet.class)) {
        webResourcesFacet = project.getFacet(WebResourcesFacet.class);
    }

    return new XmlFileCompleter(resourcesFacet, webResourcesFacet, filter);
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:13,代码来源:AbstractCamelProjectCommand.java


示例12: createSpringBootConfigurationFileCompleter

import org.jboss.forge.addon.projects.facets.ResourcesFacet; //导入依赖的package包/类
protected SpringBootConfigurationFileCompleter createSpringBootConfigurationFileCompleter(UIContext context, Function<String, Boolean> filter) {
    Project project = getSelectedProject(context);
    ResourcesFacet resourcesFacet = null;
    if (project.hasFacet(ResourcesFacet.class)) {
        resourcesFacet = project.getFacet(ResourcesFacet.class);
    }
    return new SpringBootConfigurationFileCompleter(resourcesFacet, filter);
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:9,代码来源:AbstractCamelProjectCommand.java


示例13: CurrentLineCompleter

import org.jboss.forge.addon.projects.facets.ResourcesFacet; //导入依赖的package包/类
public CurrentLineCompleter(int lineNumber, String relativeFile, final JavaSourceFacet sourceFacet,
                            final ResourcesFacet resourcesFacet, final WebResourcesFacet webFacet) throws Exception {
    this.lineNumber = lineNumber;
    this.relativeFile = relativeFile;
    this.sourceFacet = sourceFacet;
    this.resourcesFacet = resourcesFacet;
    this.webFacet = webFacet;
    this.line = getCurrentCursorLineText();
    LOG.info("Created CurrentLineCompleter[lineNumber=" + lineNumber + ",relativeFile=" + relativeFile + ",line=" + line + "]");
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:11,代码来源:CurrentLineCompleter.java


示例14: execute

import org.jboss.forge.addon.projects.facets.ResourcesFacet; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
    Project project = getSelectedProject(context);

    // does the project already have camel?
    Dependency core = findCamelCoreDependency(project);
    if (core == null) {
        return Results.fail("The project does not include camel-core");
    }

    ProjectDto camelProject = new ProjectDto();

    ResourcesFacet resourcesFacet = project.getFacet(ResourcesFacet.class);
    WebResourcesFacet webResourcesFacet = null;
    if (project.hasFacet(WebResourcesFacet.class)) {
        webResourcesFacet = project.getFacet(WebResourcesFacet.class);
    }

    // use value choices instead of completer as that works better in web console
    XmlEndpointsCompleter xmlEndpointCompleter = new XmlEndpointsCompleter(resourcesFacet, webResourcesFacet, null);
    JavaSourceFacet javaSourceFacet = project.getFacet(JavaSourceFacet.class);

    // use value choices instead of completer as that works better in web console
    RouteBuilderEndpointsCompleter javaEndpointsCompleter = new RouteBuilderEndpointsCompleter(javaSourceFacet, null);

    camelProject.addEndpoints(javaEndpointsCompleter.getEndpoints());
    camelProject.addEndpoints(xmlEndpointCompleter.getEndpoints());

    CamelCurrentComponentsFinder componentsFinder = new CamelCurrentComponentsFinder(getCamelCatalog(), project);
    List<ComponentDto> currentComponents = componentsFinder.findCurrentComponents();
    camelProject.setComponents(currentComponents);

    String result = formatResult(camelProject);
    return Results.success(result);
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:36,代码来源:CamelGetOverviewCommand.java


示例15: getCamelConnectorFile

import org.jboss.forge.addon.projects.facets.ResourcesFacet; //导入依赖的package包/类
protected FileResource getCamelConnectorFile(UIContext context) {
    Project project = getSelectedProjectOrNull(context);
    if (project != null && project.hasFacet(ResourcesFacet.class)) {
        ResourcesFacet facet = project.getFacet(ResourcesFacet.class);
        return facet.getResource("camel-connector.json");
    } else {
        return null;
    }
}
 
开发者ID:fabric8io,项目名称:django,代码行数:10,代码来源:AbstractIPaaSProjectCommand.java


示例16: getCamelComponentFile

import org.jboss.forge.addon.projects.facets.ResourcesFacet; //导入依赖的package包/类
protected FileResource getCamelComponentFile(Project project, String scheme) {
    if (project != null && project.hasFacet(ResourcesFacet.class)) {
        ResourcesFacet facet = project.getFacet(ResourcesFacet.class);
        return facet.getResource("META-INF/services/org/apache/camel/component/" + scheme);
    } else {
        return null;
    }
}
 
开发者ID:fabric8io,项目名称:django,代码行数:9,代码来源:ConnectorSelectComponentStep.java


示例17: getRequiredFacets

import org.jboss.forge.addon.projects.facets.ResourcesFacet; //导入依赖的package包/类
@Override
public Iterable<Class<? extends ProjectFacet>> getRequiredFacets() {
    List<Class<? extends ProjectFacet>> result = new ArrayList<Class<? extends ProjectFacet>>(6);
    result.add(MetadataFacet.class);
    result.add(PackagingFacet.class);
    result.add(DependencyFacet.class);
    result.add(ResourcesFacet.class);
    result.add(JavaSourceFacet.class);
    result.add(JavaCompilerFacet.class);
    return result;
}
 
开发者ID:fabric8io,项目名称:django,代码行数:12,代码来源:ConnectorProjectType.java


示例18: ChangeLogFileGenerator

import org.jboss.forge.addon.projects.facets.ResourcesFacet; //导入依赖的package包/类
public ChangeLogFileGenerator(Project project)
{
   this.project = project;
   ResourcesFacet projectResourcesFacet = project.getFacet(ResourcesFacet.class);
   this.migrationDirectory = projectResourcesFacet.getResourceDirectory().getChildDirectory(
            Constants.DEFAULT_MIGRATION_DIRECTORY);
   this.resourceFactory = this.migrationDirectory.getResourceFactory();
}
 
开发者ID:forge,项目名称:db-migration-addon,代码行数:9,代码来源:ChangeLogFileGenerator.java


示例19: isInstalled

import org.jboss.forge.addon.projects.facets.ResourcesFacet; //导入依赖的package包/类
@Override
public boolean isInstalled()
{
   DependencyFacet dependencyFacet = getFaceted().getFacet(DependencyFacet.class);
   return dependencyFacet.hasDirectManagedDependency(createLiquibaseDependency())
            && getFaceted().getFacet(ResourcesFacet.class).getResourceDirectory()
                     .getChildDirectory(Constants.DEFAULT_MIGRATION_DIRECTORY).exists();
}
 
开发者ID:forge,项目名称:db-migration-addon,代码行数:9,代码来源:DatabaseMigrationFacetImpl.java


示例20: setPropertiesFile

import org.jboss.forge.addon.projects.facets.ResourcesFacet; //导入依赖的package包/类
public void setPropertiesFile(ConnectionProfile connection)
{
   String liquibaseVersion = getFaceted().getFacet(MetadataFacet.class).getDirectProperty(
            Constants.LIQUIBASE_VERSION_PROPERTY_NAME);
   ConnectionPropertiesBuilder pBuilder = ConnectionPropertiesBuilder.create();
   pBuilder.setConnection(connection).setLiquibaseVersion(liquibaseVersion);

   ResourcesFacet projectResourcesFacet = getFaceted().getFacet(ResourcesFacet.class);
   DirectoryResource migrationDir = projectResourcesFacet.getResourceDirectory().getChildDirectory(
            Constants.DEFAULT_MIGRATION_DIRECTORY);

   FileResource<?> propertiesFile = migrationDir.getChild(Constants.PROPERTIES_FILE).reify(
            FileResource.class);
   propertiesFile.setContents(pBuilder.toString());
}
 
开发者ID:forge,项目名称:db-migration-addon,代码行数:16,代码来源:DatabaseMigrationFacetImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DeferredTransportPipe类代码示例发布时间:2022-05-23
下一篇:
Java OperatingState类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap