UTILS { public static String cleanPackageName(String path) throws InvalidUriException { String[] tokens = path.split("\\/"); for (String token : tokens) { if (!isTokenValid(token)) { throw new InvalidUriException(token); } } return UTILS.removeLastPoint(path.replaceAll("\\/", ".")); }  static String cleanPath(IRI iri); static boolean createNew(File file); static boolean delete(File file); static String getOlgaVersion(); static String cleanPackageName(String path); static void validateClassName(String className); static boolean hasOntologyFormatExtension(String fileName); static int weightOfProperties(ZClass zclass); static String cleanPackageName(IRI iri); static void copyFiles(String fileName, String pathSource, String pathDestination); static void copyDirectory(String directoryName, String pathSource, String pathDestination); static String removeLastPoint(String packageName); static boolean isPathValid(String path); static String rebuildPath(String path); static void cleanDirectory(File directory); static boolean deleteDirectory(File dir); static boolean isVersionPatternValid(String version); static int propertyWeight(ZObjectProperty zObjectProperty); static int propertyWeight(ZDataProperty zDataProperty);  }
@Test public void testcleanPackageName() { String iriStr = "http: IRI iri = IRI.create(iriStr); String result = UTILS.cleanPackageName(iri); assertEquals("www.semanticweb.org.sesa.ontologies._2017._3.untitled_ontology_10", result); }
@Test public void testcleanPackageNameWithoutHash() { String iriStr = "http: IRI iri = IRI.create(iriStr); String result = UTILS.cleanPackageName(iri); assertEquals("www.semanticweb.org.sesa.ontologies._2017._3.untitled_ontology_10", result); }