org.erights.e.meta.java.io
Class ReadOnlyFile

java.lang.Object
  |
  +--org.erights.e.elib.serial.BaseLoader
        |
        +--org.erights.e.meta.java.io.ReadOnlyFile
All Implemented Interfaces:
Iteratable, Loader, Marker, PassByProxy, Persistent, Serializable, Uncaller

public class ReadOnlyFile
extends BaseLoader
implements PassByProxy, Persistent, Iteratable

Untamed:

Author:
Mark S. Miller
See Also:
Serialized Form

Field Summary
private  boolean myIsTransitive
           
private  File myPrecious
           
(package private) static long serialVersionUID
           
 
Fields inherited from interface org.erights.e.elib.serial.PassByProxy
HONORARY, HONORED_NAMES
 
Fields inherited from interface org.erights.e.elib.serial.Persistent
HONORARY, HONORED_NAMES
 
Constructor Summary
ReadOnlyFile(File file, boolean isTransitive)
          Enabled:
 
Method Summary
 void __printOn(TextWriter out)
          Enabled: Normalize the E-printed form to use forward slashes as separators.
 boolean canRead()
          Enabled:
 boolean canWrite()
          Enabled:
 ReadOnlyFile deepReadOnly()
          Enabled:
 boolean exists()
          Enabled:
 Object get(String name)
          Enabled:
 ReadOnlyFile getAbsoluteFile()
          Enabled:
 String getAbsolutePath()
          Enabled:
 ReadOnlyFile getCanonicalFile()
          Enabled:
 String getCanonicalPath()
          Enabled:
 String getName()
          Enabled:
 String getParent()
          Enabled:
 String getPath()
          Enabled:
 String getPlatformPath()
          Enabled:
 String getText()
          Enabled: Gets the contents of the file as a String, normalizing newlines into '\n's.
 Twine getTwine()
          Enabled: Gets the contents of the file as Twine (a text string that remembers where it came from), normalizing newlines into '\n's.
 boolean isAbsolute()
          Enabled:
 boolean isDirectory()
          Enabled:
 boolean isHidden()
          Enabled:
 boolean isNormal()
          Enabled:
 void iterate(AssocFunc func)
          Enabled: If the file is a directory, enumerate filename => File associations for each child of the directory.
 void iterate(AssocFunc func, boolean isLocated)
          Enabled: If the file is a directory, enumerate filename => File associations for each child of the directory.
 long lastModified()
          Enabled:
 long length()
          Enabled:
 String[] list()
          Enabled:
 String[] list(FilenameFilter filter)
          Enabled:
 Object[] listFiles()
          Enabled:
 Object[] listFiles(FilenameFilter filter)
          Enabled:
 Object[] optUncall(Object obj)
          Enabled:
private  Object[] protectFiles(File[] files)
           
 ReadOnlyFile shallowReadOnly()
          Enabled:
 BufferedReader textReader()
          Enabled: Open 'self' for reading text, decoding UTF-8 and turning platform newlines into '\n's
 
Methods inherited from class org.erights.e.elib.serial.BaseLoader
getOptWrappingUncall, optUnget, ungetToUncall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID

myPrecious

private final File myPrecious

myIsTransitive

private final boolean myIsTransitive
Constructor Detail

ReadOnlyFile

public ReadOnlyFile(File file,
                    boolean isTransitive)
Enabled:

Method Detail

shallowReadOnly

public ReadOnlyFile shallowReadOnly()
Enabled:


deepReadOnly

public ReadOnlyFile deepReadOnly()
Enabled:


getName

public String getName()
Enabled:


getParent

public String getParent()
Enabled:


getPath

public String getPath()
Enabled:


isAbsolute

public boolean isAbsolute()
Enabled:


getAbsolutePath

public String getAbsolutePath()
Enabled:


getAbsoluteFile

public ReadOnlyFile getAbsoluteFile()
Enabled:


getCanonicalPath

public String getCanonicalPath()
                        throws IOException
Enabled:

IOException

getCanonicalFile

public ReadOnlyFile getCanonicalFile()
                              throws IOException
Enabled:

IOException

getPlatformPath

public String getPlatformPath()
Enabled:


canRead

public boolean canRead()
Enabled:


canWrite

public boolean canWrite()
Enabled:


exists

public boolean exists()
Enabled:


isDirectory

public boolean isDirectory()
Enabled:


isNormal

public boolean isNormal()
Enabled:


isHidden

public boolean isHidden()
Enabled:


lastModified

public long lastModified()
Enabled:


length

public long length()
Enabled:


list

public String[] list()
Enabled:


list

public String[] list(FilenameFilter filter)
Enabled:


protectFiles

private Object[] protectFiles(File[] files)

listFiles

public Object[] listFiles()
Enabled:


listFiles

public Object[] listFiles(FilenameFilter filter)
Enabled:


getText

public String getText()
               throws IOException
Enabled: Gets the contents of the file as a String, normalizing newlines into '\n's.

IOException

getTwine

public Twine getTwine()
               throws IOException
Enabled: Gets the contents of the file as Twine (a text string that remembers where it came from), normalizing newlines into '\n's.

IOException

iterate

public void iterate(AssocFunc func)
Enabled: If the file is a directory, enumerate filename => File associations for each child of the directory.

Otherwise assume it's a text file and enumerates lineNumber => String (text line) associations. Like Perl, each text line ends with a "\n".

Specified by:
iterate in interface Iteratable

iterate

public void iterate(AssocFunc func,
                    boolean isLocated)
             throws IOException
Enabled: If the file is a directory, enumerate filename => File associations for each child of the directory.

Otherwise assume it's a text file and enumerates lineNumber => String/Twine (text line) associations. Like Perl, each text line ends with a "\n".

IOException

textReader

public BufferedReader textReader()
                          throws FileNotFoundException
Enabled: Open 'self' for reading text, decoding UTF-8 and turning platform newlines into '\n's

FileNotFoundException

get

public Object get(String name)
Enabled:

Specified by:
get in interface Loader

optUncall

public Object[] optUncall(Object obj)
Enabled:

Specified by:
optUncall in interface Uncaller
Parameters:
obj -
Returns:

__printOn

public void __printOn(TextWriter out)
               throws IOException
Enabled: Normalize the E-printed form to use forward slashes as separators. E'ers can still use getPath() to get the path as the File object sees it.

IOException


comments?