/** * Creates a new location. * * @param descriptor The location descriptor. */ public Location(String descriptor) { String normalizedDescriptor = descriptor.trim().replace("\\", "/"); if (normalizedDescriptor.contains(":")) { prefix = normalizedDescriptor.substring(0, normalizedDescriptor.indexOf(":") + 1); path = normalizedDescriptor.substring(normalizedDescriptor.indexOf(":") + 1); } else { prefix = CLASSPATH_PREFIX; path = normalizedDescriptor; } if (isClassPath()) { path = path.replace(".", "/"); if (path.startsWith("/")) { path = path.substring(1); } } else { if (!isFileSystem()) { throw new ClassPathScanException("Unknown prefix, should be either filesystem: or classpath: " + normalizedDescriptor); } } if (path.endsWith("/")) { path = path.substring(0, path.length() - 1); } }