org.rythmengine.utils
Class IO

java.lang.Object
  extended by org.rythmengine.utils.IO

public class IO
extends Object

IO utilities


Constructor Summary
IO()
           
 
Method Summary
static String readContentAsString(File file)
          Read file content to a String (always use utf-8)
static String readContentAsString(File file, String encoding)
          Read file content to a String
static String readContentAsString(InputStream is)
           
static String readContentAsString(InputStream is, String encoding)
           
static String readContentAsString(URL url)
          Read file content to a String (always use utf-8)
static String readContentAsString(URL url, String encoding)
          Read file content to a String
static void writeContent(CharSequence content, File file)
          Write String content to a file (always use utf-8)
static void writeContent(CharSequence content, File file, String encoding)
          Write String content to a file (always use utf-8)
static void writeContent(CharSequence content, Writer writer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IO

public IO()
Method Detail

readContentAsString

public static String readContentAsString(File file)
Read file content to a String (always use utf-8)

Parameters:
file - The file to read
Returns:
The String content

readContentAsString

public static String readContentAsString(URL url,
                                         String encoding)
Read file content to a String

Parameters:
url - The url resource to read
Returns:
The String content

readContentAsString

public static String readContentAsString(URL url)
Read file content to a String (always use utf-8)

Parameters:
url - the url resource to read
Returns:
The String content

readContentAsString

public static String readContentAsString(File file,
                                         String encoding)
Read file content to a String

Parameters:
file - The file to read
Returns:
The String content

readContentAsString

public static String readContentAsString(InputStream is)

readContentAsString

public static String readContentAsString(InputStream is,
                                         String encoding)

writeContent

public static void writeContent(CharSequence content,
                                File file)
Write String content to a file (always use utf-8)

Parameters:
content - The content to write
file - The file to write

writeContent

public static void writeContent(CharSequence content,
                                File file,
                                String encoding)
Write String content to a file (always use utf-8)

Parameters:
content - The content to write
file - The file to write

writeContent

public static void writeContent(CharSequence content,
                                Writer writer)


Copyright © 2013. All Rights Reserved.