org.ceryle.convert
Class PilotConverter

java.lang.Object
  extended by org.ceryle.convert.PilotConverter

public class PilotConverter
extends Object

Wraps the PilotDocJ decode() and encode() static methods in a single utility class. This is used to convert between text documents and .pdb (Pilot Document) files.

Since:
JDK1.4
Version:
$Id: PilotConverter.java,v 3.7 2007-06-20 01:28:09 altheim Exp $
Author:
Murray Altheim

Constructor Summary
PilotConverter()
          Default constructor for PilotConverter.
 
Method Summary
 com.brisk.pilot.DatabaseHeader decode(File file, OutputStream out)
          Decodes the specified .pdb File, writing to the provided OutputStream, and returns the DatabaseHeader.
 Document decodeToDocumentView(File file, DocumentView dv)
          Decodes (imports) the specified .pdb File, writing the PDB file's metadata to the DocumentView, returning the Document to be set by the SourceProcessor's feed back to the DocumentView).
 void encode(InputStream in, File file)
          Encodes the provided InputStream to the specified .pdb File.
 void encode(InputStream in, File file, com.brisk.pilot.DatabaseHeader dbh)
          Encodes the provided InputStream to the specified .pdb File, including the optional DatabaseHeader.
 boolean encodeFromDocumentView(File file, DocumentView dv, String filename, String title)
          Encodes (exports) the editor content of the provided DocumentView to the specified .pdb File, with the suggested filename.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PilotConverter

public PilotConverter()
Default constructor for PilotConverter.

Method Detail

decode

public com.brisk.pilot.DatabaseHeader decode(File file,
                                             OutputStream out)
Decodes the specified .pdb File, writing to the provided OutputStream, and returns the DatabaseHeader.


decodeToDocumentView

public Document decodeToDocumentView(File file,
                                     DocumentView dv)
Decodes (imports) the specified .pdb File, writing the PDB file's metadata to the DocumentView, returning the Document to be set by the SourceProcessor's feed back to the DocumentView). If the provided File is null, a file chooser is displayed.

Returns:
the imported Document.

encode

public void encode(InputStream in,
                   File file)
Encodes the provided InputStream to the specified .pdb File. Given that no title is provided (and it is required), the default "untitled" is used.


encode

public void encode(InputStream in,
                   File file,
                   com.brisk.pilot.DatabaseHeader dbh)
Encodes the provided InputStream to the specified .pdb File, including the optional DatabaseHeader.


encodeFromDocumentView

public boolean encodeFromDocumentView(File file,
                                      DocumentView dv,
                                      String filename,
                                      String title)
Encodes (exports) the editor content of the provided DocumentView to the specified .pdb File, with the suggested filename. The filename provided should have a ".pdb" extension.

Returns:
true if exported successfully


The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.