org.astrogrid.store
Class Msrl

java.lang.Object
  extended byorg.astrogrid.store.Msrl

public class Msrl
extends java.lang.Object

MySpace Resource Locator. An Myspace-specific way of identifying a file (or the location to create a file) in MySpace

It is of the form:

    myspace:{delegateendpoint}[#{myspacepath}[!{serverId}]]
 
or
    myspace:{ivorn}[#{myspacepath}[!{serverId}]]
 
If the path fragment is empty, the MSRL refers to a myspace store service


Field Summary
static java.lang.String FORM
           
static java.lang.String SCHEME
           
 
Constructor Summary
Msrl(Ivorn aManagerIvorn, java.lang.String myspacePath)
          Make a single myspace:// reference string out of a delegate endpoint (eg a myspace manager service) and a path to the file
Msrl(java.lang.String msrl)
          Make a reference from the given string representation
Msrl(java.net.URL aDelegateEndpoint)
          Make a single myspace:// reference string out of a delegate endpoint
Msrl(java.net.URL aDelegateEndpoint, java.lang.String myspacePath)
          Make a single myspace:// reference string out of a delegate endpoint (eg a myspace manager service) and a path to the file
Msrl(java.net.URL aDelegateEndpoint, java.lang.String myspacePath, java.lang.String aServer)
          Make a single myspace:// reference string out of a delegate endpoint (eg a myspace manager service) and a path to the file.
 
Method Summary
 java.net.URL getDelegateEndpoint()
          Returns just the delegate end point
 java.lang.String getFilename()
          Returns the file part of the reference - ie the text after the last slash, which may be an empty string if this is a directory
 Ivorn getManagerIvorn()
          Returns just the ivorn to the manager
 Msrl getManagerMsrl()
          Returns the manager location as an MSRL
 java.lang.String getName()
          Returns the name part of the reference - ie the last token broken by slashes.
 java.lang.String getPath()
          Returns the myspace filepath
 java.lang.String getServer()
          Returns the server ID
static boolean isMsrl(java.lang.String msrl)
          Returns true if the given string is an attempt to be a vospace reference
 java.io.InputStream openInputStream()
          Opens an inputstream to the file.
 java.io.OutputStream openOutputStream()
          Opens an outputstream to the file.
 java.net.URL resolveURL()
          Returns a standard URL to the file
 java.lang.String toString()
          This string must be reversable through the above constructor, ie for valid msrl string s: new Msrl(s).toString().equals(s); must be true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SCHEME

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

FORM

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

Msrl

public Msrl(java.net.URL aDelegateEndpoint)
Make a single myspace:// reference string out of a delegate endpoint


Msrl

public Msrl(java.net.URL aDelegateEndpoint,
            java.lang.String myspacePath)
Make a single myspace:// reference string out of a delegate endpoint (eg a myspace manager service) and a path to the file


Msrl

public Msrl(Ivorn aManagerIvorn,
            java.lang.String myspacePath)
Make a single myspace:// reference string out of a delegate endpoint (eg a myspace manager service) and a path to the file


Msrl

public Msrl(java.net.URL aDelegateEndpoint,
            java.lang.String myspacePath,
            java.lang.String aServer)
Make a single myspace:// reference string out of a delegate endpoint (eg a myspace manager service) and a path to the file. In this case we also define explicitly which myspace server to use - which should only apply to put-to-myspace calls (should this be an IVORN?)


Msrl

public Msrl(java.lang.String msrl)
     throws java.net.MalformedURLException
Make a reference from the given string representation

Method Detail

toString

public java.lang.String toString()
This string must be reversable through the above constructor, ie for valid msrl string s: new Msrl(s).toString().equals(s); must be true.


getDelegateEndpoint

public java.net.URL getDelegateEndpoint()
Returns just the delegate end point


getManagerIvorn

public Ivorn getManagerIvorn()
Returns just the ivorn to the manager


getPath

public java.lang.String getPath()
Returns the myspace filepath


getServer

public java.lang.String getServer()
Returns the server ID


getFilename

public java.lang.String getFilename()
Returns the file part of the reference - ie the text after the last slash, which may be an empty string if this is a directory


getName

public java.lang.String getName()
Returns the name part of the reference - ie the last token broken by slashes. If the last character is a slash, this indicates a directory and the previous token is returned


getManagerMsrl

public Msrl getManagerMsrl()
Returns the manager location as an MSRL


isMsrl

public static boolean isMsrl(java.lang.String msrl)
Returns true if the given string is an attempt to be a vospace reference


openInputStream

public java.io.InputStream openInputStream()
                                    throws java.io.IOException
Opens an inputstream to the file. Just like url.openStream()....

Throws:
java.io.IOException

openOutputStream

public java.io.OutputStream openOutputStream()
                                      throws java.io.IOException
Opens an outputstream to the file.

Throws:
java.io.IOException

resolveURL

public java.net.URL resolveURL()
                        throws java.io.IOException
Returns a standard URL to the file

Throws:
java.io.IOException


Copyright © 2002-2005 AstroGrid. All Rights Reserved.