com.atlassian.renderer.embedded
Class EmbeddedResource

java.lang.Object
  extended by com.atlassian.renderer.embedded.EmbeddedResource
Direct Known Subclasses:
EmbeddedImage, EmbeddedObject

public class EmbeddedResource
extends java.lang.Object

Link to an embedded mime resource.


Field Summary
protected  java.lang.String filename
          The filename of this resource.
protected  java.lang.String originalText
          The original (unparsed) embedded link text.
protected  java.lang.String page
          The confluence page to which the resource is attached.
protected  EmbeddedResourceParser parser
          Embedded resource parser, available for accessing the original embedded text.
protected  java.util.Properties properties
          The resource properties
protected  java.lang.String space
          The confluence space to which the resource is attached.
protected  java.lang.String type
          The mime type of this resource.
protected  java.lang.String url
          The unparsed reference to the embedded resource.
 
Constructor Summary
EmbeddedResource(EmbeddedResourceParser parser)
          Create a new EmbeddedResource.
EmbeddedResource(java.lang.String originalText)
          Create a new Embedded resource using embedded resource text.
 
Method Summary
 java.lang.String getFilename()
           
 java.lang.String getOriginalLinkText()
          Retrieve the original embedded resource text.
 java.lang.String getPage()
          The name of the page this resource is attached to.
 java.util.Properties getProperties()
           
 java.lang.String getSpace()
          The name of the space this resource is attached to.
 java.lang.String getType()
          Retrieve the resource mime type, or null if the type is unknown.
 java.lang.String getUrl()
           
 boolean isExternal()
          Returns true if the resource is external to confluence.
 boolean isInternal()
          Returns true if this resource is internal to confluence.
static boolean matchesType(EmbeddedResourceParser parser)
          Returns whether this class will handle the given file or not
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parser

protected final EmbeddedResourceParser parser
Embedded resource parser, available for accessing the original embedded text.


filename

protected final java.lang.String filename
The filename of this resource.


type

protected final java.lang.String type
The mime type of this resource.


page

protected final java.lang.String page
The confluence page to which the resource is attached. This applies for relative/internal resources only.


space

protected final java.lang.String space
The confluence space to which the resource is attached. This applied for relative/internal resources only.


url

protected final java.lang.String url
The unparsed reference to the embedded resource. ie: if external, this is a URL, if internal it is space:page^filename.ext


originalText

protected final java.lang.String originalText
The original (unparsed) embedded link text.


properties

protected java.util.Properties properties
The resource properties

Constructor Detail

EmbeddedResource

public EmbeddedResource(EmbeddedResourceParser parser)
Create a new EmbeddedResource.

Parameters:
parser -

EmbeddedResource

public EmbeddedResource(java.lang.String originalText)
Create a new Embedded resource using embedded resource text.

Parameters:
originalText -
Method Detail

matchesType

public static boolean matchesType(EmbeddedResourceParser parser)
                           throws java.lang.IllegalArgumentException
Returns whether this class will handle the given file or not

Parameters:
parser - The parser for the file
Returns:
True is there is a match, false otherwise
Throws:
java.lang.IllegalArgumentException

isExternal

public boolean isExternal()
Returns true if the resource is external to confluence.

Returns:

isInternal

public boolean isInternal()
Returns true if this resource is internal to confluence.

Returns:

getUrl

public java.lang.String getUrl()

getFilename

public java.lang.String getFilename()

getType

public java.lang.String getType()
Retrieve the resource mime type, or null if the type is unknown.

Returns:

getOriginalLinkText

public java.lang.String getOriginalLinkText()
Retrieve the original embedded resource text. This represents the text as entered in the wiki markup.

Returns:

getSpace

public java.lang.String getSpace()
The name of the space this resource is attached to. The space name is only relevant for internal resources.

Returns:
See Also:
isInternal()

getPage

public java.lang.String getPage()
The name of the page this resource is attached to. The page name is only relevant for internal resources.

Returns:
See Also:
isInternal()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getProperties

public java.util.Properties getProperties()


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.