public class ContentUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
BUFFER_SIZE |
| Constructor and Description |
|---|
ContentUtils() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
convertToByteArray(java.io.InputStream inputStream)
Convert an input stream to a byte array
|
static int |
copy(java.io.InputStream in,
java.io.OutputStream out)
Helper method to copy from one stream to another
|
static void |
copyContentToFile(org.alfresco.webservice.content.Content content,
java.io.File file)
Copy the content into a given file.
|
static java.io.InputStream |
getContentAsInputStream(org.alfresco.webservice.content.Content content)
Get the content as an imput stream
|
static java.lang.String |
getContentAsString(org.alfresco.webservice.content.Content content)
Get the content from the download servlet as a string
|
static java.lang.String |
putContent(java.io.File file)
Streams content into the repository.
|
static java.lang.String |
putContent(java.io.File file,
java.lang.String host,
int port)
Streams content into the repository.
|
static java.lang.String |
putContent(java.io.File file,
java.lang.String host,
int port,
java.lang.String mimetype,
java.lang.String encoding)
Streams content into the repository.
|
static java.lang.String |
putContent(java.io.File file,
java.lang.String host,
int port,
java.lang.String webAppName,
java.lang.String mimetype,
java.lang.String encoding)
Streams content into the repository using nonSSL connection.
|
static java.lang.String |
putContent(java.io.File file,
java.lang.String host,
int port,
java.lang.String webAppName,
java.lang.String mimetype,
java.lang.String encoding,
boolean isSSL)
Streams content into the repository.
|
public static final int BUFFER_SIZE
public static byte[] convertToByteArray(java.io.InputStream inputStream)
throws java.lang.Exception
inputStream - the input streamjava.lang.Exceptionpublic static java.lang.String getContentAsString(org.alfresco.webservice.content.Content content)
content - the content objectpublic static java.io.InputStream getContentAsInputStream(org.alfresco.webservice.content.Content content)
content - public static java.lang.String putContent(java.io.File file)
file - the file to stream into the repositorypublic static java.lang.String putContent(java.io.File file,
java.lang.String host,
int port)
file - the file to stream into the repositoryhost - the host name of the destination repositoryport - the port name of the destination repositorypublic static java.lang.String putContent(java.io.File file,
java.lang.String host,
int port,
java.lang.String mimetype,
java.lang.String encoding)
file - the file to stream into the repositoryhost - the host name of the destination repositoryport - the port name of the destination repositorymimetype - the mimetype of the file, ignored if nullencoding - the encoding of the file, ignored if nullpublic static java.lang.String putContent(java.io.File file,
java.lang.String host,
int port,
java.lang.String webAppName,
java.lang.String mimetype,
java.lang.String encoding)
file - the file to stream into the repositoryhost - the host name of the destination repositoryport - the port name of the destination repositorywebAppName - the name of the target web application (default 'alfresco')mimetype - the mimetype of the file, ignored if nullencoding - the encoding of the file, ignored if nullpublic static java.lang.String putContent(java.io.File file,
java.lang.String host,
int port,
java.lang.String webAppName,
java.lang.String mimetype,
java.lang.String encoding,
boolean isSSL)
file - the file to stream into the repositoryhost - the host name of the destination repositoryport - the port name of the destination repositorywebAppName - the name of the target web application (default 'alfresco')mimetype - the mimetype of the file, ignored if nullencoding - the encoding of the file, ignored if nullisSSL - true if HTTPS protocol is usedpublic static void copyContentToFile(org.alfresco.webservice.content.Content content,
java.io.File file)
content - the content objectfile - the filepublic static int copy(java.io.InputStream in,
java.io.OutputStream out)
throws java.io.IOException
in - out - java.io.IOExceptionCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.