获得ClassPath，这个ClassPath路径会文件路径被标准化处理

@param isEncoded 是否编码路径中的中文
@return ClassPath
@since 3.2.1
16326
public static String getClassPath(boolean isEncoded) {
		final URL classPathURL = getClassPathURL();
		String url = isEncoded ? classPathURL.getPath() : URLUtil.getDecodedPath(classPathURL);
		return FileUtil.normalize(url);
	}
362370
public static Optional<List<String>> getStringListAsOptWithClasspath(
            String classpathOrFilePath) {
        return getResourceInputStreamAsOpt(classpathOrFilePath)
                .map(JMInputStream::readLines);
    }
894311
public static String pathEncode(String path, Charset charset) {
    return encodeReserved(path, FragmentType.PATH_SEGMENT, charset);

    /*
     * path encoding is not equivalent to query encoding, there are few differences, namely dealing
     * with spaces, !, ', (, ), and ~ characters. we will need to manually process those values.
     */
    // return encoded.replaceAll("\\+", "%20");
  }
107025
public static String getSourcePathForClass(String className, String defaultValue) {

	try {

	    return getSourcePathForClass(ClassUtil.loadClass(className), defaultValue);
	}
	catch (Throwable t) {
	    ExceptionUtil.rethrowIfNecessary(t);
	}

	return defaultValue;
    }
451876
public static List<LatLng> decode(final String encodedPath) {

    int len = encodedPath.length();

    final List<LatLng> path = new ArrayList<>(len / 2);
    int index = 0;
    int lat = 0;
    int lng = 0;

    while (index < len) {
      int result = 1;
      int shift = 0;
      int b;
      do {
        b = encodedPath.charAt(index++) - 63 - 1;
        result += b << shift;
        shift += 5;
      } while (b >= 0x1f);
      lat += (result & 1) != 0 ? ~(result >> 1) : (result >> 1);

      result = 1;
      shift = 0;
      do {
        b = encodedPath.charAt(index++) - 63 - 1;
        result += b << shift;
        shift += 5;
      } while (b >= 0x1f);
      lng += (result & 1) != 0 ? ~(result >> 1) : (result >> 1);

      path.add(new LatLng(lat * 1e-5, lng * 1e-5));
    }

    return path;
  }
1371259
public ClassFinder addClasspath() {
    try {
      String path = System.getProperty("java.class.path");
      StringTokenizer tok = new StringTokenizer(path, File.pathSeparator);
      while (tok.hasMoreTokens())
        add(new File(tok.nextToken()));
    } catch (Exception ex) {
      log.error("Unable to get class path", ex);
    }
    return this;
  }
957528
protected String doGetString( NamespaceRegistry namespaceRegistry,
                                  TextEncoder encoder,
                                  TextEncoder delimiterEncoder ) {
        if (encoder == null) encoder = DEFAULT_ENCODER;
        final String delimiter = delimiterEncoder != null ? delimiterEncoder.encode(DELIMITER_STR) : DELIMITER_STR;

        // Since the segments are immutable, this code need not be synchronized because concurrent threads
        // may just compute the same value (with no harm done)
        StringBuilder sb = new StringBuilder();
        if (this.isAbsolute()) sb.append(delimiter);
        boolean first = true;
        for (Segment segment : this) {
            if (first) {
                first = false;
            } else {
                sb.append(delimiter);
            }
            assert segment != null;
            sb.append(segment.getString(namespaceRegistry, encoder, delimiterEncoder));
        }
        String result = sb.toString();
        // Save the result to the internal string if this the default encoder is used.
        // This is not synchronized, but it's okay
        return result;
    }
