当前位置: 首页>>代码示例>>Java>>正文


Java CharsetToolkit.UTF8属性代码示例

本文整理汇总了Java中com.intellij.openapi.vfs.CharsetToolkit.UTF8属性的典型用法代码示例。如果您正苦于以下问题:Java CharsetToolkit.UTF8属性的具体用法?Java CharsetToolkit.UTF8怎么用?Java CharsetToolkit.UTF8使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.intellij.openapi.vfs.CharsetToolkit的用法示例。


在下文中一共展示了CharsetToolkit.UTF8属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadClassNames

private static List<String> loadClassNames(URL url) throws IOException {
  List<String> result = new ArrayList<String>();
  BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream(), CharsetToolkit.UTF8));
  try {
    String line;
    while ((line = in.readLine()) != null) {
      int i = line.indexOf('#');
      if (i >= 0) line = line.substring(0, i);
      line = line.trim();
      if (!line.isEmpty()) {
        result.add(line);
      }
    }
  }
  finally {
    in.close();
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:JpsIdePluginManagerImpl.java

示例2: writeClassesPerModule

protected void writeClassesPerModule(String packageName, JavaParameters javaParameters, Map<Module, List<String>> perModule)
  throws FileNotFoundException, UnsupportedEncodingException, CantRunException {
  if (perModule != null && perModule.size() > 1) {
    final String classpath = getScope() == TestSearchScope.WHOLE_PROJECT
                             ? null : javaParameters.getClassPath().getPathsString();

    final PrintWriter wWriter = new PrintWriter(myWorkingDirsFile, CharsetToolkit.UTF8);
    try {
      wWriter.println(packageName);
      for (Module module : perModule.keySet()) {
        wWriter.println(PathMacroUtil.getModuleDir(module.getModuleFilePath()));
        wWriter.println(module.getName());

        if (classpath == null) {
          final JavaParameters parameters = new JavaParameters();
          parameters.getClassPath().add(JavaSdkUtil.getIdeaRtJarPath());
          configureRTClasspath(parameters);
          JavaParametersUtil.configureModule(module, parameters, JavaParameters.JDK_AND_CLASSES_AND_TESTS,
                                             getConfiguration().isAlternativeJrePathEnabled() ? getConfiguration()
                                               .getAlternativeJrePath() : null);
          wWriter.println(parameters.getClassPath().getPathsString());
        }
        else {
          wWriter.println(classpath);
        }

        final List<String> classNames = perModule.get(module);
        wWriter.println(classNames.size());
        for (String className : classNames) {
          wWriter.println(className);
        }
      }
    }
    finally {
      wWriter.close();
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:38,代码来源:JavaTestFrameworkRunnableState.java

示例3: getCharset

@Override
public String getCharset(@NotNull VirtualFile file, @NotNull byte[] content) {
  if (CharsetToolkit.hasUTF8Bom(content)) {
    return CharsetToolkit.UTF8;
  }
  ByteBuffer bytes = ByteBuffer.wrap(content, 0, Math.min(256, content.length));
  String decoded = CharsetToolkit.UTF8_CHARSET.decode(bytes).toString();
  return getCharsetFromEncodingDeclaration(StringUtil.convertLineSeparators(decoded));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:PythonFileType.java

示例4: createJsonEntity

protected static RequestEntity createJsonEntity(String requestBody) {
  try {
    return new StringRequestEntity(requestBody, "application/json", CharsetToolkit.UTF8);
  }
  catch (UnsupportedEncodingException e) {
    throw new AssertionError("UTF-8 encoding is not supported");
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:JiraRestApi.java

示例5: output

public static void output(@NotNull Element element, @NotNull File file, @NotNull Project project) throws IOException {
  Writer writer = new OutputStreamWriter(new FileOutputStream(file), CharsetToolkit.UTF8);
  try {
    output(element, writer, project);
  }
  finally {
    writer.close();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:EclipseJDOMUtil.java

示例6: toString

/**
 * Return a string listing of the settings for this
 * XMLOutputter instance.
 *
 * @return a string listing the settings for this XMLOutputter instance
 */
public String toString() {
    StringBuffer buffer = new StringBuffer();
    for (int i = 0; i < userFormat.lineSeparator.length(); i++) {
        char ch = userFormat.lineSeparator.charAt(i);
        switch (ch) {
        case '\r': buffer.append("\\r");
                   break;
        case '\n': buffer.append("\\n");
                   break;
        case '\t': buffer.append("\\t");
                   break;
        default:   buffer.append("[" + ((int)ch) + "]");
                   break;
        }
    }

    return (
        "XMLOutputter[omitDeclaration = " + false + ", " +
        "encoding = " + CharsetToolkit.UTF8 + ", " +
        "omitEncoding = " + false + ", " +
        "indent = '" + "\t" + "'" + ", " +
        "expandEmptyElements = " + userFormat.expandEmptyElements + ", " +
        "lineSeparator = '" + buffer.toString() + "', " +
        "textMode = " + userFormat.mode + "]"
    );
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:EclipseXMLOutputter.java

示例7: getCommitEncoding

/**
 * Get commit encoding for the specified root
 *
 * @param project the context project
 * @param root    the project root
 * @return the commit encoding or UTF-8 if the encoding is note explicitly specified
 */
public static String getCommitEncoding(final Project project, VirtualFile root) {
  @NonNls String encoding = null;
  try {
    encoding = getValue(project, root, "i18n.commitencoding");
  }
  catch (VcsException e) {
    // ignore exception
  }
  if (encoding == null || encoding.length() == 0) {
    encoding = CharsetToolkit.UTF8;
  }
  return encoding;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:GitConfigUtil.java

示例8: getCharset

@Override
public String getCharset(@NotNull VirtualFile file, byte[] content) {
    return CharsetToolkit.UTF8;
}
 
开发者ID:datathings,项目名称:greycat-idea-plugin,代码行数:4,代码来源:GCMLanguageType.java

示例9: getCharset

@Nullable
@Override
public String getCharset(@NotNull VirtualFile file, @NotNull byte[] content) {
    return CharsetToolkit.UTF8;
}
 
开发者ID:Blenta,项目名称:intellij-bpmn-editor,代码行数:5,代码来源:BPMNFileType.java

示例10: compute

@Override
public PsiFile compute() throws IOException {
    String pdeContents = new String(FileUtil.loadBytes(pdeFile.getInputStream()), CharsetToolkit.UTF8);

    return PsiFileFactory.getInstance(project).createFileFromText(pdeFile.getNameWithoutExtension(), JavaFileType.INSTANCE, pdeContents);
}
 
开发者ID:mistodev,项目名称:processing-idea,代码行数:6,代码来源:PdeConverter.java

示例11: getCharset

@Override
public String getCharset(@org.jetbrains.annotations.NotNull VirtualFile file, @org.jetbrains.annotations.NotNull byte[] content) {
    return CharsetToolkit.UTF8;
}
 
开发者ID:scireum-incubator,项目名称:rythm_plugin,代码行数:4,代码来源:RythmFileType.java

示例12: getCharset

@Override
public String getCharset(@NotNull VirtualFile file, @NotNull byte[] content) {
    return CharsetToolkit.UTF8;
}
 
开发者ID:jhsx,项目名称:GoJetPlugin,代码行数:4,代码来源:JetFileType.java

示例13: getCharset

@Nullable
@Override
public String getCharset(@NotNull VirtualFile file, @NotNull byte[] content) {
  return CharsetToolkit.UTF8;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:SPIFileType.java

示例14: getCharset

@Override
public String getCharset(@NotNull VirtualFile file, @NotNull final byte[] content) {
  return CharsetToolkit.UTF8;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ModuleFileType.java

示例15: getCharset

@Override
public String getCharset(@NotNull VirtualFile file, @NotNull byte[] content) {
  return CharsetToolkit.UTF8;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:UiScriptFileType.java


注:本文中的com.intellij.openapi.vfs.CharsetToolkit.UTF8属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。