How to scan the file system in Java

Burningwave
1 min readNov 9, 2020

Through FileSystemItem of Burningwave Core library you can reach a resource of the file system even if it is contained in a nested supported (zip, jar, war, ear and jmod) compressed archive and obtain the content of it or other informations such as if it is a folder or a file or a compressed archive or if it is a compressed entry or obtain, if it is a folder or a compressed archive, the direct children or all nested children or a filtered collection of them. You can retrieve a FileSystemItem through an absolute path or through a relative path referred to your classpath by using the PathHelper. FileSystemItems are cached and there will only be one instance of them for an absolute path and you can also clear the cache e reload all informations of a FileSystemItem.

To use FileSystemItem you should simply add the following to your projects dependencies:

In the example below we show how to retrieve and use a FileSystemItem.

In this article we learned how to scan the file system and the complete source of this example is available here. For more articles about Burningwave Core you can go to the main page.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Burningwave
Burningwave

Written by Burningwave

A collection of Java libraries for building frameworks and applications: https://www.burningwave.org

No responses yet

What are your thoughts?