eu.planets_project.services.datatypes
Class Content

java.lang.Object
  extended by eu.planets_project.services.datatypes.Content

public final class Content
extends java.lang.Object

Static factory methods for content creation.


Method Summary
static DigitalObjectContent byReference(java.io.File reference)
          Create (streamed) content by reference, from a file.
static DigitalObjectContent byReference(java.io.InputStream inputStream)
          Create (streamed) content by reference, from an input stream.
static DigitalObjectContent byReference(java.net.URI reference)
          Create content by reference.
static DigitalObjectContent byReference(java.net.URL reference)
          Create content by reference.
static DigitalObjectContent byValue(byte[] value)
          Create content by value (actually embedded in the request).
static DigitalObjectContent byValue(java.io.File value)
          Create content by value (actually embedded in the request).
static DigitalObjectContent byValue(java.io.InputStream inputStream)
          Create content by value (actually embedded in the request).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

byReference

public static DigitalObjectContent byReference(java.net.URL reference)
Create content by reference.

Parameters:
reference - The URL reference to the actual content
Returns:
A content instance referencing the given location

byReference

public static DigitalObjectContent byReference(java.net.URI reference)
Create content by reference.

Parameters:
reference - The URI reference to the content
Returns:
A content instance referencing the given location

byReference

public static DigitalObjectContent byReference(java.io.File reference)
Create (streamed) content by reference, from a file. Note that the file must be left in place long enough for the web service client to complete the access.

Parameters:
reference - The reference to the actual content value, using a File whose content will be streamed over the connection.
Returns:
A content instance referencing the given location.

byReference

public static DigitalObjectContent byReference(java.io.InputStream inputStream)
Create (streamed) content by reference, from an input stream.

Parameters:
inputStream - The InputStream containing the value for the content.
Returns:
A content instance with the specified value

byValue

public static DigitalObjectContent byValue(byte[] value)
Create content by value (actually embedded in the request).

Parameters:
value - The value bytes for the content
Returns:
A content instance with the specified value

byValue

public static DigitalObjectContent byValue(java.io.File value)
Create content by value (actually embedded in the request).

Parameters:
value - The value file for the content.
Returns:
A content instance with the specified value

byValue

public static DigitalObjectContent byValue(java.io.InputStream inputStream)
Create content by value (actually embedded in the request).

Parameters:
inputStream - The InputStream containing the value for the content.
Returns:
A content instance with the specified value


Copyright © 2007-2010 The Planets Consortium. All Rights Reserved.