artisynth.core.util
Class TextFromFile

java.lang.Object
  extended by artisynth.core.util.TextFromFile

public class TextFromFile
extends java.lang.Object

Reads text in from a file an returns it as a String.


Constructor Summary
TextFromFile()
           
 
Method Summary
static java.lang.String getTextOrError(java.io.File file)
          Reads the contents of a file and returns them as a String.
static java.lang.String getTextOrError(java.net.URL url)
          Reads the contents of a URL and returns them as a String.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextFromFile

public TextFromFile()
Method Detail

getTextOrError

public static java.lang.String getTextOrError(java.io.File file)
Reads the contents of a file and returns them as a String. If an error occurs, an error message is returned instead.

Parameters:
file - File from which to read the text
Returns:
text string

getTextOrError

public static java.lang.String getTextOrError(java.net.URL url)
Reads the contents of a URL and returns them as a String. If an error occurs, an error message is returned instead.

Parameters:
url - Url from which to read the text
Returns:
text string