2.17.2: 2011-06-17

net.sf.basedb.util
Class FileExportOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by net.sf.basedb.core.plugin.ExportOutputStream
          extended by net.sf.basedb.util.FileExportOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class FileExportOutputStream
extends ExportOutputStream

An extension to the ExportOutputStream class which directs the output to a File in BASE.

Version:
2.2
Author:
nicklas
See Also:
ImmediateDownloadExporter
Last modified
$Date: 2009-02-25 10:55:44 +0100 (Wed, 25 Feb 2009) $

Field Summary
private  File file
           
private  boolean ignoreFilename
           
 
Constructor Summary
FileExportOutputStream(File file, boolean ignoreFilename)
          Create a new export stream that writes the exported data to a file in the BASE filesystem
 
Method Summary
 File getFile()
          If the export stream is going to a BASE File object, use this method to access it.
 void setCharacterSet(String charset)
          Calls File.setCharacterSet(String)
 void setContentLength(long contentLength)
          Ignored.
 void setFilename(String filename)
          Calls File.setName(String) unless file names should be ignored.
 void setMimeType(String mimeType)
          Calls File.setMimeType(String)
 
Methods inherited from class net.sf.basedb.core.plugin.ExportOutputStream
close, flush, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

private final File file

ignoreFilename

private final boolean ignoreFilename
Constructor Detail

FileExportOutputStream

public FileExportOutputStream(File file,
                              boolean ignoreFilename)
Create a new export stream that writes the exported data to a file in the BASE filesystem

Parameters:
file - The file to write to
ignoreFilename - If calls to the setFilename(String) should be ignored or not
Method Detail

setContentLength

public void setContentLength(long contentLength)
Ignored. File size is calculated from the number of bytes written to the file.

Overrides:
setContentLength in class ExportOutputStream

setMimeType

public void setMimeType(String mimeType)
Calls File.setMimeType(String)

Overrides:
setMimeType in class ExportOutputStream

setCharacterSet

public void setCharacterSet(String charset)
Calls File.setCharacterSet(String)

Overrides:
setCharacterSet in class ExportOutputStream
Since:
2.9

setFilename

public void setFilename(String filename)
Calls File.setName(String) unless file names should be ignored.

Overrides:
setFilename in class ExportOutputStream

getFile

public File getFile()
Description copied from class: ExportOutputStream
If the export stream is going to a BASE File object, use this method to access it. This class always return null, subclasses may override this method.

Overrides:
getFile in class ExportOutputStream
Returns:
The file given to the constructor.

2.17.2: 2011-06-17