* Copyright 2007 - 2008 Zach Scrivena
* TERMS AND CONDITIONS:
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* Perform resource-related operations.
public final class ResourceManipulator
* Private constructor that should never be called.
* Return the contents of the specified resource as a string.
* @param name
* name of the resource
* contents of the resource as a string
* @throws java.io.IOException
* if an I/O error occurs while reading the resource
public static String resourceAsString(
final String name)
final BufferedReader br = new BufferedReader(new InputStreamReader(
final StringBuilder sb = new StringBuilder();
final String s = br.readLine();
if (s == null)
if (sb.length() > 0)