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

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

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

origin: com.yahoo.vespa/config-model-api

/**
 * List the files in this directory, optionally list files for subdirectories recursively as well.
 *
 * @param recurse Set to true if all files in the directory tree should be returned.
 * @return a list of files in this directory.
 */
public List<ApplicationFile> listFiles(boolean recurse) {
  List<ApplicationFile> ret = new ArrayList<>();
  List<ApplicationFile> files = listFiles();
  ret.addAll(files);
  if (recurse) {
    for (ApplicationFile file : files) {
      if (file.isDirectory()) {
        ret.addAll(file.listFiles(recurse));
      }
    }
  }
  return ret;
}
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;
}
com.yahoo.config.application.apiApplicationFileisDirectory

Javadoc

Check whether or not this file is a directory.

Popular methods of ApplicationFile

  • createReader
    Create a Reader for the contents of this file.
  • getPath
    Get the path that this file represents.
  • 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

  • Updating database using SQL prepared statement
  • getSystemService (Context)
  • getResourceAsStream (ClassLoader)
  • requestLocationUpdates (LocationManager)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • JFrame (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Runner (org.openjdk.jmh.runner)
  • Best plugins for Eclipse
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