org.encog.persist.location
Class FilePersistence

java.lang.Object
  extended by org.encog.persist.location.FilePersistence
All Implemented Interfaces:
PersistenceLocation

public class FilePersistence
extends Object
implements PersistenceLocation

A persistence location based on a file.

Author:
jheaton

Constructor Summary
FilePersistence(File file)
          Construct a persistance location based on a file.
 
Method Summary
 InputStream createInputStream()
           
 OutputStream createOutputStream()
           
 void delete()
          Attempt to delete the file.
 boolean exists()
           
 File getFile()
           
 void renameTo(PersistenceLocation toLocation)
          Rename this file to a different location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilePersistence

public FilePersistence(File file)
Construct a persistance location based on a file.

Parameters:
file - The file to use.
Method Detail

createInputStream

public InputStream createInputStream()
Specified by:
createInputStream in interface PersistenceLocation
Returns:
A new InputStream for this file.

createOutputStream

public OutputStream createOutputStream()
Specified by:
createOutputStream in interface PersistenceLocation
Returns:
A new OutputStream for this file.

delete

public void delete()
Attempt to delete the file.

Specified by:
delete in interface PersistenceLocation

exists

public boolean exists()
Specified by:
exists in interface PersistenceLocation
Returns:
True if the file exists.

getFile

public File getFile()
Returns:
The file this location is based on.

renameTo

public void renameTo(PersistenceLocation toLocation)
Rename this file to a different location.

Specified by:
renameTo in interface PersistenceLocation
Parameters:
toLocation - What to rename to.


Copyright © 2011. All Rights Reserved.