Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete temp directory used for model extraction #474

Merged
merged 1 commit into from
Oct 11, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,11 @@ object ModelPublishFormat extends EventLogging {
var urls = Array.empty[URL]
var byteArray: Array[Byte] = null
var libraryPaths: Set[String] = Set.empty[String]
var tempDirectory: Path = null

try {
// Extract files to temporary directory so that dynamic library names are not changed
val tempDirectory = getTemporaryDirectory
tempDirectory = getTemporaryDirectory
tarFile = new TarArchiveInputStream(new FileInputStream(modelArchiveInput))

var entry = tarFile.getNextTarEntry
Expand Down Expand Up @@ -130,6 +131,7 @@ object ModelPublishFormat extends EventLogging {
}
finally {
IOUtils.closeQuietly(tarFile)
FileUtils.deleteQuietly(new File(tempDirectory.toString))
}

}
Expand Down