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

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

本文整理了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

  1. /**
  2. * Returns an URL that will be checked if it contains the class or resource.
  3. * If the file component of the URL is not a directory, a Jar URL will be
  4. * created.
  5. *
  6. * @return java.net.URL a test URL
  7. */
  8. private URL createSearchURL(URL url) throws MalformedURLException {
  9. if (url == null) {
  10. return url;
  11. }
  12. String protocol = url.getProtocol();
  13. if (isDirectory(url) || protocol.equals("jar")) {
  14. return url;
  15. }
  16. if (factory == null) {
  17. return new URL("jar", "",
  18. -1, url.toString() + "!/");
  19. }
  20. // use jar protocol as the stream handler protocol
  21. return new URL("jar", "",
  22. -1, url.toString() + "!/",
  23. factory.createURLStreamHandler("jar"));
  24. }

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

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

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

  1. /**
  2. * Returns an URL that will be checked if it contains the class or resource.
  3. * If the file component of the URL is not a directory, a Jar URL will be
  4. * created.
  5. *
  6. * @return java.net.URL a test URL
  7. */
  8. private URL createSearchURL(URL url) throws MalformedURLException {
  9. if (url == null) {
  10. return url;
  11. }
  12. String protocol = url.getProtocol();
  13. if (isDirectory(url) || protocol.equals("jar")) {
  14. return url;
  15. }
  16. if (factory == null) {
  17. return new URL("jar", "",
  18. -1, url.toString() + "!/");
  19. }
  20. // use jar protocol as the stream handler protocol
  21. return new URL("jar", "",
  22. -1, url.toString() + "!/",
  23. factory.createURLStreamHandler("jar"));
  24. }

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

  1. /**
  2. * Returns an URL that will be checked if it contains the class or resource.
  3. * If the file component of the URL is not a directory, a Jar URL will be
  4. * created.
  5. *
  6. * @return java.net.URL a test URL
  7. */
  8. private URL createSearchURL(URL url) throws MalformedURLException {
  9. if (url == null) {
  10. return url;
  11. }
  12. String protocol = url.getProtocol();
  13. if (isDirectory(url) || protocol.equals("jar")) {
  14. return url;
  15. }
  16. if (factory == null) {
  17. return new URL("jar", "",
  18. -1, url.toString() + "!/");
  19. }
  20. // use jar protocol as the stream handler protocol
  21. return new URL("jar", "",
  22. -1, url.toString() + "!/",
  23. factory.createURLStreamHandler("jar"));
  24. }

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

  1. /**
  2. * Returns an URL that will be checked if it contains the class or resource.
  3. * If the file component of the URL is not a directory, a Jar URL will be
  4. * created.
  5. *
  6. * @return java.net.URL a test URL
  7. */
  8. private URL createSearchURL(URL url) throws MalformedURLException {
  9. if (url == null) {
  10. return url;
  11. }
  12. String protocol = url.getProtocol();
  13. if (isDirectory(url) || protocol.equals("jar")) {
  14. return url;
  15. }
  16. if (factory == null) {
  17. return new URL("jar", "",
  18. -1, url.toString() + "!/");
  19. }
  20. // use jar protocol as the stream handler protocol
  21. return new URL("jar", "",
  22. -1, url.toString() + "!/",
  23. factory.createURLStreamHandler("jar"));
  24. }

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

  1. /**
  2. * Returns an URL that will be checked if it contains the class or resource.
  3. * If the file component of the URL is not a directory, a Jar URL will be
  4. * created.
  5. *
  6. * @return java.net.URL a test URL
  7. */
  8. private URL createSearchURL(URL url) throws MalformedURLException {
  9. if (url == null) {
  10. return url;
  11. }
  12. String protocol = url.getProtocol();
  13. if (isDirectory(url) || protocol.equals("jar")) {
  14. return url;
  15. }
  16. if (factory == null) {
  17. return new URL("jar", "",
  18. -1, url.toString() + "!/");
  19. }
  20. // use jar protocol as the stream handler protocol
  21. return new URL("jar", "",
  22. -1, url.toString() + "!/",
  23. factory.createURLStreamHandler("jar"));
  24. }

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

  1. /**
  2. * Returns an URL that will be checked if it contains the class or resource.
  3. * If the file component of the URL is not a directory, a Jar URL will be
  4. * created.
  5. *
  6. * @return java.net.URL a test URL
  7. */
  8. private URL createSearchURL(URL url) throws MalformedURLException {
  9. if (url == null) {
  10. return url;
  11. }
  12. String protocol = url.getProtocol();
  13. if (isDirectory(url) || protocol.equals("jar")) {
  14. return url;
  15. }
  16. if (factory == null) {
  17. return new URL("jar", "",
  18. -1, url.toString() + "!/");
  19. }
  20. // use jar protocol as the stream handler protocol
  21. return new URL("jar", "",
  22. -1, url.toString() + "!/",
  23. factory.createURLStreamHandler("jar"));
  24. }

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

  1. /**
  2. * Returns an URL that will be checked if it contains the class or resource.
  3. * If the file component of the URL is not a directory, a Jar URL will be
  4. * created.
  5. *
  6. * @return java.net.URL a test URL
  7. */
  8. private URL createSearchURL(URL url) throws MalformedURLException {
  9. if (url == null) {
  10. return url;
  11. }
  12. String protocol = url.getProtocol();
  13. if (isDirectory(url) || protocol.equals("jar")) {
  14. return url;
  15. }
  16. if (factory == null) {
  17. return new URL("jar", "",
  18. -1, url.toString() + "!/");
  19. }
  20. // use jar protocol as the stream handler protocol
  21. return new URL("jar", "",
  22. -1, url.toString() + "!/",
  23. factory.createURLStreamHandler("jar"));
  24. }

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

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

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

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

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

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

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

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

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

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

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

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

相关文章