RECODER 0.92

recoder.io
Interface DataLocation

All Known Implementing Classes:
ArchiveDataLocation, DataFileLocation

public interface DataLocation

Describes the origin of source or object data, such as files, URLs, or archive entries. Locations can open an input stream and provide detailed information about further streams that are supported by the location. It supports output streams, readers and writers in case these are feasible.

Author:
RN, AL

Method Summary
 java.io.InputStream getInputStream()
          returns an input stream for the content of the location
 java.io.OutputStream getOutputStream()
          returns an output stream for manipulating the content of the location
 java.io.Reader getReader()
          returns a reader for the according data content.
 java.lang.String getType()
          returns a string representation of the locationType
 java.io.Writer getWriter()
          returns a writer for the according data content.
 boolean hasReaderSupport()
          determines whether the data source provides a reader interface.
 boolean hasWriterSupport()
          determines whether the data source provides a writer interface.
 void inputStreamClosed()
          tells the location, that the earlier created input stream has been closed
 boolean isWritable()
          determines whether or not the data location can be overwritten.
 void outputStreamClosed()
          tells the location, that the earlier created output stream has been closed
 void readerClosed()
          tells the location, that the earlier created reader has been closed
 java.lang.String toString()
          returns a URL-like string representation of the location in the form " : ", i.e. file:/bin/sh url:http://mywww/myfile zip:recoder.zip:recoder/java/JavaProgramFactory.class
 void writerClosed()
          tells the location, that the earlier created writer has been closed
 

Method Detail

getType

java.lang.String getType()
returns a string representation of the locationType


toString

java.lang.String toString()
returns a URL-like string representation of the location in the form " : ", i.e. file:/bin/sh url:http://mywww/myfile zip:recoder.zip:recoder/java/JavaProgramFactory.class

Overrides:
toString in class java.lang.Object

hasReaderSupport

boolean hasReaderSupport()
determines whether the data source provides a reader interface. If this is not the case, the reader is placed on top of an input stream, which causes efficiency losses.

Returns:
true iff the data location provides reader functionality

getInputStream

java.io.InputStream getInputStream()
                                   throws java.io.IOException
returns an input stream for the content of the location

Returns:
the according input stream
Throws:
java.io.IOException - thrown if an error occurs with retrieving the input stream from the according data object.

inputStreamClosed

void inputStreamClosed()
tells the location, that the earlier created input stream has been closed


getReader

java.io.Reader getReader()
                         throws java.io.IOException
returns a reader for the according data content. If the data source does not provide a reader, an adapter reader is placed on top of an input stream.

Returns:
the according reader
Throws:
java.io.IOException - thrown if an error occurs with retrieving the reader or the underlying input stream from the according data object.

readerClosed

void readerClosed()
tells the location, that the earlier created reader has been closed


isWritable

boolean isWritable()
determines whether or not the data location can be overwritten.

Returns:
true if writing is supported

hasWriterSupport

boolean hasWriterSupport()
determines whether the data source provides a writer interface. If this is not the case, the writer is placed on top of an output stream, which causes efficiency losses.

Returns:
true iff the data location provides writer functionality

getOutputStream

java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
returns an output stream for manipulating the content of the location

Returns:
the according output stream
Throws:
java.io.IOException - thrown if an error occurs with retrieving the output stream from the according data object.

outputStreamClosed

void outputStreamClosed()
tells the location, that the earlier created output stream has been closed


getWriter

java.io.Writer getWriter()
                         throws java.io.IOException
returns a writer for the according data content. If the data source does not provide a writer, an adapter reader is placed on top of an output stream.

Returns:
the according writer
Throws:
java.io.IOException - thrown if an error occurs with retrieving the writer or the underlying output stream from the according data object.

writerClosed

void writerClosed()
tells the location, that the earlier created writer has been closed


RECODER 0.92