206812
@Check(CheckType.NORMAL)
	@Override
	@SuppressWarnings("checkstyle:npathcomplexity")
	public void checkClassPath(XtendFile sarlScript) {
		final TypeReferences typeReferences = getServices().getTypeReferences();

		if (!Utils.isCompatibleJREVersion()) {
			error(
					MessageFormat.format(
							Messages.SARLValidator_3,
							System.getProperty("java.specification.version"), //$NON-NLS-1$
							SARLVersion.MINIMAL_JDK_VERSION,
							SARLVersion.MAXIMAL_JDK_VERSION),
					sarlScript,
					XtendPackage.Literals.XTEND_FILE__PACKAGE,
					JDK_NOT_ON_CLASSPATH);
		} else {
			final GeneratorConfig generatorConfiguration = getGeneratorConfig(sarlScript);
			final JavaVersion generatorVersion = generatorConfiguration.getJavaSourceVersion();
			if (generatorVersion == null
					|| !Utils.isCompatibleJREVersion(generatorVersion.getQualifier())) {
				error(
						MessageFormat.format(
								Messages.SARLValidator_4,
								generatorVersion,
								SARLVersion.MINIMAL_JDK_VERSION,
								SARLVersion.MAXIMAL_JDK_VERSION),
						sarlScript,
						XtendPackage.Literals.XTEND_FILE__PACKAGE,
						JDK_NOT_ON_CLASSPATH);
			}
		}

		if (!Utils.isCompatibleXtextVersion()) {
			error(
					MessageFormat.format(
							Messages.SARLValidator_5,
							XtextVersion.getCurrent(),
							SARLVersion.MINIMAL_XTEXT_VERSION),
					sarlScript,
					XtendPackage.Literals.XTEND_FILE__PACKAGE,
					XBASE_LIB_NOT_ON_CLASSPATH);
		} else {
			final JvmType type = typeReferences.findDeclaredType(ToStringBuilder.class.getName(), sarlScript);
			if (type == null) {
				error(
						MessageFormat.format(
								Messages.SARLValidator_6,
								SARLVersion.MINIMAL_XTEXT_VERSION),
						sarlScript,
						XtendPackage.Literals.XTEND_FILE__PACKAGE,
						XBASE_LIB_NOT_ON_CLASSPATH);
			}
		}

		final OutParameter<String> sarlLibraryVersion = new OutParameter<>();
		final SarlLibraryErrorCode errorCode = Utils.getSARLLibraryVersionOnClasspath(typeReferences, sarlScript, sarlLibraryVersion);
		if (errorCode != SarlLibraryErrorCode.SARL_FOUND) {
			final ResourceSet resourceSet = EcoreUtil2.getResourceSet(sarlScript);
			final StringBuilder classPath = new StringBuilder();
			for (final Resource resource : resourceSet.getResources()) {
				classPath.append(resource.getURI().toString());
				classPath.append("\n"); //$NON-NLS-1$
			}
			final StringBuilder fields = new StringBuilder();
			try {
				final JvmDeclaredType type = (JvmDeclaredType) typeReferences.findDeclaredType(SARLVersion.class, sarlScript);
				for (final JvmField field : type.getDeclaredFields()) {
					fields.append(field.getIdentifier());
					fields.append(" / "); //$NON-NLS-1$
					fields.append(field.getSimpleName());
					fields.append("\n"); //$NON-NLS-1$
				}
			} catch (Exception e) {
				//
			}
			if (fields.length() == 0) {
				for (final Field field : SARLVersion.class.getDeclaredFields()) {
					fields.append(field.getName());
					fields.append("\n"); //$NON-NLS-1$
				}
			}
			error(
					MessageFormat.format(Messages.SARLValidator_7, errorCode.name(), classPath.toString(), fields.toString()),
					sarlScript,
					XtendPackage.Literals.XTEND_FILE__PACKAGE,
					SARL_LIB_NOT_ON_CLASSPATH);
		} else if (!Utils.isCompatibleSARLLibraryVersion(sarlLibraryVersion.get())) {
			error(
					MessageFormat.format(Messages.SARLValidator_8,
							sarlLibraryVersion.get(), SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING),
					sarlScript,
					XtendPackage.Literals.XTEND_FILE__PACKAGE,
					INVALID_SARL_LIB_ON_CLASSPATH);
		}
	}
