This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Commit ad34df68 authored by Michael Breu's avatar Michael Breu 💬
Browse files

Minor extension

parent a503da4b
......@@ -40,6 +40,22 @@ public class ExerciseId {
return path;
}
/**
* adds an extra path to existing path
* @param path
* @return
*/
public String extendPath(String extraPath) {
if(path == null || path == "")
return extraPath;
if (extraPath == null || extraPath == "")
return path;
if (extraPath.startsWith("/"))
return "/"+path + extraPath;
else
return path + "/" + extraPath;
}
protected final static Pattern ExerciseIdPattern = Pattern.compile("(\\d+)(:(.*))?");
public String toString() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment