Tabnine Logo
GlobalConfig.getDataDir
Code IndexAdd Tabnine to your IDE (free)

How to use
getDataDir
method
in
com.haulmont.cuba.core.global.GlobalConfig

Best Java code snippets using com.haulmont.cuba.core.global.GlobalConfig.getDataDir (Showing top 2 results out of 315)

origin: com.haulmont.cuba/cuba-core

/**
 * INTERNAL. Don't use in application code.
 */
public File[] getStorageRoots() {
  if (storageRoots == null) {
    String conf = configuration.getConfig(ServerConfig.class).getFileStorageDir();
    if (StringUtils.isBlank(conf)) {
      String dataDir = configuration.getConfig(GlobalConfig.class).getDataDir();
      File dir = new File(dataDir, "filestorage");
      dir.mkdirs();
      storageRoots = new File[]{dir};
    } else {
      List<File> list = new ArrayList<>();
      for (String str : conf.split(",")) {
        str = str.trim();
        if (!StringUtils.isEmpty(str)) {
          File file = new File(str);
          if (!list.contains(file))
            list.add(file);
        }
      }
      storageRoots = list.toArray(new File[list.size()]);
    }
  }
  return storageRoots;
}
origin: com.haulmont.fts/fts-core

  public Directory getDirectory() {
    if (directory == null) {
      synchronized (this) {
        if (directory == null) {
          String dir = ftsConfig.getIndexDir();
          if (StringUtils.isBlank(dir)) {
            dir = globalConfig.getDataDir() + "/ftsindex";
          }
          Path file = Paths.get(dir);
          if (!Files.exists(file)) {
            try {
              Files.createDirectory(file);
            } catch (IOException e) {
              throw new RuntimeException("Directory " + dir + " doesn't exist and can not be created");
            }
          }
          try {
            directory = FSDirectory.open(file);
            if (Files.exists(file.resolve("write.lock"))) {
              directory.deleteFile("write.lock");
            }
          } catch (IOException e) {
            throw new RuntimeException("Error on lucene index directory initialization", e);
          }
        }
      }
    }
    return directory;
  }
}
com.haulmont.cuba.core.globalGlobalConfiggetDataDir

Popular methods of GlobalConfig

  • getAvailableLocales
    Supported locales. List of locales is shown on user login.
  • getConfDir
  • getWebHostName
  • getWebPort
  • getWebAppUrl
  • getWebContextName
  • getLocaleSelectVisible
    Show locale select in LoginWindow.
  • getTempDir
  • getAllowQueryFromSelected
  • getHealthCheckResponse
  • getNumberIdCacheSize
  • getRestRequiresSecurityToken
  • getNumberIdCacheSize,
  • getRestRequiresSecurityToken,
  • getTestMode,
  • getUserSessionLogEnabled,
  • getAnonymousSessionId,
  • getAppFolderEditWindowClassName,
  • getCubaClasspathDirectories,
  • getDeepCopyNonPersistentReferences,
  • getDisableEscapingLikeForDataStores

Popular in Java

  • Making http post requests using okhttp
  • addToBackStack (FragmentTransaction)
  • putExtra (Intent)
  • getResourceAsStream (ClassLoader)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JTable (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • 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