com.sapportals.wcm.util.urlcontentaccess

Class URLContentAccess

java.lang.Object
  extended by com.sapportals.wcm.util.urlcontentaccess.URLContentAccess
All Implemented Interfaces:
IURLContentAccess

public final class URLContentAccess
extends Object
implements IURLContentAccess

Handles the content transfer for external URL resources. Supported protocols: http, https, ftp, file. A proxy and a list of hosts that must not use the proxy can be configured. Using https through a proxy is not supported.


Constructor Summary
URLContentAccess()
           
 
Method Summary
static IURLContentAccess getInstance()
          Returns a reference to the single instance.
 IURLContent readContent(String url, boolean useCache)
          Read content
 IURLContent readContent(String cacheID, String url, boolean useCache)
          Read the content for a URL resource.
 void storeContent(String url, InputStream data, String mimeType, long contentLength, String fileName, Properties httpHeaders, Properties fileHeaders, boolean useMimeMultipart, String user, String pass)
          Store content on a HTTP Server
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLContentAccess

public URLContentAccess()
Method Detail

readContent

public IURLContent readContent(String url,
                               boolean useCache)
                        throws URLContentAccessException
Read content

Specified by:
readContent in interface IURLContentAccess
Parameters:
url - TBD: Description of the incoming method parameter
useCache - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value
Throws:
URLContentAccessException - Exception raised in failure situation

readContent

public IURLContent readContent(String cacheID,
                               String url,
                               boolean useCache)
                        throws URLContentAccessException
Read the content for a URL resource. Note: Content from plug-ins is not cached (parameter useCache has no effect).

Specified by:
readContent in interface IURLContentAccess
Parameters:
cacheID - The key to store/access the content in the cache
url - A full URL
useCache - If the cache must be used
Returns:
Reference to a content object
Throws:
URLContentAccessException - Exception raised in failure situation

storeContent

public void storeContent(String url,
                         InputStream data,
                         String mimeType,
                         long contentLength,
                         String fileName,
                         Properties httpHeaders,
                         Properties fileHeaders,
                         boolean useMimeMultipart,
                         String user,
                         String pass)
                  throws URLContentAccessException
Store content on a HTTP Server

Specified by:
storeContent in interface IURLContentAccess
Parameters:
url - The URL
data - The data to send
mimeType - The content type
contentLength - The content length
fileName - The file name, can be null
httpHeaders - Additional HTTP header, can be null
fileHeaders - File header lines, can be null
useMimeMultipart - true: send a mime multipart POST, false: PUT request
user - Username for HTTP BASIC authentication, can be null
pass - PAssword for HTTP BASIC authentication, can be null
Throws:
URLContentAccessException - Exception raised in failure situation

getInstance

public static IURLContentAccess getInstance()
                                     throws URLContentAccessException
Returns a reference to the single instance.

Returns:
The instance
Throws:
URLContentAccessException
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-CM [sap.com] tc/km/frwk api EP-KM-CM
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM


Copyright 2014 SAP AG Complete Copyright Notice