Append the text at the end of the File without writing a BOM.

@param file a File
@param text the text to append at the end of the File
@throws IOException if an IOException occurs.
@since 1.0
421516
public static void append(File file, Object text) throws IOException {
        append(file, text, false);
    }
957802
public void persist(File file) throws IOException {
    //System.err.println("Writting "+wordMap.size()+" words and "+gramSet.size()+" n-grams");
    DataOutputStream output = new DataOutputStream(new GZIPOutputStream(new FileOutputStream(file)));
    output.writeUTF(FILE_TYPE);
    System.err.println("pruning from "+wordMap.size());
    for (Iterator ki=wordMap.iterator();ki.hasNext();) {
      String key = (String) ki.next();
      if (((CountedNumberedSet) wordMap).getCount(key) < cutoff) {
        ki.remove();
      }
    }
    System.err.println("pruning to "+wordMap.size());
    output.writeInt(wordMap.size());
    for (Iterator ki=wordMap.iterator();ki.hasNext();) {
      String key = (String) ki.next();
      output.writeUTF(key);
      output.writeInt(wordMap.getIndex(key));
    }
    CountedSet cset = (CountedSet) gramSet;
    int gramCount = 0;
    for (Iterator gi = gramSet.iterator();gi.hasNext();) {
      NGram ngram = (NGram) gi.next();
      if (cset.getCount(ngram) >= cutoff) {
        int[] words = ngram.getWords();
        output.writeInt(words.length);
        for (int wi=0;wi<words.length;wi++) {
          output.writeInt(words[wi]);
        }
        gramCount++;
      }
      else {
        //System.err.println("ngram "+cset.getCount(ngram));
      }
    }
    System.err.println("Wrote out "+gramCount+" n-grams");
    output.close();
  }
1276320
public static void writeTextFile(String text,File file) throws IOException
    {
        Writer writer=null;
        try
        {
            //create writer to file (with default encoding)
            OutputStream outputStream=new FileOutputStream(file);
            writer=IOHelper.createWriter(outputStream,null);
            
            //write to file
            writer.write(text);
        }
        finally
        {
            //close writer
            IOHelper.closeResource(writer);
        }
    }
1265577
public void write(File file) throws IOException {
        try (InputStream inputStream = getInputStream()) {
            IoUtils.copy(inputStream, file);
        }
    }
644291
public static void writeTXT(String string, File file) throws IOException {
		BufferedWriter out = new BufferedWriter(new FileWriter(file));
		out.write(string);
		out.close();
	}
335555
public static File leftShift(File file, Object text) throws IOException {
        append(file, text);
        return file;
    }
155479
public static void write(File file, String text, boolean append) throws IOException {
        FileWriter writer = new FileWriter(file, append);
        try {
            writer.write(text);
        } finally {
            writer.close();
        }
    }
595354
public static void writeFile(byte[] content,File file) throws IOException
    {
        OutputStream outputStream=null;
        try
        {
            //create output stream to file
            outputStream=new FileOutputStream(file);
            
            //write to file
            outputStream.write(content);
        }
        finally
        {
            //close writer
            IOHelper.closeResource(outputStream);
        }
    }
1329375
public static void writeToFile(@NonNull File file, @NonNull String content) throws IOException {
    OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(file), "UTF-8");
    try {
      writer.write(content);
      writer.flush();
    } catch (IOException ioe) {
      Log.e(LOG_TAG, ioe.toString());
    } finally {
      try {
        writer.close();
      } catch (IOException ioe) {
        Log.e(LOG_TAG, ioe.toString());
      }
    }
  }
1116001
public static void append(File file, Reader reader) throws IOException {
        append(file, reader, false);
    }
