[ 
https://issues.apache.org/jira/browse/SOLR-8333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15023153#comment-15023153
 ] 

Erik Hatcher commented on SOLR-8333:
------------------------------------

I think here's a patch that fixes SimplePostTool's public API reasonably:

{code}
Index: solr/core/src/java/org/apache/solr/util/SimplePostTool.java
===================================================================
--- solr/core/src/java/org/apache/solr/util/SimplePostTool.java (revision 
1715806)
+++ solr/core/src/java/org/apache/solr/util/SimplePostTool.java (working copy)
@@ -111,7 +111,7 @@
   private int currentDepth;
 
   static HashMap<String,String> mimeMap;
-  GlobFileFilter globFileFilter;
+  FileFilter fileFilter;
   // Backlog for crawling
   List<LinkedHashSet<URL>> backlog = new ArrayList<>();
   Set<URL> visited = new HashSet<>();
@@ -286,7 +286,7 @@
     this.recursive = recursive;
     this.delay = delay;
     this.fileTypes = fileTypes;
-    this.globFileFilter = getFileFilterFromFileTypes(fileTypes);
+    this.fileFilter = getFileFilterFromFileTypes(fileTypes);
     this.out = out;
     this.commit = commit;
     this.optimize = optimize;
@@ -487,9 +487,9 @@
   private int postDirectory(File dir, OutputStream out, String type) {
     if(dir.isHidden() && !dir.getName().equals("."))
       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;
-    posted += postFiles(dir.listFiles(globFileFilter), out, type);
+    posted += postFiles(dir.listFiles(fileFilter), out, type);
     if(recursive > currentDepth) {
       for(File d : dir.listFiles()) {
         if(d.isDirectory()) {
@@ -965,7 +965,7 @@
     if (null != dest) dest.flush();
   }
 
-  public GlobFileFilter getFileFilterFromFileTypes(String fileTypes) {
+  public FileFilter getFileFilterFromFileTypes(String fileTypes) {
     String glob;
     if(fileTypes.equals("*"))
       glob = ".*";
{code}

> fix public methods that take/return private/package-private arguments/results
> -----------------------------------------------------------------------------
>
>                 Key: SOLR-8333
>                 URL: https://issues.apache.org/jira/browse/SOLR-8333
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Hoss Man
>
> background info: 
> http://mail-archives.apache.org/mod_mbox/lucene-dev/201511.mbox/%3Calpine.DEB.2.11.1511231128450.24330@tray%3E
> A commit that added a package to solrj which already existed in solr-core 
> caused the javadoc link checker to uncover at least 4 instances of private or 
> package-private classes being neccessary to use public APIs.
> we should fix these instances and any other instances of APIs with similar 
> problems that we can find.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to