File file = new File(path);
if(append && !file.exists())
throw new ResourceNotFound();
FileOutputStream fos = null;
try{
fos = new FileOutputStream(path,append);
if(isBase64)
{
new BASE64Decoder().decodeBuffer(is, fos);
}else{
byte[] b = new byte[BUFFER_SIZE];
int len = -1;
while( (len = is.read(b) ) > 0)
{
fos.write(b, 0, len);
}
}
success = true;
}catch(FileNotFoundException e)
{
throw new ResourceNotFound();
}catch(IOException e)
{
throw new ResourceAccessFailed();
}finally
{