String (@NotNull String path) { final String slashTrunk = "/trunk"; if (path.endsWith(slashTrunk)) { return path.substring(0, path.length() - slashTrunk.length()); } final String slashTrunkSlash = "/trunk/"; if (path.endsWith(slashTrunkSlash)) { return path.substring(0, path.length() - slashTrunkSlash.length()); } return path; }