704399
public synchronized void addTextNode(String text) throws IOException {
		// check for non-empty string
		if(text == null || text.trim().length() == 0) {
			return;
		}
		// reject modification of already closed node
		if(isOpen==false) {
			throw new IOException("Attempted to add child text node to already closed tag '" + name + "'!");
		}
		if(lastChildNode==null) {
			// no child nodes yet, close opening tag
			writer.write(">");
		} else {
			// close previous sibling and move to new line
			// FIXME: is this a legal situation, and if: how do we format this issue nicely?
			lastChildNode.close();
			writer.write("\n");
			indentLine();
		}
		SXTextNode textNode = new SXTextNode(text, writer, tabLevel, tabString);
		lastChildNode = textNode;
	}
83507
public static void write(File file, String text) throws IOException {
        Writer writer = null;
        try {
            writer = new FileWriter(file);
            writer.write(text);
            writer.flush();

            Writer temp = writer;
            writer = null;
            temp.close();
        } finally {
            closeWithWarning(writer);
        }
    }
92094
public void save(File file) throws IOException {

        Writer writer = null;

        try {
            writer = new Writer(file);
            writer.println(toPrettyString());
        } finally {
            if (writer != null) writer.close();
        }
    }
183980
public static void write(final CharSequence data, final File file) throws IOException {
		Validate.notNull(file);
		Validate.notNull(data);

		try (BufferedWriter writer = Files.newBufferedWriter(file.toPath(), Charsets.UTF_8)) {
			writer.append(data);
		}
	}
663099
private void appendText(String text) {

        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(text)) {
            text = Translate.decode(text);
            text = collapse(text);
        }
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(text)) {

            if (m_storedBrCount > 0) {
                m_appendBr = true;
                appendLinebreak(m_storedBrCount);
            }
            appendIndentation();
            m_brCount = 0;

            List<String> wordList = CmsStringUtil.splitAsList(text, ' ');
            Iterator<String> i = wordList.iterator();
            while (i.hasNext()) {
                String word = i.next();
                boolean hasNbsp = ((word.charAt(0) == 160) || (word.charAt(word.length() - 1) == 160));
                if ((word.length() + 1 + m_lineLength) > m_maxLineLength) {
                    m_appendBr = true;
                    appendLinebreak(1);
                    appendIndentation();
                    m_brCount = 0;
                } else {
                    if (!hasNbsp
                        && (m_lineLength > m_indent)
                        && (m_result.charAt(m_result.length() - 1) != 160)
                        && (m_result.charAt(m_result.length() - 1) != 32)) {

                        m_result.append(' ');
                        m_lineLength++;
                    }
                }
                m_result.append(word);
                m_lineLength += word.length();
            }
        }
    }
1311052
public static void write(Path self, String text) throws IOException {
        Writer writer = null;
        try {
            writer = new OutputStreamWriter(Files.newOutputStream(self), Charset.defaultCharset());
            writer.write(text);
            writer.flush();

            Writer temp = writer;
            writer = null;
            temp.close();
        } finally {
            closeWithWarning(writer);
        }
    }
777974
public void save(File file) throws IOException {
		PrintStream out = new PrintStream(new FileOutputStream(file));
		out.println("font.size=" + fontSize);
		out.println("font.bold=" + bold);
		out.println("font.italic=" + italic);
		out.println();
		out.println("pad.top=" + paddingTop);
		out.println("pad.right=" + paddingRight);
		out.println("pad.bottom=" + paddingBottom);
		out.println("pad.left=" + paddingLeft);
		out.println("pad.advance.x=" + paddingAdvanceX);
		out.println("pad.advance.y=" + paddingAdvanceY);
		out.println();
		out.println("glyph.page.width=" + glyphPageWidth);
		out.println("glyph.page.height=" + glyphPageHeight);
		out.println();
		for (Iterator iter = effects.iterator(); iter.hasNext();) {
			ConfigurableEffect effect = (ConfigurableEffect)iter.next();
			out.println("effect.class=" + effect.getClass().getName());
			for (Iterator iter2 = effect.getValues().iterator(); iter2.hasNext();) {
				Value value = (Value)iter2.next();
				out.println("effect." + value.getName() + "=" + value.getString());
			}
			out.println();
		}
		out.close();
	}