/** * Obtains a {@link MountableFile} corresponding to a file on the docker host filesystem. * * @param path the path to the resource * @param mode octal value of posix file mode (000..777) * @return a {@link MountableFile} that may be used to obtain a mountable path */ public static MountableFile forHostPath(final Path path, Integer mode) { return new MountableFile(path.toAbsolutePath().toString(), mode); }
/** * Obtains a {@link MountableFile} corresponding to a file on the docker host filesystem. * * @param path the path to the resource * @param mode octal value of posix file mode (000..777) * @return a {@link MountableFile} that may be used to obtain a mountable path */ public static MountableFile forHostPath(@NotNull final String path, Integer mode) { return new MountableFile(new File(path).toURI().toString(), mode); }
/** * Obtains a {@link MountableFile} corresponding to a resource on the classpath (including resources in JAR files) * * @param resourceName the classpath path to the resource * @param mode octal value of posix file mode (000..777) * @return a {@link MountableFile} that may be used to obtain a mountable path */ public static MountableFile forClasspathResource(@NotNull final String resourceName, Integer mode) { return new MountableFile(getClasspathResource(resourceName, new HashSet<>()).toString(), mode); }
/** * Obtains a {@link MountableFile} corresponding to a file on the docker host filesystem. * * @param path the path to the resource * @param mode octal value of posix file mode (000..777) * @return a {@link MountableFile} that may be used to obtain a mountable path */ public static MountableFile forHostPath(final Path path, Integer mode) { return new MountableFile(path.toAbsolutePath().toString(), mode); }
return new MountableFile(new File(path).toURI().toString(), mode);