Tabnine Logo
ApplicationFile.getPath
Code IndexAdd Tabnine to your IDE (free)

How to use
getPath
method
in
com.yahoo.config.application.api.ApplicationFile

Best Java code snippets using com.yahoo.config.application.api.ApplicationFile.getPath (Showing top 4 results out of 315)

origin: com.yahoo.vespa/config-application-package

@Override
public int compareTo(ApplicationFile other) {
  if (other == this) return 0;
  return this.getPath().getName().compareTo((other).getPath().getName());
}
origin: com.yahoo.vespa/config-model

@Override
public int compareTo(ApplicationFile other) {
  return this.getPath().getName().compareTo((other).getPath().getName());
}
origin: com.yahoo.vespa/config-model

Map<String, ExpressionFunction> readExpressions() {
  Map<String, ExpressionFunction> expressions = new HashMap<>();
  ApplicationFile expressionPath = application.getFile(modelFiles.expressionsPath());
  if ( ! expressionPath.exists() || ! expressionPath.isDirectory()) return Collections.emptyMap();
  for (ApplicationFile expressionFile : expressionPath.listFiles()) {
    try (BufferedReader reader = new BufferedReader(expressionFile.createReader())){
      String name = expressionFile.getPath().getName();
      expressions.put(name, readExpression(name, reader));
    }
    catch (IOException e) {
      throw new UncheckedIOException("Failed reading " + expressionFile.getPath(), e);
    }
    catch (ParseException e) {
      throw new IllegalStateException("Invalid stored expression in " + expressionFile, e);
    }
  }
  return expressions;
}
origin: com.yahoo.vespa/config-model

/**
 * Creates a rank profile not attached to any search definition, for each imported model in the application package,
 * and adds it to the given rank profile registry.
 */
private void createGlobalRankProfiles(DeployLogger deployLogger, ImportedMlModels importedModels,
                   RankProfileRegistry rankProfileRegistry,
                   QueryProfiles queryProfiles) {
  if ( ! importedModels.all().isEmpty()) { // models/ directory is available
    for (ImportedMlModel model : importedModels.all()) {
      RankProfile profile = new RankProfile(model.name(), this, rankProfileRegistry);
      rankProfileRegistry.add(profile);
      ConvertedModel convertedModel = ConvertedModel.fromSource(new ModelName(model.name()),
                                   model.name(), profile, queryProfiles.getRegistry(), model);
      convertedModel.expressions().values().forEach(f -> profile.addFunction(f, false));
    }
  }
  else { // generated and stored model information may be available instead
    ApplicationFile generatedModelsDir = applicationPackage.getFile(ApplicationPackage.MODELS_GENERATED_REPLICATED_DIR);
    for (ApplicationFile generatedModelDir : generatedModelsDir.listFiles()) {
      String modelName = generatedModelDir.getPath().last();
      if (modelName.contains(".")) continue; // Name space: Not a global profile
      RankProfile profile = new RankProfile(modelName, this, rankProfileRegistry);
      rankProfileRegistry.add(profile);
      ConvertedModel convertedModel = ConvertedModel.fromStore(new ModelName(modelName), modelName, profile);
      convertedModel.expressions().values().forEach(f -> profile.addFunction(f, false));
    }
  }
  new Processing().processRankProfiles(deployLogger, rankProfileRegistry, queryProfiles, true, false);
}
com.yahoo.config.application.apiApplicationFilegetPath

Javadoc

Get the path that this file represents.

Popular methods of ApplicationFile

  • createReader
    Create a Reader for the contents of this file.
  • isDirectory
    Check whether or not this file is a directory.
  • listFiles
    List the files in this directory, optionally list files for subdirectories recursively as well.
  • appendFile
    Appends the given string to this text file.
  • exists
    Test whether or not this file exists.
  • writeFile
    Write the contents from this reader to this file. Any existing content will be overwritten!

Popular in Java

  • Running tasks concurrently on multiple threads
  • startActivity (Activity)
  • setContentView (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • JCheckBox (javax.swing)
  • JList (javax.swing)
  • JTable (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now