public class ServletIOUtil extends Object
| Constructor and Description |
|---|
ServletIOUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addToRecentFiles(long userId,
long docId)
Adds the given document to the recent files entry of the user
|
static void |
downloadDocument(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String sid,
long docId,
String fileVersion,
String fileName,
String suffix,
User user)
Sends the specified document to the response object; the client will
receive it as a download
|
static void |
downloadDocument(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String sid,
String docId,
String fileVersion,
String fileName,
User user)
Sends the specified document to the response object; the client will
receive it as a download
|
static void |
downloadDocumentText(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
long docId,
User user)
Sends the specified document's indexed text to the response object; the
client will receive it as a download
|
static void |
downloadFile(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
File file,
String fileName)
Sends the specified file to the response object; the client will receive
it as a download
|
static void |
downloadPluginResource(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String sid,
String pluginName,
String resourcePath,
String fileName)
Downloads a plugin resource
|
static void |
setContentDisposition(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String filename,
boolean asAttachment)
Sets the correct Content-Disposition header into the response
|
static void |
uploadDocumentResource(javax.servlet.http.HttpServletRequest request,
String docId,
String suffix,
String fileVersion,
String docVersion)
Uploads a document's related resource.
|
public static void addToRecentFiles(long userId,
long docId)
userId - the id of the user accessing the filedocId - id of the document the user accessedpublic static void downloadPluginResource(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String sid,
String pluginName,
String resourcePath,
String fileName)
throws FileNotFoundException,
IOException,
javax.servlet.ServletException
request - response - pluginName - name of the plug-inresourcePath - Relative path ot the plug-in's resourcefileName - Optional file nameFileNotFoundExceptionIOExceptionjavax.servlet.ServletExceptionpublic static void downloadDocument(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String sid,
long docId,
String fileVersion,
String fileName,
String suffix,
User user)
throws FileNotFoundException,
IOException,
javax.servlet.ServletException
request - the current requestresponse - the document is written to this objectsid - Session identifier, if not provided the request parameter is
inspecteddocId - Id of the documentfileVersion - name of the file version; if null the latest version
will be returnedsuffix - of the linked document's resourcejavax.servlet.ServletExceptionFileNotFoundExceptionIOExceptionpublic static void downloadFile(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
File file,
String fileName)
throws FileNotFoundException,
IOException,
javax.servlet.ServletException
request - the current requestresponse - the file is written to this objectjavax.servlet.ServletExceptionFileNotFoundExceptionIOExceptionpublic static void setContentDisposition(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String filename,
boolean asAttachment)
throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic static void downloadDocumentText(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
long docId,
User user)
throws FileNotFoundException,
IOException
request - the current requestresponse - the document is written to this objectdocId - Id of the documentversion - name of the version; if null the latest version will
returnedFileNotFoundExceptionIOExceptionpublic static void downloadDocument(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String sid,
String docId,
String fileVersion,
String fileName,
User user)
throws FileNotFoundException,
IOException,
NumberFormatException,
javax.servlet.ServletException
request - the current requestresponse - the document is written to this objectdocId - Id of the documentfileVersion - name of the file version; if null the latest version
will be returnedjavax.servlet.ServletExceptionNumberFormatExceptionFileNotFoundExceptionIOExceptionpublic static void uploadDocumentResource(javax.servlet.http.HttpServletRequest request,
String docId,
String suffix,
String fileVersion,
String docVersion)
throws Exception
request - the current requestdocId - Id of the documentsuffix - Suffix of the documentfileVersion - id of the file version; if null the latest version
will returneddocVersion - id of the doc version; if null the latest version will
returnedExceptionCopyright © 2008-2014 Logical Objects. All Rights Reserved.