org.astrogrid.store
Class VoSpaceClient

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

public class VoSpaceClient
extends java.lang.Object

This delegate provides methods for operating on files in VoSpace - that is, files that are on store points (accessible through StoreClient implementations) that are Registered in IVO Registries and/or Communities.

Note that there is a difference between the user (termed operator here) of this class, and the owner of the files that might be being browsed.


Constructor Summary
VoSpaceClient(User anOperator)
          Constructor - instances of this class represent a particular user/account
 
Method Summary
 void copy(Ivorn source, Ivorn target)
          Copy a file
 Ivorn createUser(Ivorn targetVoSpace, Ivorn user)
          Creates a new user (identified by the given user ivorn) on the storepoint given by the 'target' Ivorn.
 void delete(Ivorn toDelete)
          Delete a file
 void deleteUser(Ivorn target, Ivorn user)
           
 StoreClient getDelegate(Ivorn storeIvorn)
          Returns a StoreClient delegate for the given ivorn for direct file manipulation
 StoreFile getFile(Ivorn fileIvorn)
          Returns the StoreFile representation of the file at the given AGSL
 User getOperator()
          Returns the user of this delegate - ie the account it is being used by
 java.io.InputStream getStream(Ivorn source)
          Gets a file's contents as a stream
 void move(Ivorn source, Ivorn target)
          Moves/Renames a file
 void newFolder(Ivorn target)
          Create a container
 void putBytes(byte[] bytes, int offset, int length, Ivorn targetIvorn, boolean append)
          Puts the given byte buffer from offset of length bytes, to the given target
 java.io.OutputStream putStream(Ivorn target)
          Streaming output - returns a stream that can be used to output to the given location
 void putUrl(java.net.URL source, Ivorn targetIvorn, boolean append)
          Copies the contents of the file at the given source url to the given location
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VoSpaceClient

public VoSpaceClient(User anOperator)
Constructor - instances of this class represent a particular user/account

Method Detail

getOperator

public User getOperator()
Returns the user of this delegate - ie the account it is being used by


getFile

public StoreFile getFile(Ivorn fileIvorn)
                  throws java.io.IOException
Returns the StoreFile representation of the file at the given AGSL

Throws:
java.io.IOException

getDelegate

public StoreClient getDelegate(Ivorn storeIvorn)
                        throws java.io.IOException
Returns a StoreClient delegate for the given ivorn for direct file manipulation

Throws:
java.io.IOException

putBytes

public void putBytes(byte[] bytes,
                     int offset,
                     int length,
                     Ivorn targetIvorn,
                     boolean append)
              throws java.io.IOException
Puts the given byte buffer from offset of length bytes, to the given target

Throws:
java.io.IOException

putUrl

public void putUrl(java.net.URL source,
                   Ivorn targetIvorn,
                   boolean append)
            throws java.io.IOException
Copies the contents of the file at the given source url to the given location

Throws:
java.io.IOException

putStream

public java.io.OutputStream putStream(Ivorn target)
                               throws java.io.IOException
Streaming output - returns a stream that can be used to output to the given location

Throws:
java.io.IOException

getStream

public java.io.InputStream getStream(Ivorn source)
                              throws java.io.IOException
Gets a file's contents as a stream

Throws:
java.io.IOException

delete

public void delete(Ivorn toDelete)
            throws java.io.IOException
Delete a file

Throws:
java.io.IOException

copy

public void copy(Ivorn source,
                 Ivorn target)
          throws java.io.IOException
Copy a file

Throws:
java.io.IOException

move

public void move(Ivorn source,
                 Ivorn target)
          throws java.io.IOException
Moves/Renames a file

Throws:
java.io.IOException

newFolder

public void newFolder(Ivorn target)
               throws java.io.IOException
Create a container

Throws:
java.io.IOException

createUser

public Ivorn createUser(Ivorn targetVoSpace,
                        Ivorn user)
                 throws java.io.IOException,
                        java.net.URISyntaxException
Creates a new user (identified by the given user ivorn) on the storepoint given by the 'target' Ivorn.

Throws:
java.io.IOException
java.net.URISyntaxException

deleteUser

public void deleteUser(Ivorn target,
                       Ivorn user)
                throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2002-2005 AstroGrid. All Rights Reserved.