Sweet Home 3D 4.1

com.eteks.sweethome3d.io
Class HomeFileRecorder

java.lang.Object
  extended by com.eteks.sweethome3d.io.HomeFileRecorder
All Implemented Interfaces:
HomeRecorder

public class HomeFileRecorder
extends Object
implements HomeRecorder

Recorder that stores homes in files with DefaultHomeOutputStream and DefaultHomeInputStream.

Author:
Emmanuel Puybaret

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.eteks.sweethome3d.model.HomeRecorder
HomeRecorder.Type
 
Constructor Summary
HomeFileRecorder()
          Creates a home recorder able to write and read homes in uncompressed files.
HomeFileRecorder(int compressionLevel)
          Creates a home recorder able to write and read homes in files compressed at a level from 0 to 9.
HomeFileRecorder(int compressionLevel, boolean includeOnlyTemporaryContent)
          Creates a home recorder able to write and read homes in files compressed at a level from 0 to 9.
 
Method Summary
 boolean exists(String name)
          Returns true if the file name exists.
 Home readHome(String name)
          Returns a home instance read from its file name.
 void writeHome(Home home, String name)
          Writes home data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HomeFileRecorder

public HomeFileRecorder()
Creates a home recorder able to write and read homes in uncompressed files.


HomeFileRecorder

public HomeFileRecorder(int compressionLevel)
Creates a home recorder able to write and read homes in files compressed at a level from 0 to 9.

Parameters:
compressionLevel - 0 (uncompressed) to 9 (compressed).

HomeFileRecorder

public HomeFileRecorder(int compressionLevel,
                        boolean includeOnlyTemporaryContent)
Creates a home recorder able to write and read homes in files compressed at a level from 0 to 9.

Parameters:
compressionLevel - 0-9
includeOnlyTemporaryContent - if true, content instances of TemporaryURLContent class referenced by the saved home as well as the content previously saved with it will be written. If false, all the content instances referenced by the saved home will be written in the zip stream.
Method Detail

writeHome

public void writeHome(Home home,
                      String name)
               throws RecorderException
Writes home data.

Specified by:
writeHome in interface HomeRecorder
Parameters:
home - the home to write.
name - the name of the resource in which the home will be written.
Throws:
RecorderException - if a problem occurred while writing home.

readHome

public Home readHome(String name)
              throws RecorderException
Returns a home instance read from its file name.

Specified by:
readHome in interface HomeRecorder
Parameters:
name - the name of the resource from which the home will be read.
Throws:
RecorderException - if a problem occurred while reading home, or if file name doesn't exist.

exists

public boolean exists(String name)
               throws RecorderException
Returns true if the file name exists.

Specified by:
exists in interface HomeRecorder
Parameters:
name - the name of the resource to check
Throws:
RecorderException

Sweet Home 3D 4.1

© Copyrights 2006-2013 eTeks - All rights reserved
Distributed under GNU General Public License