mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged BRANCHES/DEV/THOR1_WEBDAV to HEAD:
34820: WebDAV: PUT method holds on to record of file-size and a FileInfo record after upload. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@34821 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -51,6 +51,8 @@ public class PutMethod extends WebDAVMethod implements ActivityPostProducer
|
|||||||
private boolean noContent = false;
|
private boolean noContent = false;
|
||||||
private boolean created = false;
|
private boolean created = false;
|
||||||
private ActivityPoster activityPoster;
|
private ActivityPoster activityPoster;
|
||||||
|
private FileInfo contentNodeInfo;
|
||||||
|
private long fileSize;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default constructor
|
* Default constructor
|
||||||
@@ -151,7 +153,6 @@ public class PutMethod extends WebDAVMethod implements ActivityPostProducer
|
|||||||
FileFolderService fileFolderService = getFileFolderService();
|
FileFolderService fileFolderService = getFileFolderService();
|
||||||
|
|
||||||
// Get the status for the request path
|
// Get the status for the request path
|
||||||
FileInfo contentNodeInfo = null;
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
contentNodeInfo = getDAVHelper().getNodeForPath(getRootNodeRef(), getPath(), getServletPath());
|
contentNodeInfo = getDAVHelper().getNodeForPath(getRootNodeRef(), getPath(), getServletPath());
|
||||||
@@ -250,6 +251,9 @@ public class PutMethod extends WebDAVMethod implements ActivityPostProducer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Record the uploaded file's size
|
||||||
|
fileSize = writer.getSize();
|
||||||
|
|
||||||
// Set the response status, depending if the node existed or not
|
// Set the response status, depending if the node existed or not
|
||||||
m_response.setStatus(created ? HttpServletResponse.SC_CREATED : HttpServletResponse.SC_NO_CONTENT);
|
m_response.setStatus(created ? HttpServletResponse.SC_CREATED : HttpServletResponse.SC_NO_CONTENT);
|
||||||
}
|
}
|
||||||
@@ -302,7 +306,27 @@ public class PutMethod extends WebDAVMethod implements ActivityPostProducer
|
|||||||
*/
|
*/
|
||||||
public String getContentType()
|
public String getContentType()
|
||||||
{
|
{
|
||||||
return this.m_strContentType;
|
return m_strContentType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The FileInfo for the uploaded file, or null if not yet uploaded.
|
||||||
|
*
|
||||||
|
* @return FileInfo
|
||||||
|
*/
|
||||||
|
public FileInfo getContentNodeInfo()
|
||||||
|
{
|
||||||
|
return contentNodeInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the size of the uploaded file, zero if not yet uploaded.
|
||||||
|
*
|
||||||
|
* @return the fileSize
|
||||||
|
*/
|
||||||
|
public long getFileSize()
|
||||||
|
{
|
||||||
|
return fileSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user