Skip to content

Could we add a utility to delete the content of a whole directory? #463

@gsmet

Description

@gsmet

I'm trying to get rid of our usage of Commons IO in Quarkus. For most of the use cases, I can just use java.nio instead but there are a few uses cases for which it would be nice to have some proper util in SmallRye Common.

A few of them I could spot in our code base, not saying all of them should be added but we know they are used:

  • org.apache.common.io.FileUtils.deleteDirectory: delete an entire directory
  • org.apache.common.io.FileUtils.cleanDirectory: clean the content of a directory: this one
  • org.apache.common.io.FileUtils.deleteQuietly: delete whatever is there (file or entire directory) quietly, no exception if it fails
  • org.apache.common.io.FileUtils.copyFileToDirectory: will copy a file to a directory, preserving the timestamp and creating the directory structure if needed
  • org.apache.common.io.FileUtils.moveDirectory: move or copy/delete a directory when not on same fs
    One is the ability to delete an entire directory:
  • org.codehaus.plexus.util.FileUtils.copyDirectoryStructure: we are using it once in test code

I will update the list while I investigate this.

Ideally if we could start a class with some common utilities that are missing from the JDK, that would be cool.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions