java.net.URLClassLoader.isDirectory()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(98)

本文整理了Java中java.net.URLClassLoader.isDirectory()方法的一些代码示例,展示了URLClassLoader.isDirectory()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。URLClassLoader.isDirectory()方法的具体详情如下:
包路径:java.net.URLClassLoader
类名称:URLClassLoader
方法名:isDirectory

URLClassLoader.isDirectory介绍

[英]Determines if the URL is pointing to a directory.
[中]确定URL是否指向目录。

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Returns an URL that will be checked if it contains the class or resource.
 * If the file component of the URL is not a directory, a Jar URL will be
 * created.
 *
 * @return java.net.URL a test URL
 */
private URL createSearchURL(URL url) throws MalformedURLException {
  if (url == null) {
    return url;
  }
  String protocol = url.getProtocol();
  if (isDirectory(url) || protocol.equals("jar")) {
    return url;
  }
  if (factory == null) {
    return new URL("jar", "",
        -1, url.toString() + "!/");
  }
  // use jar protocol as the stream handler protocol
  return new URL("jar", "",
      -1, url.toString() + "!/",
      factory.createURLStreamHandler("jar"));
}

代码示例来源:origin: robovm/robovm

path = path.replace('/', File.separatorChar);
if (isDirectory(u)) {
  pc.add(new FilePermission(path + "-", "read"));
} else {

代码示例来源:origin: MobiVM/robovm

/**
 * Returns an URL that will be checked if it contains the class or resource.
 * If the file component of the URL is not a directory, a Jar URL will be
 * created.
 *
 * @return java.net.URL a test URL
 */
private URL createSearchURL(URL url) throws MalformedURLException {
  if (url == null) {
    return url;
  }
  String protocol = url.getProtocol();
  if (isDirectory(url) || protocol.equals("jar")) {
    return url;
  }
  if (factory == null) {
    return new URL("jar", "",
        -1, url.toString() + "!/");
  }
  // use jar protocol as the stream handler protocol
  return new URL("jar", "",
      -1, url.toString() + "!/",
      factory.createURLStreamHandler("jar"));
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Returns an URL that will be checked if it contains the class or resource.
 * If the file component of the URL is not a directory, a Jar URL will be
 * created.
 *
 * @return java.net.URL a test URL
 */
private URL createSearchURL(URL url) throws MalformedURLException {
  if (url == null) {
    return url;
  }
  String protocol = url.getProtocol();
  if (isDirectory(url) || protocol.equals("jar")) {
    return url;
  }
  if (factory == null) {
    return new URL("jar", "",
        -1, url.toString() + "!/");
  }
  // use jar protocol as the stream handler protocol
  return new URL("jar", "",
      -1, url.toString() + "!/",
      factory.createURLStreamHandler("jar"));
}

代码示例来源:origin: ibinti/bugvm

/**
 * Returns an URL that will be checked if it contains the class or resource.
 * If the file component of the URL is not a directory, a Jar URL will be
 * created.
 *
 * @return java.net.URL a test URL
 */
private URL createSearchURL(URL url) throws MalformedURLException {
  if (url == null) {
    return url;
  }
  String protocol = url.getProtocol();
  if (isDirectory(url) || protocol.equals("jar")) {
    return url;
  }
  if (factory == null) {
    return new URL("jar", "",
        -1, url.toString() + "!/");
  }
  // use jar protocol as the stream handler protocol
  return new URL("jar", "",
      -1, url.toString() + "!/",
      factory.createURLStreamHandler("jar"));
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Returns an URL that will be checked if it contains the class or resource.
 * If the file component of the URL is not a directory, a Jar URL will be
 * created.
 *
 * @return java.net.URL a test URL
 */
private URL createSearchURL(URL url) throws MalformedURLException {
  if (url == null) {
    return url;
  }
  String protocol = url.getProtocol();
  if (isDirectory(url) || protocol.equals("jar")) {
    return url;
  }
  if (factory == null) {
    return new URL("jar", "",
        -1, url.toString() + "!/");
  }
  // use jar protocol as the stream handler protocol
  return new URL("jar", "",
      -1, url.toString() + "!/",
      factory.createURLStreamHandler("jar"));
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Returns an URL that will be checked if it contains the class or resource.
 * If the file component of the URL is not a directory, a Jar URL will be
 * created.
 *
 * @return java.net.URL a test URL
 */
private URL createSearchURL(URL url) throws MalformedURLException {
  if (url == null) {
    return url;
  }
  String protocol = url.getProtocol();
  if (isDirectory(url) || protocol.equals("jar")) {
    return url;
  }
  if (factory == null) {
    return new URL("jar", "",
        -1, url.toString() + "!/");
  }
  // use jar protocol as the stream handler protocol
  return new URL("jar", "",
      -1, url.toString() + "!/",
      factory.createURLStreamHandler("jar"));
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Returns an URL that will be checked if it contains the class or resource.
 * If the file component of the URL is not a directory, a Jar URL will be
 * created.
 *
 * @return java.net.URL a test URL
 */
private URL createSearchURL(URL url) throws MalformedURLException {
  if (url == null) {
    return url;
  }
  String protocol = url.getProtocol();
  if (isDirectory(url) || protocol.equals("jar")) {
    return url;
  }
  if (factory == null) {
    return new URL("jar", "",
        -1, url.toString() + "!/");
  }
  // use jar protocol as the stream handler protocol
  return new URL("jar", "",
      -1, url.toString() + "!/",
      factory.createURLStreamHandler("jar"));
}

代码示例来源:origin: ibinti/bugvm

path = path.replace('/', File.separatorChar);
if (isDirectory(u)) {
  pc.add(new FilePermission(path + "-", "read"));
} else {

代码示例来源:origin: MobiVM/robovm

path = path.replace('/', File.separatorChar);
if (isDirectory(u)) {
  pc.add(new FilePermission(path + "-", "read"));
} else {

代码示例来源:origin: com.bugvm/bugvm-rt

path = path.replace('/', File.separatorChar);
if (isDirectory(u)) {
  pc.add(new FilePermission(path + "-", "read"));
} else {

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

path = path.replace('/', File.separatorChar);
if (isDirectory(u)) {
  pc.add(new FilePermission(path + "-", "read"));
} else {

代码示例来源:origin: com.gluonhq/robovm-rt

path = path.replace('/', File.separatorChar);
if (isDirectory(u)) {
  pc.add(new FilePermission(path + "-", "read"));
} else {

代码示例来源:origin: FlexoVM/flexovm

path = path.replace('/', File.separatorChar);
if (isDirectory(u)) {
  pc.add(new FilePermission(path + "-", "read"));
} else {

相关文章