Class ResourceCqlScript

  • All Implemented Interfaces:
    CqlScript

    public class ResourceCqlScript
    extends AbstractCqlScript
    An implementation of CqlScript that reads CQL statements from a Resource.

    Example Usage:

    
     ResourceCqlScript script = new ResourceCqlScript(new ClassPathResource("schema.cql"), StandardCharsets.UTF_8);
     List<String> statements = script.getStatements();
     statements.forEach(statement -> System.out.println(statement));
     
    Since:
    4.0.0
    Author:
    Dmytro Nosan
    • Constructor Detail

      • ResourceCqlScript

        public ResourceCqlScript​(Resource resource)
        Creates a new ResourceCqlScript with the given Resource and the default platform charset.
        Parameters:
        resource - the resource containing CQL statements (must not be null)
        Throws:
        NullPointerException - if resource is null
      • ResourceCqlScript

        public ResourceCqlScript​(Resource resource,
                                 Charset charset)
        Creates a new ResourceCqlScript with the given Resource and a specified Charset.
        Parameters:
        resource - the resource containing CQL statements (must not be null)
        charset - the character encoding to use when reading the resource (must not be null)
        Throws:
        NullPointerException - if resource or charset is null