Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ dependencies {
}

implementation("net.sf.ehcache:ehcache:2.10.4")

implementation("commons-io:commons-io:2.6")
}


Expand Down
7 changes: 3 additions & 4 deletions src/main/java/ome/services/scripts/ScriptRepoHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
package ome.services.scripts;

import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -77,7 +76,7 @@ public class ScriptRepoHelper extends OnContextRefreshedEventListener {
* matching scripts in the given directory.
*/
public final static IOFileFilter BASE_SCRIPT_FILTER = new AndFileFilter(Arrays
.asList(new FileFilter[] { EmptyFileFilter.NOT_EMPTY,
.asList(new IOFileFilter[] { EmptyFileFilter.NOT_EMPTY,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that all of this is in the public API is less than ideal for dropping the library.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that's a response to #135 (comment) rather than a review of these changes :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I just wanted to make the comment closer to the actual code.

HiddenFileFilter.VISIBLE, CanReadFileFilter.CAN_READ }));

private final Map<String, ScriptFileType> types =
Expand Down Expand Up @@ -191,8 +190,8 @@ public void handleContextRefreshedEvent(ContextRefreshedEvent event) {
event.getApplicationContext()
.getBeansOfType(ScriptFileType.class));

final List<FileFilter> andFilters = new ArrayList<FileFilter>();
final List<FileFilter> orFilters= new ArrayList<FileFilter>();
final List<IOFileFilter> andFilters = new ArrayList<IOFileFilter>();
final List<IOFileFilter> orFilters= new ArrayList<IOFileFilter>();
for (Map.Entry<String, ScriptFileType> entry : types.entrySet()) {
IOFileFilter found = entry.getValue().getFileFilter();
log.info("Registering {}: {}", entry.getKey(), found);
Expand Down