java获取工程目录下文件

	static{
		String root = Constants.class.getResource("/").getFile();
		try {
			root = new File(root).getCanonicalPath();
			root += File.separator;
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
		file_url = root;
	}

你可能感兴趣的:(java,String,File,url)