@Test public void extractArtifactNameTest2() throws MalformedURLException { URL url = new URL("http: assertEquals("nfmantis-sources-genericqueryable-source-6.0.8.zip",DataFormatAdapter.extractArtifactName(url).orElse("")); }
public static Optional<String> extractArtifactName(String jarStr) { if(jarStr != null && !jarStr.isEmpty()) { int lastIndexOfForwardSlash = jarStr.lastIndexOf('/'); if (lastIndexOfForwardSlash != -1) { String artifactName = jarStr.substring(lastIndexOfForwardSlash + 1, jarStr.length()); return of(artifactName); } } logger.warn("Could not extract artifactName from " + jarStr); return empty(); }
DataFormatAdapter { public static Optional<String> extractArtifactName(String jarStr) { if(jarStr != null && !jarStr.isEmpty()) { int lastIndexOfForwardSlash = jarStr.lastIndexOf('/'); if (lastIndexOfForwardSlash != -1) { String artifactName = jarStr.substring(lastIndexOfForwardSlash + 1, jarStr.length()); return of(artifactName); } } logger.warn("Could not extract artifactName from " + jarStr); return empty(); } }
DataFormatAdapter { public static Optional<String> extractArtifactName(String jarStr) { if(jarStr != null && !jarStr.isEmpty()) { int lastIndexOfForwardSlash = jarStr.lastIndexOf('/'); if (lastIndexOfForwardSlash != -1) { String artifactName = jarStr.substring(lastIndexOfForwardSlash + 1, jarStr.length()); return of(artifactName); } } logger.warn("Could not extract artifactName from " + jarStr); return empty(); }  }
DataFormatAdapter { public static Optional<String> extractArtifactName(String jarStr) { if(jarStr != null && !jarStr.isEmpty()) { int lastIndexOfForwardSlash = jarStr.lastIndexOf('/'); if (lastIndexOfForwardSlash != -1) { String artifactName = jarStr.substring(lastIndexOfForwardSlash + 1, jarStr.length()); return of(artifactName); } } logger.warn("Could not extract artifactName from " + jarStr); return empty(); }  static NamedJob convertJobClusterMetadataToNamedJob(IJobClusterMetadata jobCluster); static NamedJob.CompletedJob convertCompletedJobToNamedJobCompletedJob(JobClusterDefinitionImpl.CompletedJob cJob); static JobClusterDefinitionImpl.CompletedJob convertNamedJobCompletedJobToCompletedJob(NamedJob.CompletedJob completedJob); static IJobClusterMetadata convertNamedJobToJobClusterMetadata(NamedJob nJob); static List<NamedJob.Jar> convertJobClusterConfigsToJars(List<JobClusterConfig> jobClusterConfigs); static List<JobClusterConfig> convertJarsToJobClusterConfigs(List<NamedJob.Jar> jars); static NamedJob.Jar convertJobClusterConfigToJar(JobClusterConfig jConfig); static JobClusterConfig convertJarToJobClusterConfig(NamedJob.Jar jar ); static URL generateURL(String artifactName); static Optional<String> extractArtifactName(String jarStr); static Optional<String> extractArtifactName(URL jar); static NamedJob.SLA convertSLAToNamedJobSLA(io.mantisrx.server.master.domain.SLA sla); static NamedJobDefinition.CronPolicy convertToNamedJobDefinitionCronPolicy(IJobClusterDefinition.CronPolicy cPolicy); static MantisWorkerMetadataWritable convertMantisWorkerMetadataToMantisWorkerMetadataWritable(IMantisWorkerMetadata workerMeta); static FilterableMantisWorkerMetadataWritable convertMantisWorkerMetadataToFilterableMantisWorkerMetadataWritable(IMantisWorkerMetadata workerMeta); static void setWorkerMetadataWritable(MantisWorkerMetadataWritable writable, IMantisWorkerMetadata workerMeta); static JobWorker convertMantisWorkerMetadataWriteableToMantisWorkerMetadata(MantisWorkerMetadata writeable, LifecycleEventPublisher eventPublisher); static MantisStageMetadataWritable convertMantisStageMetadataToMantisStageMetadataWriteable(IMantisStageMetadata stageMeta); static FilterableMantisStageMetadataWritable convertFilterableMantisStageMetadataToMantisStageMetadataWriteable(IMantisStageMetadata stageMeta); static io.mantisrx.server.master.domain.SLA convertToSLA(NamedJob.SLA sla); static IJobClusterDefinition.CronPolicy convertToCronPolicy(NamedJobDefinition.CronPolicy cronPolicy); static IMantisJobMetadata convertMantisJobWriteableToMantisJobMetadata(MantisJobMetadata archJob, LifecycleEventPublisher eventPublisher); static IMantisJobMetadata convertMantisJobWriteableToMantisJobMetadata(MantisJobMetadata archJob, LifecycleEventPublisher eventPublisher, boolean isArchived); static IMantisStageMetadata convertMantisStageMetadataWriteableToMantisStageMetadata(
            MantisStageMetadata stageMeta,
            LifecycleEventPublisher eventPublisher); static IMantisStageMetadata convertMantisStageMetadataWriteableToMantisStageMetadata(MantisStageMetadata stageMeta,
                                                                                                LifecycleEventPublisher eventPublisher,
                                                                                                boolean skipAddingWorkerMetaData); static MantisJobMetadataWritable convertMantisJobMetadataToMantisJobMetadataWriteable(IMantisJobMetadata jobMetadata); static FilterableMantisJobMetadataWritable convertMantisJobMetadataToFilterableMantisJobMetadataWriteable(IMantisJobMetadata jobMetadata); static JobState convertMantisJobStateToJobState(MantisJobState state); static MantisJobState convertToMantisJobState(JobState state); static MantisJobState convertWorkerStateToMantisJobState(WorkerState state); static WorkerState convertMantisJobStateToWorkerState(MantisJobState state); static List<JobClusterInfo.JarInfo> convertNamedJobJarListToJarInfoList(List<NamedJob.Jar> jars); }
DataFormatAdapter { public static Optional<String> extractArtifactName(String jarStr) { if(jarStr != null && !jarStr.isEmpty()) { int lastIndexOfForwardSlash = jarStr.lastIndexOf('/'); if (lastIndexOfForwardSlash != -1) { String artifactName = jarStr.substring(lastIndexOfForwardSlash + 1, jarStr.length()); return of(artifactName); } } logger.warn("Could not extract artifactName from " + jarStr); return empty(); }  static NamedJob convertJobClusterMetadataToNamedJob(IJobClusterMetadata jobCluster); static NamedJob.CompletedJob convertCompletedJobToNamedJobCompletedJob(JobClusterDefinitionImpl.CompletedJob cJob); static JobClusterDefinitionImpl.CompletedJob convertNamedJobCompletedJobToCompletedJob(NamedJob.CompletedJob completedJob); static IJobClusterMetadata convertNamedJobToJobClusterMetadata(NamedJob nJob); static List<NamedJob.Jar> convertJobClusterConfigsToJars(List<JobClusterConfig> jobClusterConfigs); static List<JobClusterConfig> convertJarsToJobClusterConfigs(List<NamedJob.Jar> jars); static NamedJob.Jar convertJobClusterConfigToJar(JobClusterConfig jConfig); static JobClusterConfig convertJarToJobClusterConfig(NamedJob.Jar jar ); static URL generateURL(String artifactName); static Optional<String> extractArtifactName(String jarStr); static Optional<String> extractArtifactName(URL jar); static NamedJob.SLA convertSLAToNamedJobSLA(io.mantisrx.server.master.domain.SLA sla); static NamedJobDefinition.CronPolicy convertToNamedJobDefinitionCronPolicy(IJobClusterDefinition.CronPolicy cPolicy); static MantisWorkerMetadataWritable convertMantisWorkerMetadataToMantisWorkerMetadataWritable(IMantisWorkerMetadata workerMeta); static FilterableMantisWorkerMetadataWritable convertMantisWorkerMetadataToFilterableMantisWorkerMetadataWritable(IMantisWorkerMetadata workerMeta); static void setWorkerMetadataWritable(MantisWorkerMetadataWritable writable, IMantisWorkerMetadata workerMeta); static JobWorker convertMantisWorkerMetadataWriteableToMantisWorkerMetadata(MantisWorkerMetadata writeable, LifecycleEventPublisher eventPublisher); static MantisStageMetadataWritable convertMantisStageMetadataToMantisStageMetadataWriteable(IMantisStageMetadata stageMeta); static FilterableMantisStageMetadataWritable convertFilterableMantisStageMetadataToMantisStageMetadataWriteable(IMantisStageMetadata stageMeta); static io.mantisrx.server.master.domain.SLA convertToSLA(NamedJob.SLA sla); static IJobClusterDefinition.CronPolicy convertToCronPolicy(NamedJobDefinition.CronPolicy cronPolicy); static IMantisJobMetadata convertMantisJobWriteableToMantisJobMetadata(MantisJobMetadata archJob, LifecycleEventPublisher eventPublisher); static IMantisJobMetadata convertMantisJobWriteableToMantisJobMetadata(MantisJobMetadata archJob, LifecycleEventPublisher eventPublisher, boolean isArchived); static IMantisStageMetadata convertMantisStageMetadataWriteableToMantisStageMetadata(
            MantisStageMetadata stageMeta,
            LifecycleEventPublisher eventPublisher); static IMantisStageMetadata convertMantisStageMetadataWriteableToMantisStageMetadata(MantisStageMetadata stageMeta,
                                                                                                LifecycleEventPublisher eventPublisher,
                                                                                                boolean skipAddingWorkerMetaData); static MantisJobMetadataWritable convertMantisJobMetadataToMantisJobMetadataWriteable(IMantisJobMetadata jobMetadata); static FilterableMantisJobMetadataWritable convertMantisJobMetadataToFilterableMantisJobMetadataWriteable(IMantisJobMetadata jobMetadata); static JobState convertMantisJobStateToJobState(MantisJobState state); static MantisJobState convertToMantisJobState(JobState state); static MantisJobState convertWorkerStateToMantisJobState(WorkerState state); static WorkerState convertMantisJobStateToWorkerState(MantisJobState state); static List<JobClusterInfo.JarInfo> convertNamedJobJarListToJarInfoList(List<NamedJob.Jar> jars);  }