org.webdocwf.util.smime.test
Class ExampleGenerator

java.lang.Object
  |
  +--org.webdocwf.util.smime.test.ExampleGenerator

public class ExampleGenerator
extends java.lang.Object

Class for storing and generation of resources used in test examples. This class is intended for simulation of contents generated by program and attachments for composing email messages.


Constructor Summary
ExampleGenerator()
           
 
Method Summary
 java.io.ByteArrayInputStream getGifImage()
          Returns image file green.gif as ByteArrayInputStream
 java.io.ByteArrayInputStream getHtmlStream()
          Returns HTML code from storage.
 java.lang.String getHtmlString()
          Returns HTML code from storage.
 java.io.ByteArrayInputStream getZipStream()
          Returns zip file generated by program as ByteArrayInputStream
 void setResourceInExampleHtml(java.lang.String name0, java.lang.String value0)
          Sets value to corresponding resource in html code (in this example it is one of pictures: red.gif, blue.gif, green.gif, yellow.jpg or orange.jpg).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExampleGenerator

public ExampleGenerator()
Method Detail

setResourceInExampleHtml

public void setResourceInExampleHtml(java.lang.String name0,
                                     java.lang.String value0)
Sets value to corresponding resource in html code (in this example it is one of pictures: red.gif, blue.gif, green.gif, yellow.jpg or orange.jpg).
Parameters:
name0 - name of desired resource. Can be: "RED", "BLUE", "YELLOW", "GREEN" or "ORANGE". If wrong value is given to argument, default value is taken in methods getHtmlStream and getHtmlString (default values are relative adresses and they can be seen from orginal html file: HtmlTest.html).
value0 - value which is given to appropriate resource (relative or absolute path, http://... or file://... url, or virtual_file_name value used for IputStream resources).

getHtmlString

public java.lang.String getHtmlString()
Returns HTML code from storage.
Returns:
HTML code represented as a String

getHtmlStream

public java.io.ByteArrayInputStream getHtmlStream()
                                           throws java.io.UnsupportedEncodingException
Returns HTML code from storage.
Returns:
HTML code represented as a ByteArrayInputStream

getZipStream

public java.io.ByteArrayInputStream getZipStream()
                                          throws java.io.IOException,
                                                 SMIMEException
Returns zip file generated by program as ByteArrayInputStream
Returns:
zip file represented as ByteArrayInputStream

getGifImage

public java.io.ByteArrayInputStream getGifImage()
Returns image file green.gif as ByteArrayInputStream
Returns:
gif image represented as ByteArrayInputStream


Copyright © 2002-2002 Together Teamlösungen. All Rights Reserved.