Subversion Repository Public Repository

litesoft

Diff Revisions 948 vs 950 for /trunk/Java/core/Server/src/org/litesoft/util/FileUtil.java

Diff revisions: vs.
  @@ -1,22 +1,22 @@
1 - // This Source Code is in the Public Domain per: http://unlicense.org
2 - package org.litesoft.util;
3 -
4 - import org.litesoft.commonfoundation.typeutils.*;
5 -
6 - import java.io.*;
7 -
8 - public class FileUtil {
9 - public static final String UTF_8 = "UTF-8";
10 -
11 - public static BufferedWriter createWriter( File pFile, boolean pAppend )
12 - throws IOException {
13 - Objects.assertNotNull( "File", pFile );
14 - return new BufferedWriter( new OutputStreamWriter( new FileOutputStream( Directories.insureParent( pFile ), pAppend ), UTF_8 ) );
15 - }
16 -
17 - public static BufferedReader createReader( File pFile )
18 - throws IOException {
19 - Objects.assertNotNull( "File", pFile );
20 - return new BufferedReader( new InputStreamReader( new FileInputStream( pFile ), UTF_8 ) );
21 - }
22 - }
1 + // This Source Code is in the Public Domain per: http://unlicense.org
2 + package org.litesoft.util;
3 +
4 + import org.litesoft.commonfoundation.base.*;
5 +
6 + import java.io.*;
7 +
8 + public class FileUtil {
9 + public static final String UTF_8 = "UTF-8";
10 +
11 + public static BufferedWriter createWriter( File pFile, boolean pAppend )
12 + throws IOException {
13 + Confirm.isNotNull( "File", pFile );
14 + return new BufferedWriter( new OutputStreamWriter( new FileOutputStream( Directories.insureParent( pFile ), pAppend ), UTF_8 ) );
15 + }
16 +
17 + public static BufferedReader createReader( File pFile )
18 + throws IOException {
19 + Confirm.isNotNull( "File", pFile );
20 + return new BufferedReader( new InputStreamReader( new FileInputStream( pFile ), UTF_8 ) );
21 + }
22 + }