Sweet Home 3D 3.4

com.eteks.sweethome3d.tools
Class URLContent

java.lang.Object
  extended by com.eteks.sweethome3d.tools.URLContent
All Implemented Interfaces:
Content, java.io.Serializable
Direct Known Subclasses:
ResourceURLContent, TemporaryURLContent

public class URLContent
extends java.lang.Object
implements Content

URL content for files, images...

Author:
Emmanuel Puybaret
See Also:
Serialized Form

Constructor Summary
URLContent(java.net.URL url)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
          Returns true if the object in parameter is an URL content that references the same URL as this object.
 java.lang.String getJAREntryName()
          Returns the name of a JAR entry.
 java.net.URL getJAREntryURL()
          Returns the URL base of a JAR entry.
 java.net.URL getURL()
          Returns the URL of this content.
 int hashCode()
           
 boolean isJAREntry()
          Returns true if the URL stored by this content references an entry in a JAR.
 java.io.InputStream openStream()
          Returns an InputStream on the URL content.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLContent

public URLContent(java.net.URL url)
Method Detail

getURL

public java.net.URL getURL()
Returns the URL of this content.


openStream

public java.io.InputStream openStream()
                               throws java.io.IOException
Returns an InputStream on the URL content.

Specified by:
openStream in interface Content
Throws:
java.io.IOException - if URL stream can't be opened.

isJAREntry

public boolean isJAREntry()
Returns true if the URL stored by this content references an entry in a JAR.


getJAREntryURL

public java.net.URL getJAREntryURL()
Returns the URL base of a JAR entry.

Throws:
java.lang.IllegalStateException - if the URL of this content doesn't reference an entry in a JAR.

getJAREntryName

public java.lang.String getJAREntryName()
Returns the name of a JAR entry. If the JAR entry in the URL given at creation time was encoded in application/x-www-form-urlencoded format, this method will return it unchanged and not decoded.

Throws:
java.lang.IllegalStateException - if the URL of this content doesn't reference an entry in a JAR URL.

equals

public boolean equals(java.lang.Object obj)
Returns true if the object in parameter is an URL content that references the same URL as this object.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

Sweet Home 3D 3.4

? Copyrights 2006-2011 eTeks - All rights reserved
Distributed under GNU General Public License