String findFileNameWithoutExtension(Path jarPath) {
        String fileName = jarPath.getFileName().toString();
        // Exclude the extension from filename
        int endIndex = fileName.lastIndexOf('.');
        if (endIndex != -1) {
            fileName = fileName.substring(0, endIndex);
        }
        return fileName;
    }
@Test
    public void testFindFileNameWithoutExtension() {
        JobUploadCall jobUploadCall = new JobUploadCall();

        String expectedFileName = "foo";
        Path jarPath = Paths.get("/mnt/foo.jar");
        String fileNameWithoutExtension = jobUploadCall.findFileNameWithoutExtension(jarPath);
        assertEquals(expectedFileName, fileNameWithoutExtension);

        jarPath = Paths.get("foo.jar");
        fileNameWithoutExtension = jobUploadCall.findFileNameWithoutExtension(jarPath);
        assertEquals(expectedFileName, fileNameWithoutExtension);

        jarPath = Paths.get("foo");
        fileNameWithoutExtension = jobUploadCall.findFileNameWithoutExtension(jarPath);
        assertEquals(expectedFileName, fileNameWithoutExtension);
    }