@@ -389,6 +389,8 @@ private static InputStreamReader getInputStreamReader( File file, String encodin
389
389
* @param fileName The path of the file to write.
390
390
* @param data The content to write to the file.
391
391
* @throws IOException if any
392
+ * @deprecated use {@code java.nio.files.Files.write(filename, data.getBytes(encoding),
393
+ * StandardOpenOption.APPEND, StandardOpenOption.CREATE)}
392
394
*/
393
395
public static void fileAppend ( String fileName , String data )
394
396
throws IOException
@@ -403,11 +405,14 @@ public static void fileAppend( String fileName, String data )
403
405
* @param encoding The encoding of the file.
404
406
* @param data The content to write to the file.
405
407
* @throws IOException if any
408
+ * @deprecated use {@code java.nio.files.Files.write(filename, data.getBytes(encoding),
409
+ * StandardOpenOption.APPEND, StandardOpenOption.CREATE)}
406
410
*/
407
411
public static void fileAppend ( String fileName , String encoding , String data )
408
412
throws IOException
409
413
{
410
- try ( OutputStream out = Files .newOutputStream ( Paths .get (fileName ), StandardOpenOption .APPEND ) )
414
+ try ( OutputStream out = Files .newOutputStream ( Paths .get (fileName ),
415
+ StandardOpenOption .APPEND , StandardOpenOption .CREATE ) )
411
416
{
412
417
if ( encoding != null )
413
418
{
0 commit comments