org.eclipse.ecf.provider.xmpp.identity
Class XMPPFileID

java.lang.Object
  extended by org.eclipse.ecf.core.identity.BaseID
      extended by org.eclipse.ecf.provider.xmpp.identity.XMPPFileID
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable, java.security.Principal, org.eclipse.core.runtime.IAdaptable, ID, IFileID

public class XMPPFileID
extends BaseID
implements IFileID

XMPPFileID for use with the XMPP outgoing file transfer.

See Also:
Serialized Form

Field Summary
static java.lang.String FILENAME_KEY
           
static java.lang.String XMPPIDNAMESPACE_KEY
           
 
Fields inherited from class org.eclipse.ecf.core.identity.BaseID
namespace
 
Constructor Summary
XMPPFileID(XMPPID id, java.lang.String fn)
           
 
Method Summary
static java.lang.String createQuery(java.lang.String filename, java.lang.String xmppidScheme)
           
static java.net.URL createURL(XMPPID xmppid2, java.lang.String filename2)
           
 java.lang.String getFilename()
          Get the file name from this IFileID.
 java.net.URI getURI()
          Get the URI associated with the file identified by this IFileID.
 java.net.URL getURL()
          Get the url associated with the file identified by this IFileID.
 XMPPID getXMPPID()
           
protected  int namespaceCompareTo(BaseID o)
          Called by Namespace.getCompareToForObject(BaseID, BaseID).
protected  boolean namespaceEquals(BaseID o)
          Called by Namespace.testIDEquals(BaseID, BaseID).
protected  java.lang.String namespaceGetName()
          Called by Namespace.getNameForID(BaseID).
protected  int namespaceHashCode()
          Called by Namespace.getHashCodeForID(BaseID).
 java.lang.String toExternalForm()
          Get this ID instance in String form.
 
Methods inherited from class org.eclipse.ecf.core.identity.BaseID
compareTo, equals, getAdapter, getName, getNamespace, hashCode, namespaceToExternalForm
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ecf.core.identity.ID
equals, getName, getNamespace, hashCode
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface java.security.Principal
toString
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

FILENAME_KEY

public static final java.lang.String FILENAME_KEY
See Also:
Constant Field Values

XMPPIDNAMESPACE_KEY

public static final java.lang.String XMPPIDNAMESPACE_KEY
See Also:
Constant Field Values
Constructor Detail

XMPPFileID

public XMPPFileID(XMPPID id,
                  java.lang.String fn)
           throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException
Method Detail

createURL

public static java.net.URL createURL(XMPPID xmppid2,
                                     java.lang.String filename2)
                              throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

createQuery

public static java.lang.String createQuery(java.lang.String filename,
                                           java.lang.String xmppidScheme)
                                    throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

getXMPPID

public XMPPID getXMPPID()

toExternalForm

public java.lang.String toExternalForm()
Description copied from interface: ID
Get this ID instance in String form. Will not return null.

Specified by:
toExternalForm in interface ID
Overrides:
toExternalForm in class BaseID
Returns:
String that is external representation of this ID

namespaceCompareTo

protected int namespaceCompareTo(BaseID o)
Description copied from class: BaseID
Called by Namespace.getCompareToForObject(BaseID, BaseID).

Specified by:
namespaceCompareTo in class BaseID
Parameters:
o - the other ID to compare to. Will not be null.
Returns:
the appropriate value as per Comparable contract.

namespaceEquals

protected boolean namespaceEquals(BaseID o)
Description copied from class: BaseID
Called by Namespace.testIDEquals(BaseID, BaseID).

Specified by:
namespaceEquals in class BaseID
Parameters:
o - the other ID to test against. May be null.
Returns:
true if this ID is equal to the given ID. false otherwise.

namespaceGetName

protected java.lang.String namespaceGetName()
Description copied from class: BaseID
Called by Namespace.getNameForID(BaseID).

Specified by:
namespaceGetName in class BaseID
Returns:
String name for this ID. Must not be null. Value returned should be unique within this Namespace.

namespaceHashCode

protected int namespaceHashCode()
Description copied from class: BaseID
Called by Namespace.getHashCodeForID(BaseID).

Specified by:
namespaceHashCode in class BaseID
Returns:
int hashCode for this ID. Returned value must be unique within this process.

getFilename

public java.lang.String getFilename()
Description copied from interface: IFileID
Get the file name from this IFileID. This will return just the filename portion of a more complex file ID, e.g. index.html from IFileID created with value "http://www.composent.com/index.html"

Specified by:
getFilename in interface IFileID
Returns:
String just the file name and extension (if any) for this given IFileID. Will not be null.

getURL

public java.net.URL getURL()
                    throws java.net.MalformedURLException
Description copied from interface: IFileID
Get the url associated with the file identified by this IFileID.

Specified by:
getURL in interface IFileID
Returns:
URL associated with this IFileID. Will not be null.
Throws:
java.net.MalformedURLException - thrown if URL cannot be created for this IFileID

getURI

public java.net.URI getURI()
                    throws java.net.URISyntaxException
Description copied from interface: IFileID
Get the URI associated with the file identified by this IFileID.

Specified by:
getURI in interface IFileID
Returns:
URI associated with this IFileID. Will not be null.
Throws:
java.net.URISyntaxException - thrown if URI cannot be created for this IFileID.
Since:
3.2