Skip to content

sahabpardaz/clean-up

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clean-up

This library helps to free up all desired resources and clean-up operations by a single call.

By using this library, we will make sure that all operations, will be performed if it is possible. That means, if any exceptions occurs during clean-up operations of a resource, it will not prevent clean-up of other resources.

Sample Usage

An example usage may look like this:

Cleanups.of(httpServer)     // Calls httpServer.close()
        .and(this::stopWorkingThreads())
        .and(this::cleanTempFolder())
        .and(dbConnection)  // Calls dbConnection.close()
        .doAllQuitely();    // If there is an exception on any operation just logs it.
                            // You can replace it with doAll() then it throws the first exception after trying for all operations.

Add it to your project

You can reference to this library by either of java build systems (Maven, Gradle, SBT or Leiningen) using snippets from this jitpack link:

About

This library helps to free up several desired resources or clean-up tasks by a single call.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages