org.objectweb.jorm.util.io.lib
Class DirJavaExplorer

java.lang.Object
  extended byorg.objectweb.jorm.util.io.lib.DirJavaExplorer
All Implemented Interfaces:
Loggable, PathExplorer

public class DirJavaExplorer
extends java.lang.Object
implements PathExplorer, Loggable

DirJavaExplorer defines methods to create object able to manage a list of paths and furnish input and output stream on files


Constructor Summary
DirJavaExplorer()
          Builds a new DirJavaExplorer.
 
Method Summary
 void addPath(java.util.Collection path)
          Creates the paths with the given path.
 void addPath(java.lang.String cpath)
          Adds a classpath and its path separator to the current explorer.
 java.lang.String getClassPath()
           
 java.io.InputStream getInputStream(java.lang.String file)
          Gets an input stream from a given file.
 Logger getLogger()
          Returns a logger to an component that wants to log things.
 LoggerFactory getLoggerFactory()
          Returns a logger factory that allows the creation of new loggers.
 java.io.OutputStream getOutputStream(java.lang.String file)
          Gets an output stream from a given file.
 void setLogger(Logger logger)
          Assigns a logger to an component that wants to log things.
 void setLoggerFactory(LoggerFactory loggerfactory)
          Assigns a logger factory that allows the creation of new loggers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirJavaExplorer

public DirJavaExplorer()
Builds a new DirJavaExplorer.

Method Detail

setLogger

public void setLogger(Logger logger)
Description copied from interface: Loggable
Assigns a logger to an component that wants to log things.

Specified by:
setLogger in interface Loggable
Parameters:
logger - the logger object

getLogger

public Logger getLogger()
Returns a logger to an component that wants to log things.

Specified by:
getLogger in interface Loggable

getLoggerFactory

public LoggerFactory getLoggerFactory()
Returns a logger factory that allows the creation of new loggers.

Specified by:
getLoggerFactory in interface Loggable

setLoggerFactory

public void setLoggerFactory(LoggerFactory loggerfactory)
Assigns a logger factory that allows the creation of new loggers.

Specified by:
setLoggerFactory in interface Loggable
Parameters:
loggerfactory - the LoggerFactory object to obtain new loggers

addPath

public void addPath(java.lang.String cpath)
Adds a classpath and its path separator to the current explorer. This classpath is added to the list of path already defines.

Specified by:
addPath in interface PathExplorer
Parameters:
cpath - the classpath which contains a list of paths

addPath

public void addPath(java.util.Collection path)
Creates the paths with the given path.

Specified by:
addPath in interface PathExplorer
Parameters:
path - the vector of paths (which are String)

getInputStream

public java.io.InputStream getInputStream(java.lang.String file)
Gets an input stream from a given file. This file is opened from the defined path.

Specified by:
getInputStream in interface PathExplorer
Parameters:
file - the string representation of the name of the file
Returns:
an InputStream for the given file

getOutputStream

public java.io.OutputStream getOutputStream(java.lang.String file)
Gets an output stream from a given file. This file is opened from the defined path.

Specified by:
getOutputStream in interface PathExplorer
Parameters:
file - the string representation of the name of the file
Returns:
an OutputStream for the given file

getClassPath

public java.lang.String getClassPath()
Specified by:
getClassPath in interface PathExplorer