org.shaker.dwu
Class NS4Filter

java.lang.Object
  |
  +--javax.swing.filechooser.FileFilter
        |
        +--org.shaker.dwu.ExtendedFilter
              |
              +--org.shaker.dwu.NS4Filter

public final class NS4Filter
extends ExtendedFilter

This class filters NetScape 4.x profiles and imports necessary data.

Author:
Philipp Bartsch (codeshaker@gmx.net), GPL License

Field Summary
private static java.lang.String description
          A filechooser description.
private static java.lang.String fileName
          The requested preferences file.
 
Constructor Summary
(package private) NS4Filter()
          Creates a NS4.x filter.
 
Method Summary
 boolean accept(java.io.File file)
          Returns true, if the given file is "liprefs.js" (and for directories to support filesystem browsing).
private static java.lang.String extractEntry(java.lang.String token)
          Extracts the requested content out of a given token
 java.lang.String getDescription()
          Returns a filechooser description.
protected  boolean resolvePropFile(java.io.File file)
          Returns true, if the given preferences file contains at least a SMTP- Server and user`s mail address.
 
Methods inherited from class org.shaker.dwu.ExtendedFilter
readFileToString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

fileName

private static final java.lang.String fileName
The requested preferences file. Value is "liprefs.js".

description

private static final java.lang.String description
A filechooser description. Value is "Netscape 4 >> liprefs.js"
Constructor Detail

NS4Filter

NS4Filter()
Creates a NS4.x filter.
Method Detail

extractEntry

private static java.lang.String extractEntry(java.lang.String token)
Extracts the requested content out of a given token
Parameters:
token - the document token
Returns:
String the requested content

resolvePropFile

protected final boolean resolvePropFile(java.io.File file)
Returns true, if the given preferences file contains at least a SMTP- Server and user`s mail address. Furthermore extracts necessary adn available data of a NS4 preferences file.
Overrides:
resolvePropFile in class ExtendedFilter
Parameters:
file - preferences file
Returns:
boolean returns true, if smtp & mail address section available
See Also:
ExtendedFilter.resolvePropFile(File)

accept

public final boolean accept(java.io.File file)
Returns true, if the given file is "liprefs.js" (and for directories to support filesystem browsing).
Overrides:
accept in class javax.swing.filechooser.FileFilter
Parameters:
file - the file
Returns:
boolean flag
See Also:
FileFilter.accept(java.io.File)

getDescription

public final java.lang.String getDescription()
Returns a filechooser description. @see #description for descriptions content
Overrides:
getDescription in class javax.swing.filechooser.FileFilter
Returns:
String the description
See Also:
FileFilter.getDescription()