net.sf.okapi.common.Util.toURI()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(233)

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

Util.toURI介绍

[英]Creates a new URI object from a path or a URI string.
[中]从路径或URI字符串创建新的URI对象。

代码示例

代码示例来源:origin: net.sf.okapi/okapi-core

  1. /**
  2. * Creates a new URL object from a path or a URI string. This is a
  3. * convenience wrapper to catch the various conversion exceptions.
  4. *
  5. * @param pathOrUri
  6. * the path or URI string to use.
  7. * @return the new URI object for the given path or URI string.
  8. */
  9. static public URL toURL(String pathOrUri) {
  10. return URItoURL(toURI(pathOrUri));
  11. }

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-idml

  1. /**
  2. * Opens an input stream for filtering
  3. *
  4. * @param input an input stream to open and filter
  5. */
  6. void open(InputStream input) {
  7. // Create a temp file for the stream content
  8. tempFile = FileUtil.createTempFile("~okapi-23_IDMLFilter_");
  9. StreamUtil.copy(input, tempFile);
  10. open(toURI(tempFile.getAbsolutePath()));
  11. }

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-openxml

  1. /**
  2. * Opens an input stream for filtering
  3. * @param input an input stream to open and filter
  4. */
  5. public void open (InputStream input) {
  6. // // Not supported for this filter
  7. // throw new UnsupportedOperationException(
  8. // "Method is not supported for this filter.");\
  9. // Create a temp file for the stream content
  10. tempFile = FileUtil.createTempFile("~okapi-23_OpenXMLFilter_");
  11. StreamUtil.copy(input, tempFile);
  12. open(Util.toURI(tempFile.getAbsolutePath()));
  13. }

代码示例来源:origin: net.sf.okapi.lib/okapi-lib-segmentation

  1. String pathOrURL = (String) input;
  2. File srxFile = new File(Util.toURI(pathOrURL));
  3. if (!srxFile.exists())
  4. throw new OkapiException("SRX file not found");

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-icml

  1. docURI = Util.toURI(tempFile.getAbsolutePath());

相关文章