1 package com.atlassian.bonnie;
2
3 import org.apache.lucene.analysis.Analyzer;
4 import org.apache.lucene.store.Directory;
5
6 import java.io.File;
7
8
9
10
11
12 public class LuceneConnectionFactory
13 {
14 private static final LuceneConnectionFactory FACTORY = new LuceneConnectionFactory();
15
16 public static LuceneConnectionFactory get()
17 {
18 return FACTORY;
19 }
20
21
22
23
24
25
26 public ILuceneConnection createLuceneConnection(String path, Analyzer analyzer, ILuceneConnection.Configuration configuration)
27 {
28 return new LuceneConnection(new File(path), analyzer, configuration);
29 }
30
31
32
33
34
35
36 public ILuceneConnection createLuceneConnection(Directory directory, Analyzer analyzer, ILuceneConnection.Configuration configuration)
37 {
38 return new LuceneConnection(directory, analyzer, configuration);
39 }
40
41
42
43
44
45
46 public ILuceneConnection createLuceneConnection(String path, Analyzer analyzer)
47 {
48 return createLuceneConnection(path, analyzer, ILuceneConnection.DEFAULT_CONFIGURATION);
49 }
50
51
52
53
54
55
56 public ILuceneConnection createLuceneConnection(Directory directory, Analyzer analyzer)
57 {
58 return createLuceneConnection(directory, analyzer, ILuceneConnection.DEFAULT_CONFIGURATION);
59 }
60 }