View Javadoc

    1   /*
    2    * Copyright (c) 2001-2003 The XDoclet team
    3    * All rights reserved.
    4    */
    5   package xjavadoc.filesystem;
    6
    7   import java.io.Reader;
    8   import java.io.IOException;
    9   import java.io.Writer;
    10  import java.io.OutputStream;
    11  import java.io.FileNotFoundException;
    12  import java.io.UnsupportedEncodingException;
    13
    14  /***
    15   * @created   September 25, 2002
    16   */
    17  public class ReaderFile implements AbstractFile
    18  {
    19  	private Reader       file;
    20
    21  	public ReaderFile( Reader file )
    22  	{
    23  		this.file = file;
    24  	}
    25
    26  	public Reader getReader() throws IOException
    27  	{
    28  		return file;
    29  	}
    30
    31      public Reader getReader(String enc) throws UnsupportedEncodingException, FileNotFoundException
    32      {
    33          // Takashi: what to do here?
    34  //        if (enc!=null)
    35  //        {
    36  //            return new InputStreamReader(new FileInputStream(file),enc);
    37  //        }
    38  //        else
    39  //        {
    40  //            return new InputStreamReader(new FileInputStream(file));
    41  //        }
    42          return file;
    43      }
    44
    45  	public Writer getWriter() throws IOException
    46  	{
    47  		throw new IOException("Not supported");
    48  	}
    49
    50  	public boolean isWriteable()
    51  	{
    52  		return false;
    53  	}
    54
    55  	public OutputStream getOutputStream() throws FileNotFoundException
    56  	{
    57  		throw new FileNotFoundException("Not supported");
    58  	}
    59
    60  	public String getPath()
    61  	{
    62  		throw new RuntimeException("Not supported");
    63  	}
    64
    65  	public long lastModified()
    66  	{
    67  		return Long.MIN_VALUE;
    68  	}
    69
    70  	public String toString()
    71  	{
    72  		return super.toString();
    73  	}
    74  }