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

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

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

/**
 * Creates a new URL object from a path or a URI string.  This is a
 * convenience wrapper to catch the various conversion exceptions.
 * 
 * @param pathOrUri
 *            the path or URI string to use.
 * @return the new URI object for the given path or URI string.
 */
static public URL toURL(String pathOrUri) {
  return URItoURL(toURI(pathOrUri));
}

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

/**
 * Opens an input stream for filtering
 *
 * @param input an input stream to open and filter
 */
void open(InputStream input) {
  // Create a temp file for the stream content
  tempFile = FileUtil.createTempFile("~okapi-23_IDMLFilter_");
  StreamUtil.copy(input, tempFile);
  open(toURI(tempFile.getAbsolutePath()));
}

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

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

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

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

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

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

相关文章