code: private void actionWrite() throws PageException {
  	if (output == null) throw new ApplicationException("attribute output is not defined for tag file");
  	checkFile(pageContext, securityManager, file, serverPassword, createPath, true, false, true);
  	if (file.exists()) {
  	    // Error
  	    if (nameconflict == NAMECONFLICT_ERROR) throw new ApplicationException("destination file [" + file + "] already exist");
  	    // SKIP
  	    else if (nameconflict == NAMECONFLICT_SKIP) return;
  	    // OVERWRITE
  	    else if (nameconflict == NAMECONFLICT_OVERWRITE) file.delete();
  	}
  
  	setACL(pageContext, file, acl);
  	try {
  	    if (output instanceof InputStream) {
  		IOUtil.copy((InputStream) output, file, false);
  	    }
  	    else if (Decision.isCastableToBinary(output, false)) {
  		IOUtil.copy(new ByteArrayInputStream(Caster.toBinary(output)), file, true);
  	    }
  	    else {
  		String content = Caster.toString(output);
  		if (fixnewline) content = doFixNewLine(content);
  		if (addnewline) content += SystemUtil.getOSSpecificLineSeparator();
  
  		IOUtil.write(file, content, CharsetUtil.toCharset(charset), false);
  
  	    }
  	}
  	catch (UnsupportedEncodingException e) {
  	    throw new ApplicationException("Unsupported Charset Definition [" + charset + "]", e.getMessage());
  	}
  	catch (IOException e) {
  
  	    throw new ApplicationException("can't write file " + file.getAbsolutePath(), e.getMessage());
  	}
  	setMode(file, mode);
  	setAttributes(file, attributes);
      }
docs: write to the source file
  
  @throws PageException