本文整理汇总了Python中java.lang.ClassLoader.getSystemResourceAsStream方法的典型用法代码示例。如果您正苦于以下问题:Python ClassLoader.getSystemResourceAsStream方法的具体用法?Python ClassLoader.getSystemResourceAsStream怎么用?Python ClassLoader.getSystemResourceAsStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.lang.ClassLoader
的用法示例。
在下文中一共展示了ClassLoader.getSystemResourceAsStream方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: archive_read
# 需要导入模块: from java.lang import ClassLoader [as 别名]
# 或者: from java.lang.ClassLoader import getSystemResourceAsStream [as 别名]
def archive_read(archive, path):
from java.lang import ClassLoader
from java.io import InputStreamReader, BufferedReader
# --- make sure this works from within .jar files and such
stream = ClassLoader.getSystemResourceAsStream(path)
reader = BufferedReader(InputStreamReader(stream))
archive.addAll(reader)
示例2: resolveEntity
# 需要导入模块: from java.lang import ClassLoader [as 别名]
# 或者: from java.lang.ClassLoader import getSystemResourceAsStream [as 别名]
def resolveEntity(self, publicId, systemId):
return InputSource(ClassLoader.getSystemResourceAsStream("dtds/" + os.path.split(systemId)[1]))
示例3: file
# 需要导入模块: from java.lang import ClassLoader [as 别名]
# 或者: from java.lang.ClassLoader import getSystemResourceAsStream [as 别名]
from java.lang import ClassLoader
from java.io import InputStreamReader, BufferedReader
# --- Gavrog stuff
from org.gavrog.joss.geometry import SpaceGroupFinder, CrystalSystem
from org.gavrog.joss.pgraphs.io import Net
from org.gavrog.joss.pgraphs.io import Archive
# ============================================================
# Prepare for RCSR lookup
# ============================================================
# --- get RCSR archive file (possibly from a .jar or the web)
rcsr_path = "org/gavrog/apps/systre/rcsr.arc"
rcsr_stream = ClassLoader.getSystemResourceAsStream(rcsr_path)
reader = BufferedReader(InputStreamReader(rcsr_stream))
# --- create an archive object from it
archive = Archive("1.0")
archive.addAll(reader)
# ============================================================
# Main data processing
# ============================================================
# --- dictionary of seen nets
seen = {}
# --- count the nets that we read