Class FilesApplicationPackage

java.lang.Object
com.yahoo.config.model.application.AbstractApplicationPackage
com.yahoo.config.model.application.provider.FilesApplicationPackage
All Implemented Interfaces:
com.yahoo.config.application.api.ApplicationPackage

public class FilesApplicationPackage extends AbstractApplicationPackage
Application package derived from local files, i.e. during deploy. Construct using fromFile(java.io.File) or fromFileWithDeployData(java.io.File, DeployData).
Author:
Vegard Havdal
  • Field Details

    • preprocessed

      public static final String preprocessed
      The name of the subdirectory (below the original application package root) where a preprocessed version of this application package is stored. As it happens, the config model is first created with an application package in this subdirectory, and later backed by an application package which is not in this subdirectory. To enable model code to correct for this, this constant must be publicly known. All of this stuff is Very Unfortunate and should be fixed. -Jon
      See Also:
  • Method Details

    • fromFile

      public static FilesApplicationPackage fromFile(File appDir)
      Creates from a directory with source files included
    • fromFile

      public static FilesApplicationPackage fromFile(File appDir, boolean includeSourceFiles)
      Returns an application package object based on the given application dir
      Parameters:
      appDir - application package directory
      includeSourceFiles - read files from source directories /src/main and src/test in addition to the application package location. This is useful during development to be able to run tests without a complete build first.
      Returns:
      an Application package instance
    • fromFileWithDeployData

      public static FilesApplicationPackage fromFileWithDeployData(File appDir, DeployData deployData)
      Creates package from a local directory, typically deploy app
    • fromFileWithDeployData

      public static FilesApplicationPackage fromFileWithDeployData(File appDir, DeployData deployData, boolean includeSourceFiles)
      Creates package from a local directory, typically deploy app
    • getApplicationId

      public com.yahoo.config.provision.ApplicationId getApplicationId()
    • getFiles

      public List<com.yahoo.io.reader.NamedReader> getFiles(com.yahoo.path.Path relativePath, String suffix, boolean recurse)
    • getFile

      public com.yahoo.config.application.api.ApplicationFile getFile(com.yahoo.path.Path path)
    • getMetaData

      public com.yahoo.config.application.api.ApplicationMetaData getMetaData()
    • getHosts

      public Reader getHosts()
    • getHostSource

      public String getHostSource()
    • getServicesSource

      public String getServicesSource()
    • getDeployment

      public Optional<Reader> getDeployment()
    • getValidationOverrides

      public Optional<Reader> getValidationOverrides()
    • getUserIncludeDirs

      public List<String> getUserIncludeDirs()
    • addUserIncludeDirs

      public void addUserIncludeDirs()
    • validateIncludeDir

      public void validateIncludeDir(String dirName)
    • getSchemas

      public Collection<com.yahoo.io.reader.NamedReader> getSchemas()
    • getAllExistingConfigDefs

      public Map<com.yahoo.vespa.config.ConfigDefinitionKey,com.yahoo.config.application.api.UnparsedConfigDefinition> getAllExistingConfigDefs()
    • getServices

      public Reader getServices()
    • getSearchDefinitionFiles

      public List<File> getSearchDefinitionFiles()
    • getComponents

      public static List<FilesApplicationPackage.Component> getComponents(File appDir)
    • getComponentsInfo

      public List<com.yahoo.config.application.api.ComponentInfo> getComponentsInfo(com.yahoo.component.Version vespaVersion)
    • getComponents

      public List<FilesApplicationPackage.Component> getComponents()
      Returns a list of all components in this package.
      Returns:
      A list of components.
    • getAppDir

      public File getAppDir() throws IOException
      Throws:
      IOException
    • getRankingExpression

      public Reader getRankingExpression(String name)
      Reads a ranking expression from file to a string and returns it.
      Parameters:
      name - the name of the file to return, relative to the search definition directory in the application package
      Returns:
      the content of a ranking expression file
      Throws:
      IllegalArgumentException - if the file was not found or could not be read
    • getFileReference

      public File getFileReference(com.yahoo.path.Path pathRelativeToAppDir)
    • validateXML

      public void validateXML() throws IOException
      Throws:
      IOException
    • validateXMLFor

      public void validateXMLFor(Optional<com.yahoo.component.Version> vespaVersion) throws IOException
      Throws:
      IOException
    • writeMetaData

      public void writeMetaData()
    • getDeploymentSpec

      public com.yahoo.config.application.api.DeploymentSpec getDeploymentSpec()
    • preprocess

      public com.yahoo.config.application.api.ApplicationPackage preprocess(com.yahoo.config.provision.Zone zone, com.yahoo.config.application.api.DeployLogger logger) throws IOException
      Throws:
      IOException
    • validateFileExtensions

      public void validateFileExtensions()