Version: 1.1.1

ca.ucalgary.seahawk.util
Class HTMLUtils

java.lang.Object
  extended by ca.ucalgary.seahawk.util.HTMLUtils

public class HTMLUtils
extends Object


Field Summary
static String ACCEPTABLE_IMAGE_DATATYPE
           
static String BINARY_DATA_LABEL
           
 
Constructor Summary
HTMLUtils()
           
 
Method Summary
static String checkForHyperlinkText(String text)
          Extracts a URL string from a given piece of text iof that's all it contains.
static MobyContentInstance checkForMobyXML(String text)
          Given an HTML fragment (e.g. cut'n'pasted from a browser), see if we unescape the HTML we get a MOBY XML block (e.g. from the biomoby.org web site examples).
static URL checkForURLShortcut(File file)
          Turns a file into a URL if the file was URL shortcut (Windows & Gnome).
static String encapsulateBinaryData(URL sourceMobyData, String html)
           
static String encapsulateBinaryData(URL sourceMobyData, String html, Registry registry)
           
static String getInputStreamContents(InputStream resourceStream)
          Convenience method to grab all data from a input stream into a String.
static byte[] getURLContentBytes(URL u)
          Convenience method to grab all data from a URL as a byte array (in case it's not text)
static String getURLContents(URL u)
          Convenience method to grab all data from a URL into a String.
static String htmlifyToolTipText(String text, int maxLineLength)
          By turning the tool tip text into HTML, we can make it multiline!
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BINARY_DATA_LABEL

public static final String BINARY_DATA_LABEL
See Also:
Constant Field Values

ACCEPTABLE_IMAGE_DATATYPE

public static final String ACCEPTABLE_IMAGE_DATATYPE
See Also:
Constant Field Values
Constructor Detail

HTMLUtils

public HTMLUtils()
Method Detail

encapsulateBinaryData

public static String encapsulateBinaryData(URL sourceMobyData,
                                           String html)
                                    throws Exception
Throws:
Exception

encapsulateBinaryData

public static String encapsulateBinaryData(URL sourceMobyData,
                                           String html,
                                           Registry registry)
                                    throws Exception
Throws:
Exception

checkForHyperlinkText

public static String checkForHyperlinkText(String text)
Extracts a URL string from a given piece of text iof that's all it contains. Especially suited for dropped URL's etc. from browsers, as it cleans up the HTML junk browsers wrap links in.


checkForURLShortcut

public static URL checkForURLShortcut(File file)
                               throws Exception
Turns a file into a URL if the file was URL shortcut (Windows & Gnome).

Throws:
Exception

htmlifyToolTipText

public static String htmlifyToolTipText(String text,
                                        int maxLineLength)
By turning the tool tip text into HTML, we can make it multiline!


checkForMobyXML

public static MobyContentInstance checkForMobyXML(String text)
Given an HTML fragment (e.g. cut'n'pasted from a browser), see if we unescape the HTML we get a MOBY XML block (e.g. from the biomoby.org web site examples).


getURLContents

public static String getURLContents(URL u)
                             throws IOException
Convenience method to grab all data from a URL into a String.

Throws:
IOException

getURLContentBytes

public static byte[] getURLContentBytes(URL u)
                                 throws IOException
Convenience method to grab all data from a URL as a byte array (in case it's not text)

Throws:
IOException

getInputStreamContents

public static String getInputStreamContents(InputStream resourceStream)
                                     throws IOException
Convenience method to grab all data from a input stream into a String.

Throws:
IOException

Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010