コード例 #1
0
 private CasConfiguration getCasConfiguration() {
   CasConfiguration casConfiguration =
       BaseDirectory.getConfiguration(CasConfiguration.FILE, CasConfiguration.class);
   if (casConfiguration == null) {
     throw new IllegalStateException("could not load cas configuration");
   }
   return casConfiguration;
 }
コード例 #2
0
ファイル: FSDirectory.java プロジェクト: pengzong1111/solr4
  @Override
  public void setLockFactory(LockFactory lockFactory) throws IOException {
    super.setLockFactory(lockFactory);

    // for filesystem based LockFactory, delete the lockPrefix, if the locks are placed
    // in index dir. If no index dir is given, set ourselves
    if (lockFactory instanceof FSLockFactory) {
      final FSLockFactory lf = (FSLockFactory) lockFactory;
      final File dir = lf.getLockDir();
      // if the lock factory has no lockDir set, use the this directory as lockDir
      if (dir == null) {
        lf.setLockDir(directory);
        lf.setLockPrefix(null);
      } else if (dir.getCanonicalPath().equals(directory.getCanonicalPath())) {
        lf.setLockPrefix(null);
      }
    }
  }
コード例 #3
0
ファイル: Store.java プロジェクト: Jeff-Johny/elasticsearch
 @Override
 public void copy(Directory to, String src, String dest, IOContext context) throws IOException {
   ensureOpen();
   // lets the default implementation happen, so we properly open an input and create an output
   super.copy(to, src, dest, context);
 }