java-filesearch

java filesearch reimagined

License

License

Categories

Categories

Java Languages Search Business Logic Libraries
GroupId

GroupId

io.github.codejanovic
ArtifactId

ArtifactId

java-filesearch
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

java-filesearch
java filesearch reimagined
Project URL

Project URL

https://github.com/codejanovic/java-filesearch
Source Code Management

Source Code Management

https://github.com/codejanovic/java-filesearch.git

Download java-filesearch

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.codejanovic/java-filesearch/ -->
<dependency>
    <groupId>io.github.codejanovic</groupId>
    <artifactId>java-filesearch</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.codejanovic/java-filesearch/
implementation 'io.github.codejanovic:java-filesearch:0.1.0'
// https://jarcasting.com/artifacts/io.github.codejanovic/java-filesearch/
implementation ("io.github.codejanovic:java-filesearch:0.1.0")
'io.github.codejanovic:java-filesearch:jar:0.1.0'
<dependency org="io.github.codejanovic" name="java-filesearch" rev="0.1.0">
  <artifact name="java-filesearch" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.codejanovic', module='java-filesearch', version='0.1.0')
)
libraryDependencies += "io.github.codejanovic" % "java-filesearch" % "0.1.0"
[io.github.codejanovic/java-filesearch "0.1.0"]

Dependencies

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
org.assertj : assertj-core jar 3.4.1

Project Modules

There are no modules declared in this project.

Build Status Coverage Status License

java-filesearch

Java filesearch reimagined.

Maven

Release artifact

<dependency>
    <groupId>io.github.codejanovic</groupId>
    <artifactId>java-filesearch</artifactId>
    <version>0.1.0</version>
</dependency>

Snapshot artifact

<dependency>
    <groupId>io.github.codejanovic</groupId>
    <artifactId>java-filesearch</artifactId>
    <version>0.2.0-SNAPSHOT</version>
</dependency>

Motivation

This is just a fun project to reimplement the horrible file walking implementation from the JDK, trying to combine the two Java APIs of File.listFiles() and Files.walkFileTree() into a new API using Java's new Stream<T> feature of version 8.

To search for files simply start with the static method Search.search() and search for executable (.exe) files ...

... not recursively using the Path API

    import static io.github.codejanovic.java.filesearch.Search.search;

    public void doSomeFileSearchStuff() {
        final List<Path> executables = search().directory("S:\Earch\Path").notRecursively().byPath()
            .stream()
            .filter(p -> p.getFileName().toString().endsWith(".exe"))            
            .collect(Collectors.toList()); 
        // do something with found files
    }

... or recursively using the Path API

    import static io.github.codejanovic.java.filesearch.Search.search;

    public void doSomeFileSearchStuff() {
        final List<Path> executables = search().directory("S:\Earch\Path").recursively().byPath()
            .stream()
            .filter(p -> p.getFileName().toString().endsWith(".exe"))            
            .collect(Collectors.toList()); 
        // do something with found files
    }

... or not recursively using the File API

    import static io.github.codejanovic.java.filesearch.Search.search;

    public void doSomeFileSearchStuff() {
        final List<File> executables = search().directory("S:\Earch\Path").notRecursively().byFile()
            .stream()
            .filter(f -> f.getName().endsWith(".exe"))            
            .collect(Collectors.toList()); 
        // do something with found files
    }

... or recursively using the File API

    import static io.github.codejanovic.java.filesearch.Search.search;

     public void doSomeFileSearchStuff() {
            final List<File> executables = search().directory("S:\Earch\Path").recursively().byFile()
                .stream()
                .filter(f -> f.getName().endsWith(".exe"))            
                .collect(Collectors.toList()); 
            // do something with found files
    }

Versions

Version
0.1.0