com.intellij.openapi.util.io.FileUtil.loadTextAndClose()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(1.3k)|赞(0)|评价(0)|浏览(158)

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

FileUtil.loadTextAndClose介绍

暂无

代码示例

代码示例来源:origin: KronicDeth/intellij-elixir

  1. @NotNull
  2. @Override
  3. public String getDemoText() {
  4. InputStream demoTextInputStream = getClass().getResourceAsStream("/Color Settings Page Demo Text.ex");
  5. String demoText;
  6. try {
  7. demoText = loadTextAndClose(demoTextInputStream);
  8. } catch (IOException e) {
  9. demoText = "";
  10. }
  11. return demoText;
  12. }

代码示例来源:origin: JetBrains/Grammar-Kit

  1. public String getDescription() {
  2. try {
  3. InputStream resourceAsStream = getClass().getResourceAsStream("/messages/attributeDescriptions/" + getName() + ".html");
  4. return resourceAsStream == null? null : FileUtil.loadTextAndClose(resourceAsStream);
  5. }
  6. catch (IOException e) {
  7. return null;
  8. }
  9. }

代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij

  1. private PsiClass getPsiClassForTest() throws IOException {
  2. String path =
  3. getTestDataPath()
  4. + "implicitUsageProviders/endpointImplicitUsageProvider/"
  5. + getTestName(false)
  6. + ".java";
  7. String classText = FileUtil.loadTextAndClose(new FileInputStream(path));
  8. return myFixture.addClass(classText);
  9. }
  10. }

相关文章