public static Uri fromFile(File file){
  if (file == null) {
    throw new NullPointerException("file");
  }
  PathPart path=PathPart.fromDecoded(file.getAbsolutePath());
  return new HierarchicalUri("file",Part.EMPTY,path,Part.NULL,Part.NULL);
}

public static Uri fromFile ( File file ) { if ( file == null ) { throw new NullPointerException ( "file" ) ; } PathPart path = PathPart . fromDecoded ( file . getAbsolutePath ( ) ) ; return new HierarchicalUri ( "file" , Part . EMPTY , path , Part . NULL , Part . NULL ) ; }
creates a uri from a file . the uri has the form " file : / / < absolute path > " . encodes path characters with the exception of ' / ' . < p > example : " file : / / / tmp / android . txt "
