mirror of https://github.com/apache/lucene.git
SOLR-8333: fix public API from referring to inner class implementation
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1715999 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
bc01212d1a
commit
4995bbdd85
|
@ -111,7 +111,7 @@ public class SimplePostTool {
|
||||||
private int currentDepth;
|
private int currentDepth;
|
||||||
|
|
||||||
static HashMap<String,String> mimeMap;
|
static HashMap<String,String> mimeMap;
|
||||||
GlobFileFilter globFileFilter;
|
FileFilter fileFilter;
|
||||||
// Backlog for crawling
|
// Backlog for crawling
|
||||||
List<LinkedHashSet<URL>> backlog = new ArrayList<>();
|
List<LinkedHashSet<URL>> backlog = new ArrayList<>();
|
||||||
Set<URL> visited = new HashSet<>();
|
Set<URL> visited = new HashSet<>();
|
||||||
|
@ -286,7 +286,7 @@ public class SimplePostTool {
|
||||||
this.recursive = recursive;
|
this.recursive = recursive;
|
||||||
this.delay = delay;
|
this.delay = delay;
|
||||||
this.fileTypes = fileTypes;
|
this.fileTypes = fileTypes;
|
||||||
this.globFileFilter = getFileFilterFromFileTypes(fileTypes);
|
this.fileFilter = getFileFilterFromFileTypes(fileTypes);
|
||||||
this.out = out;
|
this.out = out;
|
||||||
this.commit = commit;
|
this.commit = commit;
|
||||||
this.optimize = optimize;
|
this.optimize = optimize;
|
||||||
|
@ -487,9 +487,9 @@ public class SimplePostTool {
|
||||||
private int postDirectory(File dir, OutputStream out, String type) {
|
private int postDirectory(File dir, OutputStream out, String type) {
|
||||||
if(dir.isHidden() && !dir.getName().equals("."))
|
if(dir.isHidden() && !dir.getName().equals("."))
|
||||||
return(0);
|
return(0);
|
||||||
info("Indexing directory "+dir.getPath()+" ("+dir.listFiles(globFileFilter).length+" files, depth="+currentDepth+")");
|
info("Indexing directory "+dir.getPath()+" ("+dir.listFiles(fileFilter).length+" files, depth="+currentDepth+")");
|
||||||
int posted = 0;
|
int posted = 0;
|
||||||
posted += postFiles(dir.listFiles(globFileFilter), out, type);
|
posted += postFiles(dir.listFiles(fileFilter), out, type);
|
||||||
if(recursive > currentDepth) {
|
if(recursive > currentDepth) {
|
||||||
for(File d : dir.listFiles()) {
|
for(File d : dir.listFiles()) {
|
||||||
if(d.isDirectory()) {
|
if(d.isDirectory()) {
|
||||||
|
@ -965,7 +965,7 @@ public class SimplePostTool {
|
||||||
if (null != dest) dest.flush();
|
if (null != dest) dest.flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
public GlobFileFilter getFileFilterFromFileTypes(String fileTypes) {
|
public FileFilter getFileFilterFromFileTypes(String fileTypes) {
|
||||||
String glob;
|
String glob;
|
||||||
if(fileTypes.equals("*"))
|
if(fileTypes.equals("*"))
|
||||||
glob = ".*";
|
glob = ".*";
|
||||||
|
|
|
@ -117,7 +117,7 @@ public class SimplePostToolTest extends SolrTestCaseJ4 {
|
||||||
assertFalse(t_web.typeSupported("text/foo"));
|
assertFalse(t_web.typeSupported("text/foo"));
|
||||||
|
|
||||||
t_web.fileTypes = "doc,xls,ppt";
|
t_web.fileTypes = "doc,xls,ppt";
|
||||||
t_web.globFileFilter = t_web.getFileFilterFromFileTypes(t_web.fileTypes);
|
t_web.fileFilter = t_web.getFileFilterFromFileTypes(t_web.fileTypes);
|
||||||
assertFalse(t_web.typeSupported("application/pdf"));
|
assertFalse(t_web.typeSupported("application/pdf"));
|
||||||
assertTrue(t_web.typeSupported("application/msword"));
|
assertTrue(t_web.typeSupported("application/msword"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue