|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.logicaldoc.web.util.ServletDocUtil
public class ServletDocUtil
Some helper utilities to download/upload a document and its resources. The downloaded document is also added to the recent files of the user.
Constructor Summary | |
---|---|
ServletDocUtil()
|
Method Summary | |
---|---|
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,
long docId,
java.lang.String fileVersion,
java.lang.String suffix,
com.logicaldoc.core.security.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,
java.lang.String docId,
java.lang.String fileVersion,
com.logicaldoc.core.security.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)
Sends the specified document's indexed text to the response object; the client will receive it as a download |
static void |
uploadDocumentResource(javax.servlet.http.HttpServletRequest request,
java.lang.String docId,
java.lang.String suffix,
java.lang.String fileVersion,
java.lang.String docVersion)
Uploads a document's related resource. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServletDocUtil()
Method Detail |
---|
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 downloadDocument(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, long docId, java.lang.String fileVersion, java.lang.String suffix, com.logicaldoc.core.security.User user) throws java.io.FileNotFoundException, java.io.IOException
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 returned
java.io.FileNotFoundException
java.io.IOException
public static void downloadDocumentText(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, long docId) throws java.io.FileNotFoundException, java.io.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
returned
java.io.FileNotFoundException
java.io.IOException
public static void downloadDocument(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String docId, java.lang.String fileVersion, com.logicaldoc.core.security.User user) throws java.io.FileNotFoundException, java.io.IOException
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 returned
java.io.FileNotFoundException
java.io.IOException
public static void uploadDocumentResource(javax.servlet.http.HttpServletRequest request, java.lang.String docId, java.lang.String suffix, java.lang.String fileVersion, java.lang.String docVersion) throws java.lang.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
returned
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |