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

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

本文整理了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

public static void main(String[] args) throws Exception {
  String filename = args[0];
  int line = Integer.valueOf(args[1]);
  int col = Integer.valueOf(args[2]);

  SourceMapping consumer = SourceMapConsumerFactory.parse(Util.readFileAsString(new File(filename)));
  System.out.println(consumer.getMappingForLine(line, col));
 }
}

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

static SourceMap load(File file) {
 String sourceMapJson = Util.readFileAsString(file);
 JsonObject json;
 try {
  json = JsonObject.parse(new StringReader(sourceMapJson));
 } catch (JsonException e) {
  throw new RuntimeException("can't parse sourcemap as json", e);
 } catch (IOException e) {
  throw new RuntimeException("can't parse sourcemap as json", e);
 }
 return new SourceMap(json);
}

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

static SourceMap load(File file) {
 String sourceMapJson = Util.readFileAsString(file);
 JsonObject json;
 try {
  json = JsonObject.parse(new StringReader(sourceMapJson));
 } catch (JsonException e) {
  throw new RuntimeException("can't parse sourcemap as json", e);
 } catch (IOException e) {
  throw new RuntimeException("can't parse sourcemap as json", e);
 }
 return new SourceMap(json);
}

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

public static void main(String[] args) throws Exception {
  String filename = args[0];
  int line = Integer.valueOf(args[1]);
  int col = Integer.valueOf(args[2]);

  SourceMapping consumer = SourceMapConsumerFactory.parse(Util.readFileAsString(new File(filename)));
  System.out.println(consumer.getMappingForLine(line, col));
 }
}

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

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

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

/**
 * Reads a source map from disk and parses it into an in-memory representation.
 * If it can't be loaded, logs a warning and returns an empty source map.
 */
static ReverseSourceMap load(TreeLogger logger, File sourceMapFile) {
 SourceMapConsumerV3 consumer = new SourceMapConsumerV3();
 String unparsed = Util.readFileAsString(sourceMapFile);
 try {
  consumer.parse(unparsed);
  return new ReverseSourceMap(consumer);
 } catch (SourceMapParseException e) {
  logger.log(TreeLogger.WARN, "can't parse source map", e);
  return new ReverseSourceMap(null);
 }
}

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

/**
 * Reads a source map from disk and parses it into an in-memory representation.
 * If it can't be loaded, logs a warning and returns an empty source map.
 */
static ReverseSourceMap load(TreeLogger logger, File sourceMapFile) {
 SourceMapConsumerV3 consumer = new SourceMapConsumerV3();
 String unparsed = Util.readFileAsString(sourceMapFile);
 try {
  consumer.parse(unparsed);
  return new ReverseSourceMap(consumer);
 } catch (SourceMapParseException e) {
  logger.log(TreeLogger.WARN, "can't parse source map", e);
  return new ReverseSourceMap(null);
 }
}

相关文章