Skip to content

Commit

Permalink
emc.rdf.dt: code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
agarciadom committed Feb 3, 2025
1 parent 2022413 commit 6d7f320
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,5 @@ protected void loadModel() throws EolModelLoadingException {
// Call the RDFModel load as normal, no platform URLs are passed to Jena
super.loadModel();
}



}
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,21 @@ private EclipseProtocolParser() {
// This class is not meant to be instantiated
}

// Pushes a list of URLs through a process to turn any Platform:/ into File:/
static public void processEclipsePlatformUrlsToFileUrls(List<String> urlList) throws IOException {
/**
* Transforms any {@code platform:/} URLs to {@code file:/} URLs.
* Does not change any other URLs.
*/
public static void processEclipsePlatformUrlsToFileUrls(List<String> urlList) throws IOException {
for (int i = 0; i < urlList.size(); i++) {
urlList.set(i, processPlatformURLtoFileUrl(urlList.get(i)));
}
}

// A File:/ URL or relative path starting '/' or '.' is unchanged by this process, Platform:/ URLs become File:/ URLs
// Attempts to resolve a String to a URI and then URL, then gets the File:/ URL and returns it
static public String processPlatformURLtoFileUrl(String urlString) throws IOException {
/**
* Transforms a {@code platform:/} URL into a {@code file:/} URL.
* Does not change any other URLs.
*/
public static String processPlatformURLtoFileUrl(String urlString) throws IOException {
if (!urlString.startsWith("platform:")) {
return urlString;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import org.eclipse.epsilon.eol.exceptions.models.EolModelLoadingException;

public class EclipseRDFModel extends RDFModel {

@Override
protected void loadModel() throws EolModelLoadingException {
// Change any platform:/ URLs to file:/ URLs in these lists...
Expand All @@ -30,7 +30,5 @@ protected void loadModel() throws EolModelLoadingException {
// Call the RDFModel load as normal, no platform URLs are passed to Jena
super.loadModel();
}



}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ protected String getModelName() {
protected String getModelType() {
return "MOF2RDF";
}

}

0 comments on commit 6d7f320

Please sign in to comment.