Class 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 for SampleFile.
    • Method Detail

      • create

        @Stability(Experimental)
        public static SampleFile.Builder create​(Project project,
                                                String filePath)
        Parameters:
        project -
        • the project to tie this file to.
        This parameter is required.
        filePath -
        • the relative path in the project to put the file.
        This parameter is required.
        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 testdir to be a subdirectory of src, sample files should outside of the src directory, 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:
        build in interface software.amazon.jsii.Builder<SampleFile>
        Returns:
        a newly built instance of SampleFile.