|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.webservice.util.ContentUtils
public class ContentUtils
Content Utils Class
Field Summary | |
---|---|
static int |
BUFFER_SIZE
|
Constructor Summary | |
---|---|
ContentUtils()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BUFFER_SIZE
Constructor Detail |
---|
public ContentUtils()
Method Detail |
---|
public static byte[] convertToByteArray(java.io.InputStream inputStream) throws java.lang.Exception
inputStream
- the input stream
java.lang.Exception
public static java.lang.String getContentAsString(org.alfresco.webservice.content.Content content)
content
- the content object
public 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 repository
public 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 repository
public 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 null
public 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 null
public 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 used
public 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.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |