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

hex.genmodel.TmpMojoReaderBackend Maven / Gradle / Ivy

There is a newer version: 3.46.0.6
Show newest version
package hex.genmodel;

import java.io.File;
import java.io.IOException;

public class TmpMojoReaderBackend extends ZipfileMojoReaderBackend {

  File _tempZipFile;

  public TmpMojoReaderBackend(File tempZipFile) throws IOException {
    super(tempZipFile.getPath());
    _tempZipFile = tempZipFile;
  }

  @Override
  public void close() throws IOException {
    super.close();
    if (_tempZipFile != null) {
      File f = _tempZipFile;
      _tempZipFile = null; // we don't want to attempt to delete the file twice (even if the first attempt fails)
      if (! f.delete())
        throw new IOException("Failed to delete temporary file " + f);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy