Package io.github.cdklabs.projen
Class SampleFile.Builder
- java.lang.Object
-
- io.github.cdklabs.projen.SampleFile.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<SampleFile>
- Enclosing class:
- SampleFile
@Stability(Experimental) public static final class SampleFile.Builder extends Object implements software.amazon.jsii.Builder<SampleFile>
(experimental) A fluent builder forSampleFile.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SampleFilebuild()SampleFile.Buildercontents(String contents)(experimental) The contents of the file to write.static SampleFile.Buildercreate(Project project, String filePath)SampleFile.BuildersourcePath(String sourcePath)(experimental) Absolute path to a file to copy the contents from (does not need to be a text file).
-
-
-
Method Detail
-
create
@Stability(Experimental) public static SampleFile.Builder create(Project project, String filePath)
- Parameters:
project-- the project to tie this file to.
filePath-- the relative path in the project to put the file.
- Returns:
- a new instance of
SampleFile.Builder.
-
contents
@Stability(Experimental) public SampleFile.Builder contents(String contents)
(experimental) The contents of the file to write.- Parameters:
contents- The contents of the file to write. This parameter is required.- Returns:
this
-
sourcePath
@Stability(Experimental) public SampleFile.Builder sourcePath(String sourcePath)
(experimental) Absolute path to a file to copy the contents from (does not need to be a text file).If your project is Typescript-based and has configured
testdirto be a subdirectory ofsrc, sample files should outside of thesrcdirectory, otherwise they may not be copied. For example:new SampleFile(this, 'assets/icon.png', { source: path.join(__dirname, '..', 'sample-assets', 'icon.png') });- Parameters:
sourcePath- Absolute path to a file to copy the contents from (does not need to be a text file). This parameter is required.- Returns:
this
-
build
@Stability(Experimental) public SampleFile build()
- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<SampleFile>- Returns:
- a newly built instance of
SampleFile.
-
-