public static URI toUri( String filePathOrUrl ) {
    URI uri;
    if ( filePathOrUrl.startsWith( "/" ) ) {
      return new File( filePathOrUrl ).toURI();
    }
    try {
      uri = new URI( filePathOrUrl );
    } catch ( URISyntaxException e ) {
      uri = new File( filePathOrUrl ).toURI();
    }
    return uri;
  }
@Test
  public void testToUri() {
    if ( Const.getOS().startsWith("Windows") ) {
      assertEquals( "file:/c:/tmp/file", StringUtil.toUri( "c:\\tmp\\file" ).toString() );
      assertEquals( "file:/D:/tmp/file", StringUtil.toUri( "D:\\tmp\\file" ).toString() );
      assertEquals( "file:/C:/tmp/file", StringUtil.toUri( "/tmp/file").toString() );
    } else {
      assertEquals( "file:/tmp/file", StringUtil.toUri( "/tmp/file").toString() );
    }
    assertEquals( "hc://cluster/user/file", StringUtil.toUri( "hc://cluster/user/file" ).toString() );
    assertEquals( "pvfs://pvfsconn/user/file", StringUtil.toUri( "pvfs://pvfsconn/user/file" ).toString() );
  }