org.ops4j.pax.construct.util
Class StreamFactory

java.lang.Object
  extended by org.ops4j.pax.construct.util.StreamFactory

public final class StreamFactory
extends java.lang.Object

Various utility methods for getting the right kind of stream


Method Summary
static java.lang.String getXmlEncoding(java.io.File xmlFile)
           
static java.io.Reader newPlatformReader(java.io.File file)
           
static java.io.Writer newPlatformWriter(java.io.File file)
           
static java.io.Reader newXmlReader(java.io.File xmlFile)
           
static java.io.Writer newXmlWriter(java.io.File xmlFile)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newPlatformReader

public static java.io.Reader newPlatformReader(java.io.File file)
                                        throws java.io.IOException
Parameters:
file - file to be read
Returns:
reader with default platform encoding
Throws:
java.io.IOException

newPlatformWriter

public static java.io.Writer newPlatformWriter(java.io.File file)
                                        throws java.io.IOException
Parameters:
file - file to be written
Returns:
writer with default platform encoding
Throws:
java.io.IOException

newXmlReader

public static java.io.Reader newXmlReader(java.io.File xmlFile)
                                   throws java.io.IOException
Parameters:
xmlFile - XML file to be read
Returns:
reader with correct XML encoding
Throws:
java.io.IOException

newXmlWriter

public static java.io.Writer newXmlWriter(java.io.File xmlFile)
                                   throws java.io.IOException
Parameters:
xmlFile - XML file to be written
Returns:
writer with correct XML encoding
Throws:
java.io.IOException

getXmlEncoding

public static java.lang.String getXmlEncoding(java.io.File xmlFile)
Parameters:
xmlFile - XML file
Returns:
current XML encoding if the file exists, otherwise the current platform encoding


Copyright © 2007-2008 OPS4J. All Rights Reserved.