473346
public static List<String> readLinesWithClasspathOrFilePath(
            String classpathOrFilePath) {
        return getStringListAsOptWithClasspath(classpathOrFilePath)
                .filter(JMPredicate.getGreaterSize(0))
                .orElseGet(() -> JMFiles.readLines(classpathOrFilePath));
    }
31553
public static File getClasspathFile(String filename) {
    if(filename == null) {
      throw LOG.nullParameter("filename");
    }

    return getClasspathFile(filename, null);
  }
982831
public String getClasspath() {
        StringBuilder sb = new StringBuilder();
        boolean firstPass = true;
        Enumeration componentEnum = pathComponents.elements();
        while (componentEnum.hasMoreElements()) {
            if (!firstPass) {
                sb.append(System.getProperty("path.separator"));
            } else {
                firstPass = false;
            }
            sb.append(((File) componentEnum.nextElement()).getAbsolutePath());
        }
        return sb.toString();
    }
834150
public static URL[] findClassPaths()
   {
      List<URL> list = new ArrayList<URL>();
      String classpath = System.getProperty("java.class.path");
      StringTokenizer tokenizer = new StringTokenizer(classpath, File.pathSeparator);

      while (tokenizer.hasMoreTokens())
      {
         String path = tokenizer.nextToken();
         File fp = new File(path);
         if (!fp.exists()) {
        	 throw new RuntimeException("File in java.class.path does not exist: " + fp);
         }
         try
         {
            list.add(fp.toURL());
         }
         catch (MalformedURLException e)
         {
            throw new RuntimeException(e);
         }
      }
      return list.toArray(new URL[list.size()]);
   }
810460
private static InputStream findFileInClasspath(String fileName) {

		InputStream is = null;

		try {

			ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
			is = classLoader.getResourceAsStream(fileName);
			return is;

		} catch (Exception ex) {

			log.error(String.format("Error while reading file '%s' from classpath", fileName), ex);
			return null;
		}

	}
1141673
public static String getStringWithFilePathOrClasspath(
            String filePathOrClasspath, String charsetName) {
        return getStringAsOptWithFilePath(filePathOrClasspath, charsetName)
                .orElseGet(
                        () -> getStringAsOptWithClasspath(
                                filePathOrClasspath,
                                charsetName).orElse(null));
    }
615568
private byte[] encodePKIPATH() throws CertificateEncodingException {

        ListIterator<X509Certificate> li = certs.listIterator(certs.size());
        try {
            DerOutputStream bytes = new DerOutputStream();
            // encode certs in reverse order (trust anchor to target)
            // according to PkiPath format
            while (li.hasPrevious()) {
                X509Certificate cert = li.previous();
                // check for duplicate cert
                if (certs.lastIndexOf(cert) != certs.indexOf(cert)) {
                    throw new CertificateEncodingException
                        ("Duplicate Certificate");
                }
                // get encoded certificates
                byte[] encoded = cert.getEncoded();
                bytes.write(encoded);
            }

            // Wrap the data in a SEQUENCE
            DerOutputStream derout = new DerOutputStream();
            derout.write(DerValue.tag_SequenceOf, bytes);
            return derout.toByteArray();

        } catch (IOException ioe) {
           throw new CertificateEncodingException("IOException encoding " +
                   "PkiPath data: " + ioe, ioe);
        }
    }
301350
def _jython_set_classpath(jars):
    '''
    
    '''
    from java.net import URL, URLClassLoader
    from java.lang import ClassLoader
    from java.io import File
    m = URLClassLoader.getDeclaredMethod("addURL", [URL])
    m.accessible = 1
    urls = [File(i).toURL() for i in jars]
    m.invoke(ClassLoader.getSystemClassLoader(), urls)
181339
public static String getClassRootPath(Class<?> c) {
		String strClassPathName = getClassPathName(c);

		ClassLoader cl = c.getClassLoader();
		if (cl == null)
			return null;

		URL urlClass = cl.getResource(strClassPathName);
		if (urlClass == null)
			return null;

		String strUrl = urlClass.toString();
		return strUrl.substring(0, strUrl.lastIndexOf(strClassPathName));
	}