/// <summary>
 /// Obtains an instance of <seealso cref="CharSource"/> from a file object, specified as a <seealso cref="File"/>.
 /// This also takes in a specific character set, as a <seealso cref="Charset"/>.
 /// </summary>
 /// <param name="file">  the file object </param>
 /// <param name="charset">  the charset to build the new CharSource based on </param>
 /// <returns>  a new instance of <seealso cref="CharSource"/> </returns>
 public static CharSource ofFile(File file, Charset charset)
 {
     return(Files.asCharSource(file, charset));
 }
 //---------------------------------------------------------------------------------------------
 /// <summary>
 /// Obtains an instance of <seealso cref="CharSource"/> from a file object, specified as a <seealso cref="File"/>.
 /// </summary>
 /// <param name="file">  the file object </param>
 /// <returns>  a new instance of <seealso cref="CharSource"/> with UTF-8 for charset. </returns>
 public static CharSource ofFile(File file)
 {
     return(Files.asCharSource(file, Charsets.UTF_8));
 }
 /// <summary>
 /// Obtains an instance of <seealso cref="CharSource"/> from a file name, specified as a String.
 /// </summary>
 /// <param name="fileName">  the file name, as a String </param>
 /// <returns>  a new instance of <seealso cref="CharSource"/> with UTF-8 for charset. </returns>
 public static CharSource ofFileName(string fileName)
 {
     return(Files.asCharSource(new File(fileName), Charsets.UTF_8));
 }
 /// <summary>
 /// Obtains an instance of <seealso cref="CharSource"/> from a file name, specified as a String.
 /// This also takes in a specific character set, as a <seealso cref="Charset"/>.
 /// </summary>
 /// <param name="fileName">  the file name, as a String </param>
 /// <param name="charset">  the charset to build the new CharSource based on </param>
 /// <returns>  a new instance of <seealso cref="CharSource"/> </returns>
 public static CharSource ofFileName(string fileName, Charset charset)
 {
     return(Files.asCharSource(new File(fileName), charset));
 }
Example #5
0
 public virtual void test_of_ioException()
 {
     assertThrows(() => IniFile.of(Files.asCharSource(new File("src/test/resources"), StandardCharsets.UTF_8)), typeof(UncheckedIOException));
 }