Package org.tentackle.buildsupport
Class ResourceManager
- java.lang.Object
-
- org.tentackle.buildsupport.ResourceManager
-
public class ResourceManager extends java.lang.ObjectA manager for resources.- Author:
- harald
-
-
Constructor Summary
Constructors Constructor Description ResourceManager(java.io.File location)Creates a resource manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes all resources.booleanexists(java.lang.String name)Returns whether given resource file exists.java.io.FilegetLocation()Gets the resource location.java.io.ReadergetReader(java.lang.String name)Gets the reader.java.util.Set<java.lang.String>getResourceNames()Gets the resource names.java.io.PrintWritergetWriter(java.lang.String name)Gets the writer.
-
-
-
Method Detail
-
getResourceNames
public java.util.Set<java.lang.String> getResourceNames()
Gets the resource names.- Returns:
- the names, never null
-
getLocation
public java.io.File getLocation()
Gets the resource location.- Returns:
- the location
-
getWriter
public java.io.PrintWriter getWriter(java.lang.String name) throws java.io.IOExceptionGets the writer.- Parameters:
name- the writer's name- Returns:
- the writer
- Throws:
java.io.IOException- if writer could not be created
-
getReader
public java.io.Reader getReader(java.lang.String name) throws java.io.IOExceptionGets the reader.- Parameters:
name- the reader's name- Returns:
- the reader
- Throws:
java.io.IOException- if reader could not be created
-
exists
public boolean exists(java.lang.String name)
Returns whether given resource file exists.- Parameters:
name- the file;s name- Returns:
- true if exists
-
close
public void close() throws java.io.IOExceptionCloses all resources.- Throws:
java.io.IOException- if closing a resource failed
-
-