* @throws IOException
*/
protected static OutputStream writeFile(String filename) throws IOException
{
filename = transform(filename);
final FileSystem fs = getFileSystem(filename);
if (fs == null)
throw new FileNotFoundException("No file system for "+filename);
if ((fs.capabilities() & FSCapability.WRITE) == 0)
throw new IOException("File system not supporting writes for "+ filename);
OutputStream rtr = fs.writeFileStream(filename);
for(Pattern regex : outputStreamMap.keySet())
{
if (regex.matcher(filename).matches())
{
Class<? extends OutputStream> filterClass = outputStreamMap.get(regex);