import re from collections import OrderedDict from django.conf import settings from django.utils.module_loading import import_string # for django 1.0 # from django.urls import RegexURLResolver, RegexURLPattern # for django 2.0 from django.urls.resolv
// 第一种: 2 File f = new File(this.getClass().getResource("/").getPath()); // 结果: /Users/admin/Documents/IdeaProjects/Demo/out/production/Demo System.out.println(f); f = new File(this.getClass().getResource("").getPath()); // 多返回了包名 // 结