public static synchronized void createMissingParents(File baseDir) {
        checkNotNull(baseDir, "Base dir has to be provided.");

        if (!baseDir.exists()) {
            try {
                FileUtils.forceMkdirParent(baseDir);
                LOG.info("Created parents for base dir: {}", baseDir);
            } catch (Exception e) {
                throw new FlinkRuntimeException(
                        String.format("Failed to create parent(s) for given base dir: %s", baseDir),
                        e);
            }
        }
    }
@Test
    void testCreateMissingParents(@TempDir Path tempDir) {
        File targetDir = tempDir.resolve("p1").resolve("p2").resolve("base-dir").toFile();
        assertThat(targetDir.getParentFile().getParentFile()).doesNotExist();

        ArtifactUtils.createMissingParents(targetDir);
        assertThat(targetDir.getParentFile()).isDirectory();
    }