net.charlesames.utility.io
Class PrivilegedTextWriter

java.lang.Object
  extended by net.charlesames.utility.io.PrivilegedTextWriter
All Implemented Interfaces:
java.security.PrivilegedAction<java.lang.Boolean>

public class PrivilegedTextWriter
extends java.lang.Object
implements java.security.PrivilegedAction<java.lang.Boolean>

Writes a text string to a file in a privileged context.

Author:
Charles Ames

Constructor Summary
PrivilegedTextWriter()
           
 
Method Summary
 java.lang.Boolean run()
           
 void setEncoding(java.lang.String encoding)
          Set the method used for encoding characters.
 void setFile(java.io.File file)
          Set the file to which the data is to be written.
 void setText(java.lang.String text)
          Set the text data which is to go into the file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrivilegedTextWriter

public PrivilegedTextWriter()
Method Detail

setFile

public void setFile(java.io.File file)
Set the file to which the data is to be written.

Parameters:
file - The file to which the data is to be written.

setText

public void setText(java.lang.String text)
Set the text data which is to go into the file.

Parameters:
text - The text data which is to go into the file.

setEncoding

public void setEncoding(java.lang.String encoding)
Set the method used for encoding characters.

Parameters:
encoding - The method used for encoding characters.

run

public java.lang.Boolean run()
Specified by:
run in interface java.security.PrivilegedAction<java.lang.Boolean>