com.google.gwt.dev.util.Util.readFileAsString()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(198)

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

Util.readFileAsString介绍

暂无

代码示例

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. public static void main(String[] args) throws Exception {
  2. String filename = args[0];
  3. int line = Integer.valueOf(args[1]);
  4. int col = Integer.valueOf(args[2]);
  5. SourceMapping consumer = SourceMapConsumerFactory.parse(Util.readFileAsString(new File(filename)));
  6. System.out.println(consumer.getMappingForLine(line, col));
  7. }
  8. }

代码示例来源:origin: com.google.gwt/gwt-codeserver

  1. static SourceMap load(File file) {
  2. String sourceMapJson = Util.readFileAsString(file);
  3. JsonObject json;
  4. try {
  5. json = JsonObject.parse(new StringReader(sourceMapJson));
  6. } catch (JsonException e) {
  7. throw new RuntimeException("can't parse sourcemap as json", e);
  8. } catch (IOException e) {
  9. throw new RuntimeException("can't parse sourcemap as json", e);
  10. }
  11. return new SourceMap(json);
  12. }

代码示例来源:origin: net.wetheinter/gwt-codeserver

  1. static SourceMap load(File file) {
  2. String sourceMapJson = Util.readFileAsString(file);
  3. JsonObject json;
  4. try {
  5. json = JsonObject.parse(new StringReader(sourceMapJson));
  6. } catch (JsonException e) {
  7. throw new RuntimeException("can't parse sourcemap as json", e);
  8. } catch (IOException e) {
  9. throw new RuntimeException("can't parse sourcemap as json", e);
  10. }
  11. return new SourceMap(json);
  12. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. public static void main(String[] args) throws Exception {
  2. String filename = args[0];
  3. int line = Integer.valueOf(args[1]);
  4. int col = Integer.valueOf(args[2]);
  5. SourceMapping consumer = SourceMapConsumerFactory.parse(Util.readFileAsString(new File(filename)));
  6. System.out.println(consumer.getMappingForLine(line, col));
  7. }
  8. }

代码示例来源:origin: org.jboss.errai/errai-cdi-jetty

  1. keyStorePassword = Util.readFileAsString(new File(value)).trim();
  2. if (keyStorePassword == null) {
  3. logger.log(TreeLogger.ERROR,

代码示例来源:origin: com.google.gwt/gwt-codeserver

  1. /**
  2. * Reads a source map from disk and parses it into an in-memory representation.
  3. * If it can't be loaded, logs a warning and returns an empty source map.
  4. */
  5. static ReverseSourceMap load(TreeLogger logger, File sourceMapFile) {
  6. SourceMapConsumerV3 consumer = new SourceMapConsumerV3();
  7. String unparsed = Util.readFileAsString(sourceMapFile);
  8. try {
  9. consumer.parse(unparsed);
  10. return new ReverseSourceMap(consumer);
  11. } catch (SourceMapParseException e) {
  12. logger.log(TreeLogger.WARN, "can't parse source map", e);
  13. return new ReverseSourceMap(null);
  14. }
  15. }

代码示例来源:origin: net.wetheinter/gwt-codeserver

  1. /**
  2. * Reads a source map from disk and parses it into an in-memory representation.
  3. * If it can't be loaded, logs a warning and returns an empty source map.
  4. */
  5. static ReverseSourceMap load(TreeLogger logger, File sourceMapFile) {
  6. SourceMapConsumerV3 consumer = new SourceMapConsumerV3();
  7. String unparsed = Util.readFileAsString(sourceMapFile);
  8. try {
  9. consumer.parse(unparsed);
  10. return new ReverseSourceMap(consumer);
  11. } catch (SourceMapParseException e) {
  12. logger.log(TreeLogger.WARN, "can't parse source map", e);
  13. return new ReverseSourceMap(null);
  14. }
  15. }

相关文章