javax.media.jai.operator
Class FileStoreDescriptor

java.lang.Object
  extended byjavax.media.jai.OperationDescriptorImpl
      extended byjavax.media.jai.operator.FileStoreDescriptor
All Implemented Interfaces:
OperationDescriptor, RegistryElementDescriptor, Serializable

public class FileStoreDescriptor
extends OperationDescriptorImpl

An OperationDescriptor describing the "FileStore" operation. The "FileStore" operation writes an image to a given file in a specified format using the supplied encoding parameters.

In the default instance the validateParameters() method checks for the named file to be writable if it already exists, else that it can be created. If not, it will return false, causing JAI.createNS() to throw an IllegalArgumentException.

In special cases such as an image being written to a remote system, the above check for existence of a file on the local system should be bypassed. This can be accomplished by setting the Boolean variable checkFileLocally to FALSE in the ParameterBlock.

The third parameter contains an instance of ImageEncodeParam to be used during the decoding. It may be set to null in order to perform default encoding, or equivalently may be omitted. If non-null, it must be of the correct class type for the selected format.

The requested file path must be writable.

The classes in the com.sun.media.jai.codec package are not a committed part of the JAI API. Future releases of JAI will make use of new classes in their place. This class will change accordingly.

Resource List
Name Value
GlobalName filestore
LocalName filestore
Vendor com.sun.media.jai
Description Stores an image to a file.
DocURL http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/FileStoreDescriptor.html
Version 1.0
arg0Desc The path of the file to write to.
arg1Desc The format of the file.
arg2Desc The encoding parameters.
arg3Desc Boolean specifying whether check for file creation / writing locally should be done.

Parameter List
Name Class Type Default Value
filename java.lang.String NO_PARAMETER_DEFAULT
format java.lang.String "tiff"
param com.sun.media.jai.codec.ImageEncodeParam null
checkFileLocally java.lang.Boolean TRUE

See Also:
OperationDescriptor, Serialized Form

Field Summary
 
Fields inherited from class javax.media.jai.OperationDescriptorImpl
sourceNames
 
Fields inherited from interface javax.media.jai.OperationDescriptor
NO_PARAMETER_DEFAULT
 
Constructor Summary
FileStoreDescriptor()
          Constructor.
 
Method Summary
static RenderedOp create(RenderedImage source0, String filename, String format, ImageEncodeParam param, Boolean checkFileLocally, RenderingHints hints)
          Stores an image to a file.
 boolean isImmediate()
          Returns true indicating that the operation should be rendered immediately during a call to JAI.create().
 boolean validateArguments(String modeName, ParameterBlock args, StringBuffer msg)
          Validates the input source and parameters.
 
Methods inherited from class javax.media.jai.OperationDescriptorImpl
arePropertiesSupported, getDefaultSourceClass, getDestClass, getDestClass, getInvalidRegion, getName, getNumParameters, getNumSources, getParamClasses, getParamDefaults, getParamDefaultValue, getParameterListDescriptor, getParamMaxValue, getParamMinValue, getParamNames, getPropertyGenerators, getPropertyGenerators, getRenderableDestClass, getRenderableSourceClasses, getResourceBundle, getResources, getSourceClasses, getSourceClasses, getSourceNames, getSupportedModes, isModeSupported, isRenderableSupported, isRenderedSupported, makeDefaultSourceClassList, validateArguments, validateParameters, validateParameters, validateRenderableArguments, validateRenderableSources, validateSources, validateSources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileStoreDescriptor

public FileStoreDescriptor()
Constructor.

Method Detail

validateArguments

public boolean validateArguments(String modeName,
                                 ParameterBlock args,
                                 StringBuffer msg)
Validates the input source and parameters.

In addition to the standard checks performed by the superclass method, this method checks that the format name is recognized and is capable of encoding the source image using the encoding parameter "param", if non-null, ans that the output file path "filename" is writable.

Specified by:
validateArguments in interface OperationDescriptor
Overrides:
validateArguments in class OperationDescriptorImpl
Parameters:
modeName - the operation mode name
args - Input arguments, including source(s) and/or parameter(s).
msg - A string that may contain error messages.
See Also:
OperationDescriptorImpl.validateSources(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer), OperationDescriptorImpl.validateParameters(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer)

isImmediate

public boolean isImmediate()
Returns true indicating that the operation should be rendered immediately during a call to JAI.create().

Specified by:
isImmediate in interface OperationDescriptor
Overrides:
isImmediate in class OperationDescriptorImpl
See Also:
OperationDescriptor

create

public static RenderedOp create(RenderedImage source0,
                                String filename,
                                String format,
                                ImageEncodeParam param,
                                Boolean checkFileLocally,
                                RenderingHints hints)
Stores an image to a file.

Creates a ParameterBlockJAI from all supplied arguments except hints and invokes JAI.create(String,ParameterBlock,RenderingHints).

Parameters:
source0 - RenderedImage source 0.
filename - The path of the file to write to.
format - The format of the file. May be null.
param - The encoding parameters. May be null.
checkFileLocally - Boolean specifying whether check for file creation / writing locally should be done. May be null.
hints - The RenderingHints to use. May be null.
Returns:
The RenderedOp destination.
Throws:
IllegalArgumentException - if source0 is null.
IllegalArgumentException - if filename is null.
See Also:
JAI, ParameterBlockJAI, RenderedOp