public static Path getConfigPath(@NonNull AbstractCommandArgs args) {
        switch (args.getDeployMode()) {
            case RUN:
            case CLIENT:
                return Paths.get(args.getConfigFile());
            case RUN_APPLICATION:
            case CLUSTER:
                return Paths.get(getFileName(args.getConfigFile()));
            default:
                throw new IllegalArgumentException(
                        "Unsupported deploy mode: " + args.getDeployMode());
        }
    }
@Test
    public void getConfigPath() throws URISyntaxException {
        // test client mode.
        SparkCommandArgs sparkCommandArgs = new SparkCommandArgs();
        sparkCommandArgs.setDeployMode(DeployMode.CLIENT);
        Path expectConfPath =
                Paths.get(FileUtilsTest.class.getResource("/flink.batch.conf").toURI());
        sparkCommandArgs.setConfigFile(expectConfPath.toString());
        Assertions.assertEquals(expectConfPath, FileUtils.getConfigPath(sparkCommandArgs));

        // test cluster mode
        sparkCommandArgs.setDeployMode(DeployMode.CLUSTER);
        Assertions.assertEquals(
                "flink.batch.conf", FileUtils.getConfigPath(sparkCommandArgs).toString());
    }