Skip to content

Load config resources from classpath / URL #1204

Closed

Description

@nedtwigg

It comes up from time to time that users want to setup their formatter steps from classpath resources and/or URLs. A few previous requests:

I'll answer it once and for all here. The short answer is use blowdryer.

The longer answer is that File is a good interface. Sometimes the formatting happens within the JVM, but othertimes we are actually passing the file to a different process, and File works for either case.

So instead of overloading every method that takes a File to have another version that takes URL url and another that takes String localResource, what you really want is some function that takes a URL or local classpath resource and returns a File. That's simple to do, but there's some tricky bookkeeping - what should the name be, where should the file live, when do we reuse the same file, etc.

blowdryer answers all those questions with the shortest answer we could think of. It introduces no tasks - it creates the Files at configuration time and uses caching to support fully-offline builds and the best possible performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions