Package org.jbake.app

Class Asset


  • public class Asset
    extends java.lang.Object
    Deals with assets (static files such as css, js or image files).
    • Constructor Summary

      Constructors 
      Constructor Description
      Asset​(java.io.File source, java.io.File destination, org.apache.commons.configuration2.CompositeConfiguration config)
      Deprecated.
      Asset​(JBakeConfiguration config)
      Creates an instance of Asset.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void copy()
      Copy all files from assets folder to destination folder read from configuration
      void copy​(java.io.File path)
      Copy all files from supplied path.
      void copyAssetsFromContent​(java.io.File path)
      Responsible for copying any asset files that exist within the content directory.
      void copySingleFile​(java.io.File asset)
      Copy one asset file at a time.
      java.util.List<java.lang.Throwable> getErrors()
      Accessor method to the collection of errors generated during the bake
      boolean isAssetFile​(java.io.File path)
      Determine if a given file is an asset file.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Asset

        @Deprecated
        public Asset​(java.io.File source,
                     java.io.File destination,
                     org.apache.commons.configuration2.CompositeConfiguration config)
        Deprecated.
        Use Asset(JBakeConfiguration) instead. Compatibility constructor. Creates an instance of Asset.
        Parameters:
        source - Source file for the asset
        destination - Destination (target) directory for asset file
        config - Project configuration
    • Method Detail

      • copy

        public void copy()
        Copy all files from assets folder to destination folder read from configuration
      • copy

        public void copy​(java.io.File path)
        Copy all files from supplied path.
        Parameters:
        path - The starting path
      • copySingleFile

        public void copySingleFile​(java.io.File asset)
        Copy one asset file at a time.
        Parameters:
        asset - The asset file to copy
      • isAssetFile

        public boolean isAssetFile​(java.io.File path)
        Determine if a given file is an asset file.
        Parameters:
        path - to the file to validate.
        Returns:
        true if the path provided points to a file in the asset folder.
      • copyAssetsFromContent

        public void copyAssetsFromContent​(java.io.File path)
        Responsible for copying any asset files that exist within the content directory.
        Parameters:
        path - of the content directory
      • getErrors

        public java.util.List<java.lang.Throwable> getErrors()
        Accessor method to the collection of errors generated during the bake
        Returns:
        a list of errors.