com.mucommander.io
Class BackupInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by com.mucommander.io.BackupInputStream
All Implemented Interfaces:
java.io.Closeable

public class BackupInputStream
extends java.io.FilterInputStream

Opens an input stream on a file that has been saved by BackupOutputStream.

This class' role is to choose which of the original or backup file should be read in order to ensure that the data is not corrupt.

Author:
Nicolas Rinaudo
See Also:
BackupOutputStream

Field Summary
static char BACKUP_SUFFIX
          Character to add suffix file names with in order to mark them as backup.
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
BackupInputStream(AbstractFile file)
          Opens a backup input stream on the specified file.
BackupInputStream(java.io.File file)
          Opens a backup input stream on the specified file.
BackupInputStream(java.lang.String path)
          Opens a backup input stream on the specified file.
 
Method Summary
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BACKUP_SUFFIX

public static final char BACKUP_SUFFIX
Character to add suffix file names with in order to mark them as backup.

See Also:
Constant Field Values
Constructor Detail

BackupInputStream

public BackupInputStream(java.io.File file)
                  throws java.io.IOException
Opens a backup input stream on the specified file.

Parameters:
file - file to open for reading.
Throws:
java.io.IOException - thrown if any IO related error occurs.

BackupInputStream

public BackupInputStream(java.lang.String path)
                  throws java.io.IOException
Opens a backup input stream on the specified file.

Parameters:
path - path to the file to open for reading.
Throws:
java.io.IOException - thrown if any IO related error occurs.

BackupInputStream

public BackupInputStream(AbstractFile file)
                  throws java.io.IOException
Opens a backup input stream on the specified file.

Parameters:
file - file to open for reading.
Throws:
java.io.IOException - thrown if any IO related error occurs.


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard