Forge - Parent 2.0.0.Alpha1

org.jboss.forge.projects.facets
Interface ResourceFacet

All Superinterfaces:
Facet<Project>, ProjectFacet
All Known Implementing Classes:
MavenResourceFacet

public interface ResourceFacet
extends ProjectFacet

Author:
Lincoln Baxter, III

Method Summary
 FileResource<?> createResource(char[] bytes, String relativeFilename)
          At the given path/filename relative to the project resources directory: getResourceFolder() - create a file containing the given bytes.
 FileResource<?> createTestResource(char[] bytes, String relativeFilename)
          At the given path/filename relative to the project test resources directory: getTestResourceFolder() - create a file containing the given bytes.
 FileResource<?> getResource(String relativePath)
          Return the FileResource at the given path relative to getResourceFolder().
 DirectoryResource getResourceFolder()
          Get the DirectoryResource representing the folder this Project uses to store package-able, non-source documents (such as configuration files.)
 List<DirectoryResource> getResourceFolders()
          Get a list of DirectoryResources representing the directories this project uses to contain Project non-source documents (such as configuration files.)
 FileResource<?> getTestResource(String relativePath)
          Attempt to locate a FileResource at the given path relative to getTestResourceFolder().
 DirectoryResource getTestResourceFolder()
          Get the DirectoryResource representing the folder this Project uses to store test-scoped non-source documents (such as configuration files.) Files in this directory will never be packaged or deployed except when running Unit Tests.
 
Methods inherited from interface org.jboss.forge.projects.ProjectFacet
setOrigin
 
Methods inherited from interface org.jboss.forge.facets.Facet
getOrigin, install, isInstalled, uninstall
 

Method Detail

getResourceFolders

List<DirectoryResource> getResourceFolders()
Get a list of DirectoryResources representing the directories this project uses to contain Project non-source documents (such as configuration files.)


getResourceFolder

DirectoryResource getResourceFolder()
Get the DirectoryResource representing the folder this Project uses to store package-able, non-source documents (such as configuration files.)


getTestResourceFolder

DirectoryResource getTestResourceFolder()
Get the DirectoryResource representing the folder this Project uses to store test-scoped non-source documents (such as configuration files.) Files in this directory will never be packaged or deployed except when running Unit Tests.


createResource

FileResource<?> createResource(char[] bytes,
                               String relativeFilename)
At the given path/filename relative to the project resources directory: getResourceFolder() - create a file containing the given bytes.

Returns:
a handle to the FileResource that was created.

createTestResource

FileResource<?> createTestResource(char[] bytes,
                                   String relativeFilename)
At the given path/filename relative to the project test resources directory: getTestResourceFolder() - create a file containing the given bytes.

Returns:
a handle to the FileResource that was created.

getResource

FileResource<?> getResource(String relativePath)
Return the FileResource at the given path relative to getResourceFolder(). The FileResource object is returned regardless of whether the target actually exists. To determine if the file exists, you should call Resource.exists() on the return value of this method.


getTestResource

FileResource<?> getTestResource(String relativePath)
Attempt to locate a FileResource at the given path relative to getTestResourceFolder(). The FileResource object is returned regardless of whether the target actually exists. To determine if the file exists, you should call Resource.exists() on the return value of this method.


Forge - Parent 2.0.0.Alpha1

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.