All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.springml.spark.sftp.DeleteTempFileShutdownHook.scala Maven / Gradle / Ivy

package com.springml.spark.sftp

import org.apache.commons.io.FileUtils
import java.io.File
import org.apache.log4j.Logger

/**
 * Delete the temp file created during spark shutdown
 */
class DeleteTempFileShutdownHook(
    fileLocation: String) extends Thread {

  private val logger = Logger.getLogger(classOf[DatasetRelation])

  override def run(): Unit = {
    logger.info("Deleting " + fileLocation )
    FileUtils.deleteQuietly(new File(fileLocation))
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy