public class FilesEndpoint extends DefaultObject
See Files endpoint.
Modifier and Type | Field and Description |
---|---|
protected String |
baseURL |
protected Blob |
blob |
protected DocumentModel |
doc |
protected String |
fileId |
protected javax.ws.rs.core.HttpHeaders |
httpHeaders |
protected javax.servlet.http.HttpServletRequest |
request |
protected javax.servlet.http.HttpServletResponse |
response |
protected CoreSession |
session |
protected String |
wopiBaseURL |
protected String |
xpath |
Constructor and Description |
---|
FilesEndpoint() |
Modifier and Type | Method and Description |
---|---|
protected void |
addBreadcrumbProperties(Map<String,Serializable> map) |
protected void |
addFileURLProperties(Map<String,Serializable> map) |
protected void |
addHostCapabilitiesProperties(Map<String,Serializable> map) |
protected void |
addRequiredProperties(Map<String,Serializable> map) |
protected void |
addUserMetadataProperties(Map<String,Serializable> map) |
protected void |
addUserPermissionsProperties(Map<String,Serializable> map) |
protected Map<String,Serializable> |
buildCheckFileInfoMap() |
protected javax.ws.rs.core.Response |
buildConflictResponse(String operation,
String lock)
Builds a conflict response with the given WOPI lock as a header.
|
protected javax.ws.rs.core.Response |
buildItemVersionResponse(String operation,
Blob blob) |
javax.ws.rs.core.Response |
checkFileInfo()
Implements the CheckFileInfo operation.
|
protected void |
checkWritePropertiesPermission(String operation) |
protected Blob |
createBlobFromRequestBody(String filename,
String mimeType)
Creates a new blob from the request body, given a
filename and an optional mimeType . |
protected DocumentModel |
createVersionFromRequestBody(String filename) |
Object |
doPost(Operation operation) |
Object |
doPostContents(Operation operation) |
protected String |
getCurrentLock(String operation)
Returns the WOPI lock if not null and throws a
ConflictException otherwise. |
protected String |
getDocumentURL(DocumentModel doc) |
protected String |
getEntityString(Object entity) |
Object |
getFile(String maxExpectedSizeHeader)
Implements the GetFile operation.
|
protected String |
getHeader(String operation,
String headerName) |
protected String |
getHeader(String operation,
String headerName,
boolean nullable) |
protected String |
getHeaderString(String... headers) |
protected Object |
getLock()
Implements the GetLock operation.
|
protected int |
getMaxExpectedSize(String maxExpectedSizeHeader) |
Object |
getShareUrl()
Implements the GetShareUrl operation.
|
void |
initialize(Object... args) |
protected Object |
lock(String lock) |
protected Object |
lockOrUnlockAndRelock()
Implements the Lock and UnlockAndRelock operations.
|
protected void |
logCondition(String condition) |
protected void |
logCondition(Supplier<String> condition) |
protected void |
logNuxeoAction(String action) |
protected void |
logNuxeoAction(Supplier<String> action) |
protected void |
logRequest(String operation,
String... headers) |
protected void |
logResponse(String operation,
int status,
Object entity,
String... headers) |
protected void |
logResponse(String operation,
int status,
String... headers) |
Object |
putFile()
Implements the PutFile operation.
|
Object |
putRelativeFile()
Implements the PutRelativeFile operation.
|
protected Object |
refreshLock()
Implements the RefreshLock operation.
|
protected javax.ws.rs.core.Response |
renameBlob(String requestedName)
Renames the blob with the
requestedName . |
Object |
renameFile()
Implements the RenameFile operation.
|
protected Object |
unlock()
Implements the Unlock operation.
|
protected Object |
unlockAndRelock(String lock,
String oldLock) |
protected Object |
unlockOrRefresh(String operation,
String lock,
boolean unlock) |
protected javax.ws.rs.core.Response |
updateBlob()
Updates the document's blob from a new one.
|
disptachAdapter, isAdapter
checkGuard, dispose, getActiveAdapter, getAdapter, getContext, getFacets, getLinks, getModule, getName, getNext, getNextSegment, getPath, getPrevious, getTemplate, getTrailingPath, getType, getURL, getView, hasFacet, initialize, isInstanceOf, isRoot, newAdapter, newObject, redirect, setNext, setPrevious, setRoot, toString
@Context protected javax.servlet.http.HttpServletRequest request
@Context protected javax.servlet.http.HttpServletResponse response
@Context protected javax.ws.rs.core.HttpHeaders httpHeaders
protected CoreSession session
protected DocumentModel doc
protected String wopiBaseURL
public FilesEndpoint()
public void initialize(Object... args)
initialize
in class AbstractResource<ResourceTypeImpl>
public javax.ws.rs.core.Response checkFileInfo()
See CheckFileInfo.
public Object getFile(@HeaderParam(value="X-WOPI-MaxExpectedSize") String maxExpectedSizeHeader)
See GetFile.
protected Object lockOrUnlockAndRelock()
See Lock and UnlockAndRelock.
protected javax.ws.rs.core.Response buildItemVersionResponse(String operation, Blob blob)
protected Object unlockAndRelock(String lock, String oldLock)
protected String getCurrentLock(String operation)
ConflictException
otherwise.
Must be called to check that a locked document is not locked by Nuxeo.
protected javax.ws.rs.core.Response buildConflictResponse(String operation, String lock)
Must be called in case of "lock mismatch", for instance when a document is locked by another WOPI client.
protected Object unlockOrRefresh(String operation, String lock, boolean unlock)
public Object putRelativeFile()
New file creation is not supported, only the binary document conversion is supported.
See PutRelativeFile.
protected DocumentModel createVersionFromRequestBody(String filename)
public Object renameFile()
See RenameFile.
protected javax.ws.rs.core.Response renameBlob(String requestedName)
requestedName
.public Object getShareUrl()
See GetShareUrl.
public Object doPostContents(@HeaderParam(value="X-WOPI-Override") Operation operation)
protected javax.ws.rs.core.Response updateBlob()
protected Blob createBlobFromRequestBody(String filename, String mimeType)
filename
and an optional mimeType
.protected Object refreshLock()
See RefreshLock.
protected int getMaxExpectedSize(String maxExpectedSizeHeader)
protected void checkWritePropertiesPermission(String operation)
protected Map<String,Serializable> buildCheckFileInfoMap()
protected void addRequiredProperties(Map<String,Serializable> map)
protected void addHostCapabilitiesProperties(Map<String,Serializable> map)
protected void addUserMetadataProperties(Map<String,Serializable> map)
protected void addUserPermissionsProperties(Map<String,Serializable> map)
protected void addFileURLProperties(Map<String,Serializable> map)
protected void addBreadcrumbProperties(Map<String,Serializable> map)
protected String getDocumentURL(DocumentModel doc)
protected void logRequest(String operation, String... headers)
protected void logCondition(String condition)
protected void logCondition(Supplier<String> condition)
protected void logNuxeoAction(String action)
protected void logNuxeoAction(Supplier<String> action)
protected void logResponse(String operation, int status, String... headers)
protected void logResponse(String operation, int status, Object entity, String... headers)
protected String getHeaderString(String... headers)
protected String getEntityString(Object entity)
Copyright © 2019 Nuxeo. All rights reserved.