Tabnine Logo
MountableFile.deleteOnExit
Code IndexAdd Tabnine to your IDE (free)

How to use
deleteOnExit
method
in
org.testcontainers.utility.MountableFile

Best Java code snippets using org.testcontainers.utility.MountableFile.deleteOnExit (Showing top 2 results out of 315)

origin: testcontainers/testcontainers-java

deleteOnExit(tmpLocation.toPath());
origin: org.testcontainers/testcontainers

@SuppressWarnings("ResultOfMethodCallIgnored")
private void copyFromJarToLocation(final JarFile jarFile, final JarEntry entry, final String fromRoot, final File toRoot) throws IOException {
  String destinationName = entry.getName().replaceFirst(fromRoot, "");
  File newFile = new File(toRoot, destinationName);
  log.debug("Copying resource {} from JAR file {}", fromRoot, jarFile.getName());
  if (!entry.isDirectory()) {
    // Create parent directories
    Path parent = newFile.getAbsoluteFile().toPath().getParent();
    parent.toFile().mkdirs();
    newFile.deleteOnExit();
    try (InputStream is = jarFile.getInputStream(entry)) {
      Files.copy(is, newFile.toPath());
    } catch (IOException e) {
      log.error("Failed to extract classpath resource " + entry.getName() + " from JAR file " + jarFile.getName(), e);
      throw e;
    }
  }
}
org.testcontainers.utilityMountableFiledeleteOnExit

Popular methods of MountableFile

  • forClasspathResource
  • forHostPath
  • getResolvedPath
  • <init>
  • copyFromJarToLocation
  • createTempDirectory
  • extractClassPathResourceToTempLocation
    Extract a file or directory tree from a JAR file to a temporary location. This allows Docker to moun
  • getClasspathResource
  • getFilesystemPath
  • getModeValue
  • getResourcePath
  • getUnixFileMode
  • getResourcePath,
  • getUnixFileMode,
  • unencodeResourceURIToFilePath,
  • getFileMode,
  • recursiveTar,
  • resolveFilesystemPath,
  • resolvePath,
  • transferTo

Popular in Java

  • Reading from database using SQL prepared statement
  • putExtra (Intent)
  • startActivity (Activity)
  • getApplicationContext (Context)
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now