Skip to content

Instantly share code, notes, and snippets.

@Timshel
Last active August 29, 2015 14:27
Show Gist options
  • Save Timshel/b39f7ca724b16a7eb01e to your computer and use it in GitHub Desktop.
Save Timshel/b39f7ca724b16a7eb01e to your computer and use it in GitHub Desktop.
Workaround for Play #4925
import play.api._
import play.api.ApplicationLoader.Context
/**
* Fix for missing DefaultTemporaryFileCreator injection (#4925)
* Remove when next play version (2.4.3) is out.
*/
abstract class AddTempFileCreatorComponent(context: Context) extends BuiltInComponentsFromContext(context) {
import play.api.inject.{ SimpleInjector, NewInstanceInjector, Injector, DefaultApplicationLifecycle }
import play.api.libs.Files.DefaultTemporaryFileCreator
lazy val defaultTemporaryFileCreator = new DefaultTemporaryFileCreator(applicationLifecycle)
override lazy val injector: Injector = new SimpleInjector(NewInstanceInjector) + router + crypto + httpConfiguration + defaultTemporaryFileCreator
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment